summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2022-03-28 16:05:31 -0400
committerGlenn Smith <glenn@vector35.com>2022-03-28 16:05:31 -0400
commit1291c94d3d5592203200c8e048c9ddc851e812e1 (patch)
treea9ef4fb907ffb49d7d9b19e5d61fc0f29ba393db
parentd5f772351468b88a001ea70dbaa485f7747d0f83 (diff)
Docs for connect_{pycharm|vscode}_debugger, referring to docs site
-rw-r--r--docs/dev/plugins.md1
-rw-r--r--python/__init__.py18
2 files changed, 18 insertions, 1 deletions
diff --git a/docs/dev/plugins.md b/docs/dev/plugins.md
index 1985fcd9..ec6d769e 100644
--- a/docs/dev/plugins.md
+++ b/docs/dev/plugins.md
@@ -47,6 +47,7 @@ If you wish to debug your python scripts, there are a few methods:
### Remote debugging with VSCode:
+1. Run `pip install --user debugpy` in the Python interpreter you have selected in Binary Ninja Settings.
1. In VSCode, open the Run and Debug sidebar.
1. Create a `launch.json` file if one does not already exist, or open `launch.json` if one does.
1. In `launch.json`, select Add Configuration > Python > Remote Attach
diff --git a/python/__init__.py b/python/__init__.py
index 4d9e1fd7..b81b6089 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -330,6 +330,14 @@ def open_view(*args, **kwargs) -> Optional[BinaryView]:
def connect_pycharm_debugger(port=5678):
+ """
+ Connect to PyCharm (Professional Edition) for debugging.
+
+ .. note:: See https://docs.binary.ninja/dev/plugins.html#remote-debugging-with-intellij-pycharm
+ for step-by-step instructions on how to set up Python debugging.
+
+ :param port: Port number for connecting to the debugger.
+ """
# Get pip install string from PyCharm's Python Debug Server Configuration
# e.g. for PyCharm 2021.1.1 #PY-7142.13:
# pip install --user pydevd-pycharm~=211.7142.13
@@ -338,7 +346,15 @@ def connect_pycharm_debugger(port=5678):
def connect_vscode_debugger(port=5678):
- # Note: Calling this from startup.py will cause Binary Ninja to hang on startup until VSCode starts debugging
+ """
+ Connect to Visual Studio Code for debugging. This function blocks until the debugger
+ is connected! Not recommended for use in startup.py
+
+ .. note:: See https://docs.binary.ninja/dev/plugins.html#remote-debugging-with-vscode
+ for step-by-step instructions on how to set up Python debugging.
+
+ :param port: Port number for connecting to the debugger.
+ """
# pip install --user debugpy
import debugpy # type: ignore
import sys