OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 } else if (request.command == 'references') { | 1236 } else if (request.command == 'references') { |
1237 this.referencesRequest_(request, response); | 1237 this.referencesRequest_(request, response); |
1238 } else if (request.command == 'source') { | 1238 } else if (request.command == 'source') { |
1239 this.sourceRequest_(request, response); | 1239 this.sourceRequest_(request, response); |
1240 } else if (request.command == 'scripts') { | 1240 } else if (request.command == 'scripts') { |
1241 this.scriptsRequest_(request, response); | 1241 this.scriptsRequest_(request, response); |
1242 } else if (request.command == 'threads') { | 1242 } else if (request.command == 'threads') { |
1243 this.threadsRequest_(request, response); | 1243 this.threadsRequest_(request, response); |
1244 } else if (request.command == 'suspend') { | 1244 } else if (request.command == 'suspend') { |
1245 this.suspendRequest_(request, response); | 1245 this.suspendRequest_(request, response); |
| 1246 } else if (request.command == 'version') { |
| 1247 this.versionRequest_(request, response); |
1246 } else { | 1248 } else { |
1247 throw new Error('Unknown command "' + request.command + '" in request'); | 1249 throw new Error('Unknown command "' + request.command + '" in request'); |
1248 } | 1250 } |
1249 } catch (e) { | 1251 } catch (e) { |
1250 // If there is no response object created one (without command). | 1252 // If there is no response object created one (without command). |
1251 if (!response) { | 1253 if (!response) { |
1252 response = this.createResponse(); | 1254 response = this.createResponse(); |
1253 } | 1255 } |
1254 response.success = false; | 1256 response.success = false; |
1255 response.message = %ToString(e); | 1257 response.message = %ToString(e); |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 | 1906 |
1905 // Create the response body. | 1907 // Create the response body. |
1906 response.body = { | 1908 response.body = { |
1907 totalThreads: total_threads, | 1909 totalThreads: total_threads, |
1908 threads: threads | 1910 threads: threads |
1909 } | 1911 } |
1910 }; | 1912 }; |
1911 | 1913 |
1912 | 1914 |
1913 DebugCommandProcessor.prototype.suspendRequest_ = function(request, response) { | 1915 DebugCommandProcessor.prototype.suspendRequest_ = function(request, response) { |
1914 // TODO(peter.rybin): probably we need some body field here. | |
1915 response.running = false; | 1916 response.running = false; |
1916 }; | 1917 }; |
1917 | 1918 |
1918 | 1919 |
| 1920 DebugCommandProcessor.prototype.versionRequest_ = function(request, response) { |
| 1921 response.body = { |
| 1922 V8Version: %GetV8Version() |
| 1923 } |
| 1924 }; |
| 1925 |
| 1926 |
1919 // Check whether the previously processed command caused the VM to become | 1927 // Check whether the previously processed command caused the VM to become |
1920 // running. | 1928 // running. |
1921 DebugCommandProcessor.prototype.isRunning = function() { | 1929 DebugCommandProcessor.prototype.isRunning = function() { |
1922 return this.running_; | 1930 return this.running_; |
1923 } | 1931 } |
1924 | 1932 |
1925 | 1933 |
1926 DebugCommandProcessor.prototype.systemBreak = function(cmd, args) { | 1934 DebugCommandProcessor.prototype.systemBreak = function(cmd, args) { |
1927 return %SystemBreak(); | 1935 return %SystemBreak(); |
1928 }; | 1936 }; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2035 case 'string': | 2043 case 'string': |
2036 case 'number': | 2044 case 'number': |
2037 json = value; | 2045 json = value; |
2038 break | 2046 break |
2039 | 2047 |
2040 default: | 2048 default: |
2041 json = null; | 2049 json = null; |
2042 } | 2050 } |
2043 return json; | 2051 return json; |
2044 } | 2052 } |
OLD | NEW |