Skip to content

Commit

Permalink
Fix gdb debugging with GraalVM/Mandrel >=21.1
Browse files Browse the repository at this point in the history
As if
21.1 (oracle/graal@dee66ca)
dwarf info contain absolute paths to the source-cache. As a result
moving the sources breaks gdb.

The move was performed to make sure the sources are next to the binary,
in an effort to ease debugging on remote hosts by copying the binary and
the sources in the same directory.  As discussed in
oracle/graal#3828 this is not expected to be the
common case, so it's better to favour the local debugging experience by
leaving the sources where they were placed by GraalVM/Mandrel.
  • Loading branch information
zakkak committed Sep 23, 2021
1 parent f87e933 commit db5ad51
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,6 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, NativeImageSourceJa
Path finalSymbolsPath = outputTargetBuildItem.getOutputDirectory().resolve(symbolsName);
IoUtils.copy(generatedSymbols, finalSymbolsPath);
Files.delete(generatedSymbols);
final String sources = "sources";
final Path generatedSources = outputDir.resolve(sources);
final Path finalSources = outputTargetBuildItem.getOutputDirectory().resolve(sources);
IoUtils.copy(generatedSources, finalSources);
IoUtils.recursiveDelete(generatedSources);
} else {
log.warn(
"objcopy executable not found in PATH. Debug symbols therefore cannot be placed into the dedicated directory.");
Expand Down

0 comments on commit db5ad51

Please sign in to comment.