Improve the debugger python client messages (#1654)

JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
This commit is contained in:
Levente Orban
2017-03-17 01:01:10 +01:00
committed by yichoi
parent edadc53def
commit 05bb5d7890
9 changed files with 121 additions and 63 deletions
+6 -1
View File
@@ -147,10 +147,13 @@ class DebuggerPrompt(Cmd):
self.stop = False self.stop = False
self.quit = False self.quit = False
self.cont = True self.cont = True
self.non_interactive = False
def precmd(self, line): def precmd(self, line):
self.stop = False self.stop = False
self.cont = False self.cont = False
if self.non_interactive:
print("%s" % line)
return line return line
def postcmd(self, stop, line): def postcmd(self, stop, line):
@@ -187,7 +190,8 @@ class DebuggerPrompt(Cmd):
self.exec_command(args, JERRY_DEBUGGER_CONTINUE) self.exec_command(args, JERRY_DEBUGGER_CONTINUE)
self.stop = True self.stop = True
self.cont = True self.cont = True
print("Press enter to stop JavaScript execution.") if not self.non_interactive:
print("Press enter to stop JavaScript execution.")
do_c = do_continue do_c = do_continue
@@ -706,6 +710,7 @@ def main():
prompt = DebuggerPrompt(debugger) prompt = DebuggerPrompt(debugger)
prompt.prompt = "(jerry-debugger) " prompt.prompt = "(jerry-debugger) "
prompt.non_interactive = non_interactive
while True: while True:
if not non_interactive and prompt.cont: if not non_interactive and prompt.cont:
+23 -12
View File
@@ -1,20 +1,31 @@
Connecting to: localhost:5001 Connecting to: localhost:5001
Stopped at tests/debugger/do_backtrace.js:15 Stopped at tests/debugger/do_backtrace.js:15
(jerry-debugger) Stopped at tests/debugger/do_backtrace.js:28 (jerry-debugger) next
(jerry-debugger) Stopped at tests/debugger/do_backtrace.js:37 Stopped at tests/debugger/do_backtrace.js:28
(jerry-debugger) Stopped at tests/debugger/do_backtrace.js:40 (jerry-debugger) n
(jerry-debugger) Stopped at tests/debugger/do_backtrace.js:32 (in test() at line:30, col:1) Stopped at tests/debugger/do_backtrace.js:37
(jerry-debugger) Stopped at tests/debugger/do_backtrace.js:33 (in test() at line:30, col:1) (jerry-debugger) next
(jerry-debugger) Stopped at tests/debugger/do_backtrace.js:23 (in foo() at line:21, col:1) Stopped at tests/debugger/do_backtrace.js:40
(jerry-debugger) Frame 0: tests/debugger/do_backtrace.js:23 (in foo() at line:21, col:1) (jerry-debugger) step
Stopped at tests/debugger/do_backtrace.js:32 (in test() at line:30, col:1)
(jerry-debugger) next
Stopped at tests/debugger/do_backtrace.js:33 (in test() at line:30, col:1)
(jerry-debugger) s
Stopped at tests/debugger/do_backtrace.js:23 (in foo() at line:21, col:1)
(jerry-debugger) bt
Frame 0: tests/debugger/do_backtrace.js:23 (in foo() at line:21, col:1)
Frame 1: tests/debugger/do_backtrace.js:33 (in test() at line:30, col:1) Frame 1: tests/debugger/do_backtrace.js:33 (in test() at line:30, col:1)
Frame 2: tests/debugger/do_backtrace.js:40 Frame 2: tests/debugger/do_backtrace.js:40
(jerry-debugger) Stopped at tests/debugger/do_backtrace.js:24 (in foo() at line:21, col:1) (jerry-debugger) n
(jerry-debugger) Stopped at tests/debugger/do_backtrace.js:25 (in foo() at line:21, col:1) Stopped at tests/debugger/do_backtrace.js:24 (in foo() at line:21, col:1)
(jerry-debugger) Stopped at tests/debugger/do_backtrace.js:18 (in f4() at line:17, col:1) (jerry-debugger) n
(jerry-debugger) Frame 0: tests/debugger/do_backtrace.js:18 (in f4() at line:17, col:1) Stopped at tests/debugger/do_backtrace.js:25 (in foo() at line:21, col:1)
(jerry-debugger) s
Stopped at tests/debugger/do_backtrace.js:18 (in f4() at line:17, col:1)
(jerry-debugger) backtrace
Frame 0: tests/debugger/do_backtrace.js:18 (in f4() at line:17, col:1)
Frame 1: tests/debugger/do_backtrace.js:25 (in foo() at line:21, col:1) Frame 1: tests/debugger/do_backtrace.js:25 (in foo() at line:21, col:1)
Frame 2: tests/debugger/do_backtrace.js:33 (in test() at line:30, col:1) Frame 2: tests/debugger/do_backtrace.js:33 (in test() at line:30, col:1)
Frame 3: tests/debugger/do_backtrace.js:40 Frame 3: tests/debugger/do_backtrace.js:40
(jerry-debugger) Press enter to stop JavaScript execution. (jerry-debugger) c
Connection closed. Connection closed.
+15 -9
View File
@@ -1,21 +1,27 @@
Connecting to: localhost:5001 Connecting to: localhost:5001
Stopped at tests/debugger/do_break.js:15 Stopped at tests/debugger/do_break.js:15
(jerry-debugger) Breakpoint 1 at tests/debugger/do_break.js:51 (jerry-debugger) break do_break.js:51
(jerry-debugger) Breakpoint 2 at tests/debugger/do_break.js:36 (in test() at line:20, col:1) Breakpoint 1 at tests/debugger/do_break.js:51
(jerry-debugger) Breakpoint 3 at tests/debugger/do_break.js:33 (in f() at line:31, col:3) (jerry-debugger) b do_break.js:36
Breakpoint 2 at tests/debugger/do_break.js:36 (in test() at line:20, col:1)
(jerry-debugger) break f
Breakpoint 3 at tests/debugger/do_break.js:33 (in f() at line:31, col:3)
Breakpoint 4 at tests/debugger/do_break.js:45 (in f() at line:43, col:1) Breakpoint 4 at tests/debugger/do_break.js:45 (in f() at line:43, col:1)
(jerry-debugger) 1: tests/debugger/do_break.js:51 (jerry-debugger) list
1: tests/debugger/do_break.js:51
2: tests/debugger/do_break.js:36 (in test() at line:20, col:1) 2: tests/debugger/do_break.js:36 (in test() at line:20, col:1)
3: tests/debugger/do_break.js:33 (in f() at line:31, col:3) 3: tests/debugger/do_break.js:33 (in f() at line:31, col:3)
4: tests/debugger/do_break.js:45 (in f() at line:43, col:1) 4: tests/debugger/do_break.js:45 (in f() at line:43, col:1)
(jerry-debugger) Press enter to stop JavaScript execution. (jerry-debugger) c
Stopped at breakpoint:1 tests/debugger/do_break.js:51 Stopped at breakpoint:1 tests/debugger/do_break.js:51
(jerry-debugger) (jerry-debugger) 2: tests/debugger/do_break.js:36 (in test() at line:20, col:1) (jerry-debugger) delete 1
(jerry-debugger) list
2: tests/debugger/do_break.js:36 (in test() at line:20, col:1)
3: tests/debugger/do_break.js:33 (in f() at line:31, col:3) 3: tests/debugger/do_break.js:33 (in f() at line:31, col:3)
4: tests/debugger/do_break.js:45 (in f() at line:43, col:1) 4: tests/debugger/do_break.js:45 (in f() at line:43, col:1)
(jerry-debugger) Press enter to stop JavaScript execution. (jerry-debugger) c
Stopped at breakpoint:2 tests/debugger/do_break.js:36 (in test() at line:20, col:1) Stopped at breakpoint:2 tests/debugger/do_break.js:36 (in test() at line:20, col:1)
(jerry-debugger) Press enter to stop JavaScript execution. (jerry-debugger) continue
Stopped at breakpoint:3 tests/debugger/do_break.js:33 (in f() at line:31, col:3) Stopped at breakpoint:3 tests/debugger/do_break.js:33 (in f() at line:31, col:3)
(jerry-debugger) Press enter to stop JavaScript execution. (jerry-debugger) c
Connection closed. Connection closed.
+1 -1
View File
@@ -1,3 +1,3 @@
Connecting to: localhost:5001 Connecting to: localhost:5001
Stopped at tests/debugger/do_continue.js:16 Stopped at tests/debugger/do_continue.js:16
(jerry-debugger) Press enter to stop JavaScript execution. (jerry-debugger) continue
+12 -6
View File
@@ -1,11 +1,17 @@
Connecting to: localhost:5001 Connecting to: localhost:5001
Stopped at tests/debugger/do_delete_all.js:15 Stopped at tests/debugger/do_delete_all.js:15
(jerry-debugger) Breakpoint 1 at tests/debugger/do_delete_all.js:17 (jerry-debugger) break do_delete_all.js:17
(jerry-debugger) Breakpoint 2 at tests/debugger/do_delete_all.js:18 Breakpoint 1 at tests/debugger/do_delete_all.js:17
(jerry-debugger) Breakpoint 3 at tests/debugger/do_delete_all.js:21 (in delete_test() at line:20, col:1) (jerry-debugger) b do_delete_all.js:18
(jerry-debugger) 1: tests/debugger/do_delete_all.js:17 Breakpoint 2 at tests/debugger/do_delete_all.js:18
(jerry-debugger) b do_delete_all.js:21
Breakpoint 3 at tests/debugger/do_delete_all.js:21 (in delete_test() at line:20, col:1)
(jerry-debugger) list
1: tests/debugger/do_delete_all.js:17
2: tests/debugger/do_delete_all.js:18 2: tests/debugger/do_delete_all.js:18
3: tests/debugger/do_delete_all.js:21 (in delete_test() at line:20, col:1) 3: tests/debugger/do_delete_all.js:21 (in delete_test() at line:20, col:1)
(jerry-debugger) (jerry-debugger) Stopped at tests/debugger/do_delete_all.js:16 (jerry-debugger) delete all
(jerry-debugger) Press enter to stop JavaScript execution. (jerry-debugger) next
Stopped at tests/debugger/do_delete_all.js:16
(jerry-debugger) c
Connection closed. Connection closed.
+3 -2
View File
@@ -1,11 +1,12 @@
Connecting to: localhost:5001 Connecting to: localhost:5001
Stopped at tests/debugger/do_dump.js:15 Stopped at tests/debugger/do_dump.js:15
(jerry-debugger) {60: Function(byte_code_cp:0x3c, source_name:"tests/debugger/do_dump.js", name:"", line:54, column: 8 { Breakpoint(line:58, offset:12, active_index:-1) }), (jerry-debugger) dump
{60: Function(byte_code_cp:0x3c, source_name:"tests/debugger/do_dump.js", name:"", line:54, column: 8 { Breakpoint(line:58, offset:12, active_index:-1) }),
64: Function(byte_code_cp:0x40, source_name:"tests/debugger/do_dump.js", name:"func", line:34, column: 1 { Breakpoint(line:36, offset:16, active_index:-1) }), 64: Function(byte_code_cp:0x40, source_name:"tests/debugger/do_dump.js", name:"func", line:34, column: 1 { Breakpoint(line:36, offset:16, active_index:-1) }),
79: Function(byte_code_cp:0x4f, source_name:"tests/debugger/do_dump.js", name:"f1", line:17, column: 1 { Breakpoint(line:30, offset:23, active_index:-1) }), 79: Function(byte_code_cp:0x4f, source_name:"tests/debugger/do_dump.js", name:"f1", line:17, column: 1 { Breakpoint(line:30, offset:23, active_index:-1) }),
100: Function(byte_code_cp:0x64, source_name:"tests/debugger/do_dump.js", name:"g2", line:26, column: 5 { Breakpoint(line:26, offset:12, active_index:-1) }), 100: Function(byte_code_cp:0x64, source_name:"tests/debugger/do_dump.js", name:"g2", line:26, column: 5 { Breakpoint(line:26, offset:12, active_index:-1) }),
102: Function(byte_code_cp:0x66, source_name:"tests/debugger/do_dump.js", name:"f2", line:19, column: 3 { Breakpoint(line:27, offset:26, active_index:-1) }), 102: Function(byte_code_cp:0x66, source_name:"tests/debugger/do_dump.js", name:"f2", line:19, column: 3 { Breakpoint(line:27, offset:26, active_index:-1) }),
109: Function(byte_code_cp:0x6d, source_name:"tests/debugger/do_dump.js", name:"g1", line:21, column: 5 { Breakpoint(line:22, offset:18, active_index:-1),Breakpoint(line:23, offset:23, active_index:-1) }), 109: Function(byte_code_cp:0x6d, source_name:"tests/debugger/do_dump.js", name:"g1", line:21, column: 5 { Breakpoint(line:22, offset:18, active_index:-1),Breakpoint(line:23, offset:23, active_index:-1) }),
128: Function(byte_code_cp:0x80, source_name:"tests/debugger/do_dump.js", name:"", line:1, column: 1 { Breakpoint(line:41, offset:47, active_index:-1),Breakpoint(line:51, offset:57, active_index:-1),Breakpoint(line:49, offset:52, active_index:-1),Breakpoint(line:54, offset:62, active_index:-1),Breakpoint(line:15, offset:42, active_index:-1) })} 128: Function(byte_code_cp:0x80, source_name:"tests/debugger/do_dump.js", name:"", line:1, column: 1 { Breakpoint(line:41, offset:47, active_index:-1),Breakpoint(line:51, offset:57, active_index:-1),Breakpoint(line:49, offset:52, active_index:-1),Breakpoint(line:54, offset:62, active_index:-1),Breakpoint(line:15, offset:42, active_index:-1) })}
(jerry-debugger) Press enter to stop JavaScript execution. (jerry-debugger) c
Connection closed. Connection closed.
+25 -13
View File
@@ -1,16 +1,28 @@
Connecting to: localhost:5001 Connecting to: localhost:5001
Stopped at tests/debugger/do_eval.js:15 Stopped at tests/debugger/do_eval.js:15
(jerry-debugger) undefined (jerry-debugger) e a
(jerry-debugger) Stopped at tests/debugger/do_eval.js:23 undefined
(jerry-debugger) 5 (jerry-debugger) n
(jerry-debugger) Breakpoint 1 at tests/debugger/do_eval.js:19 (in f() at line:17, col:1) Stopped at tests/debugger/do_eval.js:23
(jerry-debugger) Stopped at breakpoint:1 tests/debugger/do_eval.js:19 (in f() at line:17, col:1) (jerry-debugger) eval a
(jerry-debugger) undefined 5
(jerry-debugger) Stopped at tests/debugger/do_eval.js:20 (in f() at line:17, col:1) (jerry-debugger) break f
(jerry-debugger) 6 Breakpoint 1 at tests/debugger/do_eval.js:19 (in f() at line:17, col:1)
(jerry-debugger) 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 XXX 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 YYY 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 ZZZ 123 (jerry-debugger) n
(jerry-debugger) 8 Stopped at breakpoint:1 tests/debugger/do_eval.js:19 (in f() at line:17, col:1)
(jerry-debugger) Stopped at tests/debugger/do_eval.js:24 (jerry-debugger) e b
(jerry-debugger) 11.3 undefined
(jerry-debugger) Press enter to stop JavaScript execution. (jerry-debugger) next
Stopped at tests/debugger/do_eval.js:20 (in f() at line:17, col:1)
(jerry-debugger) e b
6
(jerry-debugger) e "1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 XXX 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 YYY 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 ZZZ " + 123
1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 XXX 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 YYY 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 ZZZ 123
(jerry-debugger) e b = 8
8
(jerry-debugger) n
Stopped at tests/debugger/do_eval.js:24
(jerry-debugger) e a
11.3
(jerry-debugger) c
Connection closed. Connection closed.
+17 -9
View File
@@ -1,14 +1,22 @@
Connecting to: localhost:5001 Connecting to: localhost:5001
Stopped at tests/debugger/do_src.js:19 Stopped at tests/debugger/do_src.js:19
(jerry-debugger) Breakpoint 1 at tests/debugger/do_src.js:16 (in f() at line:15, col:1) (jerry-debugger) b f
(jerry-debugger) Stopped at breakpoint:1 tests/debugger/do_src.js:16 (in f() at line:15, col:1) Breakpoint 1 at tests/debugger/do_src.js:16 (in f() at line:15, col:1)
(jerry-debugger) Stopped at tests/debugger/do_src.js:20 (jerry-debugger) n
(jerry-debugger) Stopped at <unknown>:1 Stopped at breakpoint:1 tests/debugger/do_src.js:16 (in f() at line:15, col:1)
(jerry-debugger) f = function f() { (jerry-debugger) next
Stopped at tests/debugger/do_src.js:20
(jerry-debugger) s
Stopped at <unknown>:1
(jerry-debugger) src
f = function f() {
print('F2') } print('F2') }
(jerry-debugger) Stopped at tests/debugger/do_src.js:21 (jerry-debugger) n
(jerry-debugger) Stopped at <unknown>:2 (in f() at line:1, col:5) Stopped at tests/debugger/do_src.js:21
(jerry-debugger) f = function f() { (jerry-debugger) step
Stopped at <unknown>:2 (in f() at line:1, col:5)
(jerry-debugger) src
f = function f() {
print('F2') } print('F2') }
(jerry-debugger) Press enter to stop JavaScript execution. (jerry-debugger) c
Connection closed. Connection closed.
+19 -10
View File
@@ -1,17 +1,26 @@
Connecting to: localhost:5001 Connecting to: localhost:5001
Stopped at tests/debugger/do_step.js:32 Stopped at tests/debugger/do_step.js:32
(jerry-debugger) Stopped at tests/debugger/do_step.js:22 (in f1() at line:15, col:1) (jerry-debugger) step
(jerry-debugger) Stopped at tests/debugger/do_step.js:19 (in g() at line:17, col:3) Stopped at tests/debugger/do_step.js:22 (in f1() at line:15, col:1)
(jerry-debugger) Frame 0: tests/debugger/do_step.js:19 (in g() at line:17, col:3) (jerry-debugger) step
Stopped at tests/debugger/do_step.js:19 (in g() at line:17, col:3)
(jerry-debugger) backtrace
Frame 0: tests/debugger/do_step.js:19 (in g() at line:17, col:3)
Frame 1: tests/debugger/do_step.js:22 (in f1() at line:15, col:1) Frame 1: tests/debugger/do_step.js:22 (in f1() at line:15, col:1)
Frame 2: tests/debugger/do_step.js:32 Frame 2: tests/debugger/do_step.js:32
(jerry-debugger) Stopped at tests/debugger/do_step.js:23 (in f1() at line:15, col:1) (jerry-debugger) next
(jerry-debugger) Frame 0: tests/debugger/do_step.js:23 (in f1() at line:15, col:1) Stopped at tests/debugger/do_step.js:23 (in f1() at line:15, col:1)
(jerry-debugger) bt
Frame 0: tests/debugger/do_step.js:23 (in f1() at line:15, col:1)
Frame 1: tests/debugger/do_step.js:32 Frame 1: tests/debugger/do_step.js:32
(jerry-debugger) Stopped at tests/debugger/do_step.js:33 (jerry-debugger) next
(jerry-debugger) Stopped at tests/debugger/do_step.js:28 (in f2() at line:26, col:1) Stopped at tests/debugger/do_step.js:33
(jerry-debugger) Stopped at tests/debugger/do_step.js:29 (in f2() at line:26, col:1) (jerry-debugger) s
(jerry-debugger) Frame 0: tests/debugger/do_step.js:29 (in f2() at line:26, col:1) Stopped at tests/debugger/do_step.js:28 (in f2() at line:26, col:1)
(jerry-debugger) n
Stopped at tests/debugger/do_step.js:29 (in f2() at line:26, col:1)
(jerry-debugger) bt
Frame 0: tests/debugger/do_step.js:29 (in f2() at line:26, col:1)
Frame 1: tests/debugger/do_step.js:33 Frame 1: tests/debugger/do_step.js:33
(jerry-debugger) Press enter to stop JavaScript execution. (jerry-debugger) c
Connection closed. Connection closed.