-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Describe the issue
When compiling with -g to generate debug info, inlined methods are not properly handled by native-image's debug info genarator, resulting in users being unable to reference them from gdb, e.g. to set a breakpoint.
Steps to reproduce the issue
$ cat <<EOF > HelloWorld.java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
EOF
$ javac HelloWorld
$ native-image -g HelloWorld
$ gdb helloworld
Reading symbols from helloworld...
(gdb) b HelloWorld::main
Function "HelloWorld::main" not defined.
Make breakpoint pending on future shared library load? (y or [n])Describe GraalVM and your environment:
- GraalVM version: a17ccc5
- JDK major version: 11
- OS: Linux Fedora 32
- Architecture: AMD64
More details
According to DWARF v2.0.0
Each inline expansion of an inlinable subroutine is represented by a debugging information entry with the tag DW_TAG_inlined_subroutine. Each such entry should be a direct child of the entry that represents the scope within which the inlining occurs.
At the moment graal uses only the following two tags though
graal/substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfDebugInfo.java
Lines 65 to 69 in a17ccc5
| /* | |
| * Define all the Dwarf tags we need for our DIEs. | |
| */ | |
| public static final int DW_TAG_compile_unit = 0x11; | |
| public static final int DW_TAG_subprogram = 0x2e; |