Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions api/python/debuggercontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1652,3 +1652,15 @@ def __ne__(self, other):

def __hash__(self):
return hash(ctypes.addressof(self.handle.contents))


def _get_debugger(instance: binaryninja.PythonScriptingInstance):
if instance.interpreter.active_view is None:
return None
return DebuggerController(instance.interpreter.active_view)


binaryninja.PythonScriptingProvider.register_magic_variable(
"dbg",
_get_debugger
)