Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: tools/ddbg.dart

Issue 10657048: Debugger support to display global variables (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« runtime/vm/object.cc ('K') | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ddbg.dart
===================================================================
--- tools/ddbg.dart (revision 9118)
+++ tools/ddbg.dart (working copy)
@@ -38,7 +38,8 @@
po <id> Print object info for given id
pc <id> Print class info for given id
ll List loaded libraries
- pl <id> Print dlibrary info for given id
+ pl <id> Print library info for given id
+ pg <id> Print global variables visible given library
siva 2012/06/26 18:46:28 This line doesn't seem to read well. Did you mean
ls <libname> List loaded scripts in library
gs <lib_id> <script_url> Get source text of script in library
epi <none|all|unhandled> Set exception pause info
@@ -120,6 +121,10 @@
var cmd = { "id": seqNum, "command": "getLibraryProperties",
"params": {"libraryId": Math.parseInt(args[1]) }};
sendCmd(cmd).then((result) => handleGetLibraryPropsResponse(result));
+ } else if (command == "pg" && args.length == 2) {
+ var cmd = { "id": seqNum, "command": "getGlobalVariables",
+ "params": {"libraryId": Math.parseInt(args[1]) }};
+ sendCmd(cmd).then((result) => handleGetGlobalVarsResponse(result));
} else if (command == "gs" && args.length == 3) {
var cmd = { "id": seqNum, "command": "getScriptSource",
"params": { "libraryId": Math.parseInt(args[1]),
@@ -214,6 +219,14 @@
}
+handleGetGlobalVarsResponse(response) {
+ List globals = response["result"]["globals"];
+ for (int i = 0; i < globals.length; i++) {
+ printNamedObject(globals[i]);
+ }
+}
+
+
handleGetSourceResponse(response) {
Map result = response["result"];
String source = result["text"];
@@ -267,9 +280,10 @@
void printStackFrame(frame_num, Map frame) {
var fname = frame["functionName"];
+ var libId = frame["libraryId"];
var url = frame["location"]["url"];
var line = frame["location"]["lineNumber"];
- print("$frame_num $fname ($url:$line)");
+ print("$frame_num $fname ($url:$line) (lib $libId)");
List locals = frame["locals"];
for (int i = 0; i < locals.length; i++) {
printNamedObject(locals[i]);
« runtime/vm/object.cc ('K') | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698