OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Provides communication interface to remote v8 debugger. See | 6 * @fileoverview Provides communication interface to remote v8 debugger. See |
7 * protocol decription at http://code.google.com/p/v8/wiki/DebuggerProtocol | 7 * protocol decription at http://code.google.com/p/v8/wiki/DebuggerProtocol |
8 */ | 8 */ |
9 goog.provide('devtools.DebuggerAgent'); | 9 goog.provide('devtools.DebuggerAgent'); |
10 | 10 |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 'disable_break': false | 1164 'disable_break': false |
1165 }, | 1165 }, |
1166 function(response) { | 1166 function(response) { |
1167 var body = response.getBody(); | 1167 var body = response.getBody(); |
1168 callback(devtools.DebuggerAgent.formatObjectReference_(body)); | 1168 callback(devtools.DebuggerAgent.formatObjectReference_(body)); |
1169 }); | 1169 }); |
1170 }; | 1170 }; |
1171 | 1171 |
1172 | 1172 |
1173 /** | 1173 /** |
| 1174 * Returns variables visible on a given callframe. |
| 1175 * @param {devtools.CallFrame} callFrame Call frame to get variables for. |
| 1176 * @param {function(Object):undefined} callback Callback to report result to. |
| 1177 */ |
| 1178 devtools.CallFrame.getVariablesInScopeAsync = function(callFrame, callback) { |
| 1179 var result = {}; |
| 1180 var scopeChain = callFrame.scopeChain; |
| 1181 var resolvedScopeCount = 0; |
| 1182 for (var i = 0; i < scopeChain.length; ++i) { |
| 1183 devtools.tools.getDebuggerAgent().resolveScope(scopeChain[i], |
| 1184 function(scopeObject) { |
| 1185 for (var property in scopeObject.resolvedValue) { |
| 1186 result[property] = true; |
| 1187 } |
| 1188 if (++resolvedScopeCount == scopeChain.length) { |
| 1189 callback(result); |
| 1190 } |
| 1191 }); |
| 1192 } |
| 1193 }; |
| 1194 |
| 1195 |
| 1196 /** |
1174 * JSON based commands sent to v8 debugger. | 1197 * JSON based commands sent to v8 debugger. |
1175 * @param {string} command Name of the command to execute. | 1198 * @param {string} command Name of the command to execute. |
1176 * @param {Object} opt_arguments Command-specific arguments map. | 1199 * @param {Object} opt_arguments Command-specific arguments map. |
1177 * @constructor | 1200 * @constructor |
1178 */ | 1201 */ |
1179 devtools.DebugCommand = function(command, opt_arguments) { | 1202 devtools.DebugCommand = function(command, opt_arguments) { |
1180 this.command_ = command; | 1203 this.command_ = command; |
1181 this.type_ = 'request'; | 1204 this.type_ = 'request'; |
1182 this.seq_ = ++devtools.DebugCommand.nextSeq_; | 1205 this.seq_ = ++devtools.DebugCommand.nextSeq_; |
1183 if (opt_arguments) { | 1206 if (opt_arguments) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 | 1324 |
1302 | 1325 |
1303 /** | 1326 /** |
1304 * @param {number} handle Object handle. | 1327 * @param {number} handle Object handle. |
1305 * @return {?Object} Returns the object with the handle if it was sent in this | 1328 * @return {?Object} Returns the object with the handle if it was sent in this |
1306 * message(some objects referenced by handles may be missing in the message). | 1329 * message(some objects referenced by handles may be missing in the message). |
1307 */ | 1330 */ |
1308 devtools.DebuggerMessage.prototype.lookup = function(handle) { | 1331 devtools.DebuggerMessage.prototype.lookup = function(handle) { |
1309 return this.refs_[handle]; | 1332 return this.refs_[handle]; |
1310 }; | 1333 }; |
OLD | NEW |