Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
linghengqian opened this issue Aug 17, 2024 · 1 comment
Assignees

Comments

@linghengqian
Copy link

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 [email protected]: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.

  • image
  1. A new profile is added in IntelliJ IDEA 2024.2.0.1 (Ultimate Edition).
  • image
  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.
  • At this time, it is not possible to view the actual value of the variable.
  • image

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants