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

Unified Diff: tools/ddbg.dart

Issue 10797033: Debugger API to enable/disable debugging of libraries (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « runtime/vm/debugger_api_impl.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 9763)
+++ tools/ddbg.dart (working copy)
@@ -42,6 +42,7 @@
pc <id> Print class info for given id
ll List loaded libraries
plib <id> Print library info for given library id
+ slib <id> <true|false> Set library id debuggable
pg <id> Print all global variables visible within given library id
ls <lib_id> List loaded scripts in library
gs <lib_id> <script_url> Get source text of script in library
@@ -137,6 +138,11 @@
var cmd = { "id": seqNum, "command": "getLibraryProperties",
"params": {"libraryId": Math.parseInt(args[1]) }};
sendCmd(cmd).then((result) => handleGetLibraryPropsResponse(result));
+ } else if (command == "slib" && args.length == 3) {
+ var cmd = { "id": seqNum, "command": "setLibraryProperties",
+ "params": {"libraryId": Math.parseInt(args[1]),
+ "debuggingEnabled": args[2] }};
+ sendCmd(cmd).then((result) => handleSetLibraryPropsResponse(result));
} else if (command == "pg" && args.length == 2) {
var cmd = { "id": seqNum, "command": "getGlobalVariables",
"params": {"libraryId": Math.parseInt(args[1]) }};
@@ -238,7 +244,9 @@
handleGetLibraryPropsResponse(response) {
Map props = response["result"];
assert(props["url"] != null);
- print(" library url=${props["url"]}");
+ print(" library url: ${props["url"]}");
+ assert(props["debuggingEnabled"] != null);
+ print(" debugging enabled: ${props["debuggingEnabled"]}");
List imports = props["imports"];
assert(imports != null);
if (imports.length > 0) {
@@ -258,6 +266,13 @@
}
+handleSetLibraryPropsResponse(response) {
+ Map props = response["result"];
+ assert(props["debuggingEnabled"] != null);
+ print(" debugging enabled: ${props["debuggingEnabled"]}");
+}
+
+
handleGetGlobalVarsResponse(response) {
List globals = response["result"]["globals"];
for (int i = 0; i < globals.length; i++) {
« no previous file with comments | « runtime/vm/debugger_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698