|
25 | 25 | import struct |
26 | 26 | import sys |
27 | 27 | import math |
| 28 | +import time |
28 | 29 |
|
29 | 30 | # Expected debugger protocol version. |
30 | 31 | JERRY_DEBUGGER_VERSION = 1 |
@@ -273,7 +274,19 @@ def do_step(self, args): |
273 | 274 |
|
274 | 275 | def do_next(self, args): |
275 | 276 | """ Next breakpoint in the same context """ |
276 | | - self.exec_command(args, JERRY_DEBUGGER_NEXT) |
| 277 | + if args == "": |
| 278 | + args = 0 |
| 279 | + else: |
| 280 | + try: |
| 281 | + args = int(args) |
| 282 | + args = min(args, len(self.debugger.last_breakpoint_hit.function.lines) - |
| 283 | + self.debugger.last_breakpoint_hit.function.line) - 1 |
| 284 | + self.debugger.nexts_remain = args |
| 285 | + except ValueError as val_errno: |
| 286 | + print("Error: expected a positive integer: %s" % val_errno) |
| 287 | + return |
| 288 | + |
| 289 | + self.exec_command("", JERRY_DEBUGGER_NEXT) |
277 | 290 | self.cont = True |
278 | 291 |
|
279 | 292 | do_n = do_next |
@@ -571,6 +584,7 @@ def __init__(self, address): |
571 | 584 | self.src_offset_diff = 0 |
572 | 585 | self.client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
573 | 586 | self.client_socket.connect((self.host, self.port)) |
| 587 | + self.nexts_remain = 0 |
574 | 588 |
|
575 | 589 | self.send_message(b"GET /jerry-debugger HTTP/1.1\r\n" + |
576 | 590 | b"Upgrade: websocket\r\n" + |
@@ -1149,7 +1163,12 @@ def main(): |
1149 | 1163 | if debugger.display: |
1150 | 1164 | print_source(prompt.debugger, debugger.display, 0) |
1151 | 1165 |
|
1152 | | - prompt.cmdloop() |
| 1166 | + if debugger.nexts_remain: |
| 1167 | + prompt.do_next(debugger.nexts_remain) |
| 1168 | + time.sleep(0.1) |
| 1169 | + else: |
| 1170 | + prompt.cmdloop() |
| 1171 | + |
1153 | 1172 | if prompt.quit: |
1154 | 1173 | break |
1155 | 1174 |
|
|
0 commit comments