Skip to content

No sources for native libraries #119

@zakkak

Description

@zakkak

Description

Mandrel ships with libjvm.a and liblibchelper.a but not their sources.
As a result gdb (as well as other tools) fail to show the source code.

How To Reproduce

native-image -g HelloWorld
gdb helloworld
(gdb) b determineCPUFeatures 
Breakpoint 1 at 0x6c12c0: file /usr/lib/gcc/x86_64-redhat-linux/8/include/cpuid.h, line 241.
(gdb) r
Starting program: /home/zakkak/code/graal/helloworld
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, determineCPUFeatures (features=0x7fffffffd328) at /home/jenkins/jenkins/workspace/mandrel-linux-build/mandrel/substratevm/src/com.oracle.svm.native.libchelper/src/cpuid.c:121
121     /home/jenkins/jenkins/workspace/mandrel-linux-build/mandrel/substratevm/src/com.oracle.svm.native.libchelper/src/cpuid.c: No such file or directory.

Additional context

In order to fix this we need to:

  1. Ship the sources along the binaries
  2. Find a way for gdb to detect the sources. Currently it's looking in the directory where the sources were built from:
readelf --debug-dump=info /opt/jvms/mandrel-java11-20.1.0.1.Final/lib/svm/clibraries/linux-amd64/libjvm.a| grep comp_dir
    <15>   DW_AT_comp_dir    : (indirect string, offset: 0x975): /home/jenkins/jenkins/workspace/mandrel-linux-build/mandrel/substratevm/mxbuild/linux-amd64/src/com.oracle.svm.native.jvm.posix/amd64
    <15>   DW_AT_comp_dir    : (indirect string, offset: 0x1bb): /home/jenkins/jenkins/workspace/mandrel-linux-build/mandrel/substratevm/mxbuild/linux-amd64/src/com.oracle.svm.native.jvm.posix/amd64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions