Refactor the debugger multiple command usages (#1643)

JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
This commit is contained in:
Levente Orban
2017-03-06 12:41:22 +01:00
committed by yichoi
parent b13f78f19e
commit 8a86c579e6
+6 -21
View File
@@ -167,9 +167,7 @@ class DebuggerPrompt(Cmd):
""" Insert breakpoints on the given lines """ """ Insert breakpoints on the given lines """
self.insert_breakpoint(args) self.insert_breakpoint(args)
def do_b(self, args): do_b = do_break
""" Insert breakpoints on the given lines """
self.insert_breakpoint(args)
def exec_command(self, args, command_id): def exec_command(self, args, command_id):
self.stop = True self.stop = True
@@ -185,28 +183,19 @@ class DebuggerPrompt(Cmd):
self.cont = True self.cont = True
print("Press enter to stop JavaScript execution.") print("Press enter to stop JavaScript execution.")
def do_c(self, args): do_c = do_continue
""" Continue execution """
self.exec_command(args, JERRY_DEBUGGER_CONTINUE)
self.stop = True
self.cont = True
print("Press enter to stop JavaScript execution.")
def do_step(self, args): def do_step(self, args):
""" Next breakpoint, step into functions """ """ Next breakpoint, step into functions """
self.exec_command(args, JERRY_DEBUGGER_STEP) self.exec_command(args, JERRY_DEBUGGER_STEP)
def do_s(self, args): do_s = do_step
""" Next breakpoint, step into functions """
self.exec_command(args, JERRY_DEBUGGER_STEP)
def do_next(self, args): def do_next(self, args):
""" Next breakpoint in the same context """ """ Next breakpoint in the same context """
self.exec_command(args, JERRY_DEBUGGER_NEXT) self.exec_command(args, JERRY_DEBUGGER_NEXT)
def do_n(self, args): do_n = do_next
""" Next breakpoint in the same context """
self.exec_command(args, JERRY_DEBUGGER_NEXT)
def do_list(self, args): def do_list(self, args):
""" Lists the available breakpoints """ """ Lists the available breakpoints """
@@ -270,9 +259,7 @@ class DebuggerPrompt(Cmd):
""" Get backtrace data from debugger """ """ Get backtrace data from debugger """
self.exec_backtrace(args) self.exec_backtrace(args)
def do_bt(self, args): do_bt = do_backtrace
""" Get backtrace data from debugger """
self.exec_backtrace(args)
def do_src(self, args): def do_src(self, args):
""" Get current source code """ """ Get current source code """
@@ -331,9 +318,7 @@ class DebuggerPrompt(Cmd):
""" Evaluate JavaScript source code """ """ Evaluate JavaScript source code """
self.eval_string(args) self.eval_string(args)
def do_e(self, args): do_e = do_eval
""" Evaluate JavaScript source code """
self.eval_string(args)
class Multimap(object): class Multimap(object):