Sort function breakpoints before enabling them (#3238)

Function breakpoints should be sorted before enabling then since the object enumeration order does not grant consistent result.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik 2019-10-24 15:08:03 +02:00 committed by Dániel Bátyai
parent 9e83032ada
commit 99ad34af4a

View File

@ -1089,9 +1089,15 @@ class JerryDebugger(object):
result += self._enable_breakpoint(breakpoint)
else:
functions_to_enable = []
for function in self.function_list.values():
if function.name == string:
result += self._enable_breakpoint(function.lines[function.first_breakpoint_line])
functions_to_enable.append(function)
functions_to_enable.sort(key=lambda x: x.line)
for function in functions_to_enable:
result += self._enable_breakpoint(function.lines[function.first_breakpoint_line])
if not result and not pending:
print("No breakpoint found, do you want to add a %spending breakpoint%s? (y or [n])" % \