Skip to content

Inlined methods not referenceable from gdb when compiling with -g. #2701

@zakkak

Description

@zakkak

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

/*
* 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;

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions