MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / connect_vscode_debugger

Function connect_vscode_debugger

python/__init__.py:445–463  ·  view source on GitHub ↗

Connect to Visual Studio Code for debugging. This function blocks until the debugger is connected! Not recommended for use in startup.py .. note:: See the `user documentation `_ for step-by-step instructions on how to set

(port=5678)

Source from the content-addressed store, hash-verified

443
444
445def connect_vscode_debugger(port=5678):
446 """
447 Connect to Visual Studio Code for debugging. This function blocks until the debugger
448 is connected! Not recommended for use in startup.py
449
450 .. note:: See the `user documentation <https://docs.binary.ninja/dev/plugins.html#remote-debugging-with-vscode>`_ for step-by-step instructions on how to set up Python debugging.
451
452 :param port: Port number for connecting to the debugger.
453 """
454 # pip install --user debugpy
455 import debugpy # type: ignore
456 import sys
457 if sys.platform == "win32":
458 debugpy.configure(python=f"{sys.base_exec_prefix}/python", qt="pyside2")
459 else:
460 debugpy.configure(python=f"{sys.base_exec_prefix}/bin/python3", qt="pyside2")
461 debugpy.listen(("127.0.0.1", port))
462 debugpy.wait_for_client()
463 execute_on_main_thread(lambda: debugpy.debug_this_thread())
464
465
466class UIPluginInHeadlessError(Exception):

Callers

nothing calls this directly

Calls 2

configureMethod · 0.80
execute_on_main_threadFunction · 0.70

Tested by

no test coverage detected