OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Simple interactive debugger shell that connects to the Dart VM's debugger | 5 // Simple interactive debugger shell that connects to the Dart VM's debugger |
6 // connection port. | 6 // connection port. |
7 | 7 |
8 import "dart:convert"; | 8 import "dart:convert"; |
9 import "dart:io"; | 9 import "dart:io"; |
10 import "dart:async"; | 10 import "dart:async"; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // TODO(turnidge): Convert all commands to use the Command class. | 178 // TODO(turnidge): Convert all commands to use the Command class. |
179 print(""" | 179 print(""" |
180 bt Show backtrace | 180 bt Show backtrace |
181 r Resume execution | 181 r Resume execution |
182 s Single step | 182 s Single step |
183 so Step over | 183 so Step over |
184 si Step into | 184 si Step into |
185 sbp [<file>] <line> Set breakpoint | 185 sbp [<file>] <line> Set breakpoint |
186 rbp <id> Remove breakpoint with given id | 186 rbp <id> Remove breakpoint with given id |
187 po <id> Print object info for given id | 187 po <id> Print object info for given id |
| 188 eval fr <n> <expr> Evaluate expr on stack frame index n |
188 eval obj <id> <expr> Evaluate expr on object id | 189 eval obj <id> <expr> Evaluate expr on object id |
189 eval cls <id> <expr> Evaluate expr on class id | 190 eval cls <id> <expr> Evaluate expr on class id |
190 eval lib <id> <expr> Evaluate expr in toplevel of library id | 191 eval lib <id> <expr> Evaluate expr in toplevel of library id |
191 pl <id> <idx> [<len>] Print list element/slice | 192 pl <id> <idx> [<len>] Print list element/slice |
192 pc <id> Print class info for given id | 193 pc <id> Print class info for given id |
193 ll List loaded libraries | 194 ll List loaded libraries |
194 plib <id> Print library info for given library id | 195 plib <id> Print library info for given library id |
195 slib <id> <true|false> Set library id debuggable | 196 slib <id> <true|false> Set library id debuggable |
196 pg <id> Print all global variables visible within given library id | 197 pg <id> Print all global variables visible within given library id |
197 ls <lib_id> List loaded scripts in library | 198 ls <lib_id> List loaded scripts in library |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 return; | 615 return; |
615 } | 616 } |
616 var expr = args.getRange(3, args.length).join(" "); | 617 var expr = args.getRange(3, args.length).join(" "); |
617 var target = args[1]; | 618 var target = args[1]; |
618 if (target == "obj") { | 619 if (target == "obj") { |
619 target = "objectId"; | 620 target = "objectId"; |
620 } else if (target == "cls") { | 621 } else if (target == "cls") { |
621 target = "classId"; | 622 target = "classId"; |
622 } else if (target == "lib") { | 623 } else if (target == "lib") { |
623 target = "libraryId"; | 624 target = "libraryId"; |
| 625 } else if (target == "fr") { |
| 626 target = "frameId"; |
624 } else { | 627 } else { |
625 huh(); | 628 huh(); |
626 return; | 629 return; |
627 } | 630 } |
628 var cmd = { "id": seqNum, | 631 var cmd = { "id": seqNum, |
629 "command": "evaluateExpr", | 632 "command": "evaluateExpr", |
630 "params": { "isolateId": currentIsolate.id, | 633 "params": { "isolateId": currentIsolate.id, |
631 target: int.parse(args[2]), | 634 target: int.parse(args[2]), |
632 "expression": expr } }; | 635 "expression": expr } }; |
633 sendCmd(cmd).then(showPromptAfter(handleEvalResponse)); | 636 sendCmd(cmd).then(showPromptAfter(handleEvalResponse)); |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1482 handleUncaughtError: debuggerError)); | 1485 handleUncaughtError: debuggerError)); |
1483 | 1486 |
1484 zone.run(() { | 1487 zone.run(() { |
1485 parseArgs(args); | 1488 parseArgs(args); |
1486 cmdo = new Commando(completer: debuggerCommandCompleter); | 1489 cmdo = new Commando(completer: debuggerCommandCompleter); |
1487 cmdSubscription = cmdo.commands.listen(processCommand, | 1490 cmdSubscription = cmdo.commands.listen(processCommand, |
1488 onError: processError, | 1491 onError: processError, |
1489 onDone: processDone); | 1492 onDone: processDone); |
1490 }); | 1493 }); |
1491 } | 1494 } |
OLD | NEW |