Created
August 11, 2024 12:58
-
-
Save pcuenca/85f773a621edaf1dc930842dd2428d6b to your computer and use it in GitHub Desktop.
Debug Rust dylib from Python script in Visual Studio Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
// To debug a Rust dylib (tiktoken) from a Pyton script: | |
// - Launch the Python script with the Python debugger and stop at a breakpoint. | |
// - Get the process id (for example, `os.getpid()`) | |
// - Select the Attach target in the debugger and select that PID | |
"type": "lldb", | |
"request": "attach", | |
"name": "Attach", | |
"pid": "${command:pickMyProcess}" // use ${command:pickProcess} to pick other users' processes | |
}, | |
{ | |
"name": "Python: Current File (Integrated Terminal)", | |
"type": "python", | |
"request": "launch", | |
"program": "${file}", | |
"console": "integratedTerminal", | |
"justMyCode": false | |
}, | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment