Fix inserting pending breakpoints. (#2163)

Before this patch the JS execution is started right after the parsing
is completed. The problem is that some parts of the JS code is executed
before the debugger had any chance to insert pending breakpoints due
to network latency. This patch adds a delay after parsing when at least
one pendding breakpoint is available.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2018-01-23 10:47:47 +01:00
committed by GitHub
parent 40d05cdca2
commit 1c64c1aeb7
11 changed files with 271 additions and 147 deletions
+4 -2
View File
@@ -1,7 +1,9 @@
break :1
y
break f
y
list
n
n
c
list
c
c
+14 -7
View File
@@ -1,17 +1,24 @@
Connecting to: localhost:5001
Stopped at tests/debugger/do_pending_breakpoints.js:15
(jerry-debugger) break :1
No breakpoint found, do you want to add a pending breakpoint? (y or [n])
Pending breakpoint at :1
(jerry-debugger) break f
No breakpoint found, do you want to add a pending breakpoint? (y or [n])
Pending breakpoint at f()
(jerry-debugger) list
=== Pending breakpoints ===
1: f() (pending)
(jerry-debugger) n
1: :1 (pending)
2: f() (pending)
(jerry-debugger) c
out: pending-breakpoints
Stopped at tests/debugger/do_pending_breakpoints.js:17
(jerry-debugger) n
Breakpoint 2 at <unknown>:1 (in f() at line:1, col:1)
Stopped at tests/debugger/do_pending_breakpoints.js:19
Breakpoint 3 at <unknown>:1
Breakpoint 4 at <unknown>:3 (in f() at line:2, col:1)
Stopped at breakpoint:3 <unknown>:1
(jerry-debugger) list
=== Active breakpoints ===
3: <unknown>:1
4: <unknown>:3 (in f() at line:2, col:1)
(jerry-debugger) c
Stopped at breakpoint:2 <unknown>:1 (in f() at line:1, col:1)
Stopped at breakpoint:4 <unknown>:3 (in f() at line:2, col:1)
(jerry-debugger) c
+1 -1
View File
@@ -14,7 +14,7 @@
print("pending-breakpoints");
eval("function f(){ return 5 }");
eval("1;\nfunction f()\n{ return 5 }");
var bird = "colibri";
f();