diff options
| author | Glenn Smith <glenn@vector35.com> | 2021-08-14 20:24:48 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2021-08-14 20:25:31 -0400 |
| commit | e7a9d025c35410a7ac187f8c9a2b8eb20641ebe9 (patch) | |
| tree | 878538bd5a89d93177cab9eba3fc47471d37a0f6 /docs/dev/plugins.md | |
| parent | cabcf1c23cc644bd65dfd4b0060a3c276579a471 (diff) | |
Move debugging info to plugin dev guide
Diffstat (limited to 'docs/dev/plugins.md')
| -rw-r--r-- | docs/dev/plugins.md | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/docs/dev/plugins.md b/docs/dev/plugins.md index 33fb0948..26a32c15 100644 --- a/docs/dev/plugins.md +++ b/docs/dev/plugins.md @@ -30,4 +30,25 @@ import importlib importlib.reload(pluginname);pluginname.callbackmethod(bv) ``` -Then just `[UP] [ENTER]` to trigger the reload when the plugin has changed.
\ No newline at end of file +Then just `[UP] [ENTER]` to trigger the reload when the plugin has changed. + +## Debugging Python + +If you wish to debug your python scripts, there are a few methods: + +### Remote debugging with VSCode: +1. In VSCode, open the Run and Debug sidebar. +2. Create a `launch.json` file if one does not already exist, or open `launch.json` if one does. +3. In `launch.json`, select Add Configuration > Python > Remote Attach +4. Enter a host of `localhost` and any port +5. Set the path mapping to be from `/` to `/` (Windows: `C:\\` to `C:\\`) +6. Open Binary Ninja +7. Use `connect_vscode_debugger(port=12345)` in the Python Console, using whichever port you selected in `launch.json`. +8. In VSCode, start debugging. You should see the bottom toolbar change color, and the debugger should be attached. + +### Remote debugging with IntelliJ PyCharm Professional **(Does not work on PyCharm Community)**: +1. In PyCharm, add a Run Configuration for Python Debug Server. Give it a name and choose a port and host. +2. Run the `pip install` script displayed in the Run Configuration using whichever python interpreter you have selected for Binary Ninja. +3. In PyCharm, start debugging. You should see "Waiting for process connection..." in the Debugger panel. +4. Open Binary Ninja +5. Use `connect_pycharm_debugger(port=12345)` in the Python Console, using whichever port you selected in the Run Configuration. You should now see "Connected" in the PyCharm Debugger panel. |
