Unable to use GDB to debug the actual value of variables in GraalVM Native Image
linghengqian opened this issue · comments
Describe the issue
A clear and concise description of the issue. We recommend using the latest snapshot builds to replicate the issue as bugs are constantly being fixed in the master branch
- Unable to use GDB to debug the actual value of variables in GraalVM Native Image.
- The relevant steps are recorded at https://github.com/linghengqian/native-image-debug-test . Minimal reproducible unit tests are also located at https://github.com/linghengqian/native-image-debug-test .
Steps to reproduce the issue
Please include both build steps as well as run steps
- Execute the following command on Ubuntu 22.04.4 with
SDKMAN!
andIntelliJ IDEA 2024.2.0.1 (Ultimate Edition)
installed.
sdk install java 22.0.2-graalce
sudo apt update && sudo apt upgrade -y
sudo apt install build-essential gdb -y
sudo apt install gdbserver -y
git clone git@github.com:linghengqian/native-image-debug-test.git
cd ./native-image-debug-test/
sdk use java 22.0.2-graalce
./mvnw -PnativeTestInCustom -T1C -e clean test
-
Install the IDE plugins https://plugins.jetbrains.com/plugin/19237-graalvm-native-debugger
and https://plugins.jetbrains.com/plugin/12775-native-debugging-support
forIntelliJ IDEA 2024.2.0.1 (Ultimate Edition)
. -
Set a breakpoint.
- A new profile is added in
IntelliJ IDEA 2024.2.0.1 (Ultimate Edition)
.
- Start the GraalVM Native Image on host port
12345
.
cd ./native-image-debug-test/
gdbserver :12345 ./target/native-tests --xml-output-dir ./target/native-test-reports -Djunit.platform.listeners.uid.tracking.output.dir=./target/test-ids
- Switch to the newly set run/debug configuration and press
shift+F9
to start debugging.
Describe GraalVM and your environment:
- GraalVM version (latest snapshot builds can be found here), or commit id if built from source: [e.g. EE 19.3, CE 20.0, CE 20.1.0-dev-20200304_0848]
CE 24.0.2 For JDK 22.0.2
- JDK major version: [e.g.:8]
22
- OS: [e.g. macOS Catalina]
Ubuntu 22.04.4
- Architecture: [e.g.: AMD64]
AMD64
More details
Consider adding the --native-image-info
and --verbose
flags when building your native image and paste output below.
Add any other information about the problem here. Especially important are stack traces or log output. Feel free to link to gists or to screenshots if necessary.
- More early investigation is at apache/shardingsphere-elasticjob#2428 .
- Honestly, I don't know if this is an IntelliJ IDEA issue. But I'm a GDB newbie myself and I wanted to confirm on the GraalVM side first.
- I assume that GDB can debug into the actual values of variables in the GraalVM Native Image, because Jetbrains or the GraalVM community advertised this in the gif at https://x.com/graalvm/status/1537851767320371204 .
Hi, Thank you for reporting this, we'll take a look into it shortly