Skip to content

Commit eeae085

Browse files
Update -g to include all informaton for profiling on Linux.
1 parent 95cb384 commit eeae085

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
@@ -748,8 +748,12 @@ public static int codeAlignment() {
748748
public static final HostedOptionKey<Integer> GenerateDebugInfo = new HostedOptionKey<>(0, SubstrateOptions::validateGenerateDebugInfo) {
749749
@Override
750750
protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Integer oldValue, Integer newValue) {
751-
if (OS.WINDOWS.isCurrent()) {
752-
/* Keep symbols on Windows. The symbol table is part of the pdb-file. */
751+
if (!OS.DARWIN.isCurrent()) {
752+
/*
753+
* Keep the symbol table, as it may be used by debugging or profiling tools (e.g.,
754+
* perf). On Windows, the symbol table is included in the pdb-file, while on Linux,
755+
* it is part of the .debug file.
756+
*/
753757
DeleteLocalSymbols.update(values, newValue == 0);
754758
}
755759
}

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)