feat: добавил сокращенные команды в пул и возможность получения текущей строки исходного кода
This commit is contained in:
@ -65,11 +65,17 @@ class Debugger:
|
||||
def __init_callbacks__(self):
|
||||
self._callbacks_table = {
|
||||
"step": self._step,
|
||||
"s": self._step,
|
||||
"continue": self._continue,
|
||||
"c": self._continue,
|
||||
"breakpoint": self._breakpoint,
|
||||
"b": self._breakpoint,
|
||||
"print": self._print,
|
||||
"p": self._print,
|
||||
"run": self._run,
|
||||
"inspect": self._inspect
|
||||
"r": self._run,
|
||||
"inspect": self._inspect,
|
||||
"i": self._inspect
|
||||
}
|
||||
|
||||
def do_command(self, command: list[str]) -> str:
|
||||
@ -87,6 +93,9 @@ class Debugger:
|
||||
return f"Virtual machine exception: {e.message}"
|
||||
return ""
|
||||
|
||||
def get_current_source_line_number(self) -> int:
|
||||
return self._dbg_dict["instructions"][self._vm.pc.value]['srcline']
|
||||
|
||||
def _continue(self, args: list[str]) -> str:
|
||||
try:
|
||||
self._vm.continue_()
|
||||
|
||||
Reference in New Issue
Block a user