From b0fb26d613802f4c324fa16ba369332cb71a8240 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2019 19:27:21 +0800 Subject: [PATCH] 1 --- scripts/cdb/cmd.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/scripts/cdb/cmd.py b/scripts/cdb/cmd.py index 05c7d95..b92ff75 100644 --- a/scripts/cdb/cmd.py +++ b/scripts/cdb/cmd.py @@ -16,6 +16,18 @@ def _b_cmd(browser, tab, scriptmgr, params): condition='' ) +def _bc_cmd(browser, tab, scriptmgr, params): + filename = params[0].split(':')[0] + line = int(params[0].split(':')[1]) + url = scriptmgr.getUrl(filename) + print(params, url) + tab.call_method("Debugger.setBreakpointByUrl", + lineNumber=line, + url=url, + columnNumber=0, + condition='' + ) + def _bt_cmd(browser, tab, scriptmgr, params): scriptmgr.dumpStack() @@ -28,6 +40,21 @@ def _p_cmd(browser, tab, scriptmgr, params): def _f_cmd(browser, tab, scriptmgr, params): scriptmgr.curr_frame = int(params[0]) +def _n_cmd(browser, tab, scriptmgr, params): + tab.call_method("Debugger.pause") + +def _s_cmd(browser, tab, scriptmgr, params): + tab.call_method("Debugger.stepInto") + +def _c_cmd(browser, tab, scriptmgr, params): + tab.call_method("Debugger.resume") + +def _sout_cmd(browser, tab, scriptmgr, params): + tab.call_method("Debugger.stepOut") + +def _sover_cmd(browser, tab, scriptmgr, params): + tab.call_method("Debugger.stepOver") + def _debugon_cmd(browser, tab, scriptmgr, params): tab.debug = True print('debug on') @@ -48,9 +75,15 @@ def _processCdbCmd(cmd_str, browser, tab, scriptmgr): return cmd_hash = { 'b': _b_cmd, + 'bc': _bc_cmd, 'bt': _bt_cmd, 'p': _p_cmd, 'f': _f_cmd, + 'n': _n_cmd, + 's': _s_cmd, + 'sout': _sout_cmd, + 'sover': _sover_cmd, + 'c': _c_cmd, 'debugon': _debugon_cmd, 'debugoff': _debugoff_cmd, 'q': _exit_cmd,