oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.44k stars 1.64k forks source link

Unable to use GDB to debug the actual value of variables in GraalVM Native Image #9514

Open linghengqian opened 3 months ago

linghengqian commented 3 months ago

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

Steps to reproduce the issue Please include both build steps as well as run steps

  1. Execute the following command on Ubuntu 22.04.4 with SDKMAN! and IntelliJ 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
  1. Install the IDE plugins https://plugins.jetbrains.com/plugin/19237-graalvm-native-debugger and https://plugins.jetbrains.com/plugin/12775-native-debugging-support for IntelliJ IDEA 2024.2.0.1 (Ultimate Edition).

  2. Set a breakpoint.

  1. A new profile is added in IntelliJ IDEA 2024.2.0.1 (Ultimate Edition).
  1. 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
  1. Switch to the newly set run/debug configuration and press shift+F9 to start debugging.

Describe GraalVM and your environment:

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.

oubidar-Abderrahim commented 3 months ago

Hi, Thank you for reporting this, we'll take a look into it shortly