Skip to content

Commit f33058a

Browse files
committed
Mention gdb and rr for debugging native code
1 parent 15bf07b commit f33058a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/contributor/CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ If the IDE was initialized properly by using the command mentioned above, the ex
127127
128128
Both of these commands also work when you have a `graalpy` executable, e.g. inside a `venv`.
129129
130+
For debugging the C API and native extensions, first make sure you rebuild (`mx clean` first!) graalpything with the environment variable `CFLAGS=-g` set.
131+
This will keep debug symbols in our C API implementation which should allow you to use `gdb` or [`rr`](https://rr-project.org/) to debug.
132+
When you build an SVM image, debugging the entire application is possible, and there are [docs](https://www.graalvm.org/reference-manual/native-image/guides/debug-native-image-process/) to see Java code when inside the native debugger.
133+
Make sure you find and keep the `libpythonvm.so.debug` file around next to your GraalPy build, you can find it somewhere under `graal/sdk/mxbuild`.
134+
130135
## Advanced Commands to Develop and Debug
131136
132137
Here are some advanced commands to debug test failures and fix issues.

0 commit comments

Comments
 (0)