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 | |
| parent | cabcf1c23cc644bd65dfd4b0060a3c276579a471 (diff) | |
Move debugging info to plugin dev guide
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/dev/plugins.md | 23 | ||||
| -rw-r--r-- | docs/getting-started.md | 18 |
2 files changed, 23 insertions, 18 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. diff --git a/docs/getting-started.md b/docs/getting-started.md index e1a88300..032e0f85 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -519,23 +519,7 @@ The python interpreter can be customized to run scripts on startup using `startu From here, you can add any custom functions or objects you want to be available in the console. If you want to restore the original copy of `startup.py` at any time, simply delete the file and restart Binary Ninja. A fresh copy of the above will be generated for you in `startup.py`. #### Python Debugging - -If you wish to debug your python scripts, there are a few methods: -1. Remote debugging with VSCode: - a. In VSCode, open the Run and Debug sidebar. - b. Create a `launch.json` file if one does not already exist, or open `launch.json` if one does. - c. In `launch.json`, select Add Configuration > Python > Remote Attach - d. Enter a host of `localhost` and any port - e. Set the path mapping to be from `/` to `/` (Windows: `C:\\` to `C:\\`) - f. Open Binary Ninja - g. Use `connect_vscode_debugger(port=12345)` in the Python Console, using whichever port you selected in `launch.json`. - h. In VSCode, start debugging. You should see the bottom toolbar change color, and the debugger should be attached. -2. Remote debugging with IntelliJ PyCharm Professional **(Does not work on PyCharm Community)**: - a. In PyCharm, add a Run Configuration for Python Debug Server. Give it a name and choose a port and host. - b. Run the `pip install` script displayed in the Run Configuration using whichever python interpreter you have selected for Binary Ninja. - c. In PyCharm, start debugging. You should see "Waiting for process connection..." in the Debugger panel. - d. Open Binary Ninja - e. 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. +See the [plugin development guide](dev/plugins.md#debugging-python). Note !!! Tip "Note" |
