Skip to content

Commit 43753c2

Browse files
Update -g to include all informaton for profiling on Linux.
1 parent 795ba9a commit 43753c2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,12 @@ public static int codeAlignment() {
747747
public static final HostedOptionKey<Integer> GenerateDebugInfo = new HostedOptionKey<>(0, SubstrateOptions::validateGenerateDebugInfo) {
748748
@Override
749749
protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Integer oldValue, Integer newValue) {
750-
if (OS.WINDOWS.isCurrent()) {
751-
/* Keep symbols on Windows. The symbol table is part of the pdb-file. */
750+
if (!OS.DARWIN.isCurrent()) {
751+
/*
752+
* Keep the symbol table, as it may be used by debugging or profiling tools (e.g.,
753+
* perf). On Windows, the symbol table is included in the pdb-file, while on Linux,
754+
* it is part of the .debug file.
755+
*/
752756
DeleteLocalSymbols.update(values, newValue == 0);
753757
}
754758
}

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageDebugInfoStripFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private static void stripLinux(AfterImageWriteAccessImpl accessImpl) {
114114

115115
private static Path createKeepSymbolsListFile(AfterImageWriteAccessImpl accessImpl) throws IOException {
116116
Path exportedSymbolsPath = accessImpl.getTempDirectory().resolve("keep-symbols.list").toAbsolutePath();
117-
Files.write(exportedSymbolsPath, accessImpl.getImageSymbols(false));
117+
Files.write(exportedSymbolsPath, accessImpl.getImageSymbols(true));
118118
return exportedSymbolsPath;
119119
}
120120
}

0 commit comments

Comments
 (0)