Last line of the source code should be printed by the python debugger client.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -167,6 +167,9 @@ class JerryFunction(object):
|
|||||||
self.first_breakpoint_line = lines[0]
|
self.first_breakpoint_line = lines[0]
|
||||||
self.first_breakpoint_offset = offsets[0]
|
self.first_breakpoint_offset = offsets[0]
|
||||||
|
|
||||||
|
if len(self.source) > 1 and not self.source[-1]:
|
||||||
|
self.source.pop()
|
||||||
|
|
||||||
for i in range(len(lines)):
|
for i in range(len(lines)):
|
||||||
line = lines[i]
|
line = lines[i]
|
||||||
offset = offsets[i]
|
offset = offsets[i]
|
||||||
@@ -858,10 +861,10 @@ def print_source(debugger, line_num):
|
|||||||
|
|
||||||
if line_num == 0:
|
if line_num == 0:
|
||||||
start = 0
|
start = 0
|
||||||
end = len(last_bp.function.source) - 1
|
end = len(last_bp.function.source)
|
||||||
else:
|
else:
|
||||||
start = max(last_bp.line - line_num, 0)
|
start = max(last_bp.line - line_num, 0)
|
||||||
end = min(last_bp.line + line_num-1, len(last_bp.function.source)-1)
|
end = min(last_bp.line + line_num - 1, len(last_bp.function.source))
|
||||||
|
|
||||||
for i in range(start, end):
|
for i in range(start, end):
|
||||||
if i == last_bp.line - 1:
|
if i == last_bp.line - 1:
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ Stopped at tests/debugger/do_src.js:20
|
|||||||
Stopped at <unknown>:1
|
Stopped at <unknown>:1
|
||||||
(jerry-debugger) source 0
|
(jerry-debugger) source 0
|
||||||
1 > f = function f() {
|
1 > f = function f() {
|
||||||
|
2 print('F2') }
|
||||||
(jerry-debugger) n
|
(jerry-debugger) n
|
||||||
Stopped at tests/debugger/do_src.js:21
|
Stopped at tests/debugger/do_src.js:21
|
||||||
(jerry-debugger) step
|
(jerry-debugger) step
|
||||||
|
|||||||
Reference in New Issue
Block a user