Skip to content

Commit 13ff344

Browse files
committed
[GR-45807] Dwarf debuginfo generation makes only sense when LIR backend is used.
1 parent abdb630 commit 13ff344

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,10 @@ public void update(EconomicMap<OptionKey<?>, Object> values, Object newValue) {
650650
@Option(help = "Use old debuginfo", deprecated = true, deprecationMessage = "Please use the -g option.")//
651651
public static final HostedOptionKey<Boolean> UseOldDebugInfo = new HostedOptionKey<>(false, SubstrateOptions::validateUseOldDebugInfo);
652652

653+
public static boolean useDebugInfoGeneration() {
654+
return useLIRBackend() && GenerateDebugInfo.getValue() > 0 && !UseOldDebugInfo.getValue();
655+
}
656+
653657
private static void validateUseOldDebugInfo(HostedOptionKey<Boolean> optionKey) {
654658
if (optionKey.getValue() && SubstrateOptions.GenerateDebugInfo.getValue() < 1) {
655659
throw UserError.abort("The option '%s' can only be used together with '%s'.",

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,17 @@
2424
*/
2525
package com.oracle.svm.core;
2626

27-
import com.oracle.svm.core.feature.AutomaticallyRegisteredImageSingleton;
28-
import jdk.vm.ci.meta.ResolvedJavaType;
29-
import jdk.vm.ci.meta.Signature;
30-
3127
import java.lang.reflect.Constructor;
3228
import java.lang.reflect.Executable;
3329
import java.lang.reflect.Member;
3430
import java.lang.reflect.Method;
3531
import java.util.function.BooleanSupplier;
3632

33+
import com.oracle.svm.core.feature.AutomaticallyRegisteredImageSingleton;
34+
35+
import jdk.vm.ci.meta.ResolvedJavaType;
36+
import jdk.vm.ci.meta.Signature;
37+
3738
/**
3839
* Default implementation for unique method and field short names which concatenates the
3940
* (unqualified) owner class name and method or field selector with an SHA1 digest of the fully
@@ -93,7 +94,7 @@ public String uniqueShortLoaderName(ClassLoader classLoader) {
9394
public static class UseDefault implements BooleanSupplier {
9495

9596
public static boolean useDefaultProvider() {
96-
return !(OS.LINUX.isCurrent() && SubstrateOptions.GenerateDebugInfo.getValue() > 0 && !SubstrateOptions.UseOldDebugInfo.getValue());
97+
return !OS.LINUX.isCurrent() || !SubstrateOptions.useDebugInfoGeneration();
9798
}
9899

99100
@Override

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class NativeImageDebugInfoFeature implements InternalFeature {
5555

5656
@Override
5757
public boolean isInConfiguration(IsInConfigurationAccess access) {
58-
return SubstrateOptions.GenerateDebugInfo.getValue() > 0 && !SubstrateOptions.UseOldDebugInfo.getValue();
58+
return SubstrateOptions.useDebugInfoGeneration();
5959
}
6060

6161
@Override

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
@@ -51,7 +51,7 @@ public class NativeImageDebugInfoStripFeature implements InternalFeature {
5151

5252
@Override
5353
public boolean isInConfiguration(IsInConfigurationAccess access) {
54-
return SubstrateOptions.GenerateDebugInfo.getValue() > 0 && SubstrateOptions.StripDebugInfo.getValue() && (SubstrateOptions.useLIRBackend() || SubstrateOptions.useLLVMBackend());
54+
return SubstrateOptions.GenerateDebugInfo.getValue() > 0 && SubstrateOptions.StripDebugInfo.getValue() && SubstrateOptions.useLIRBackend();
5555
}
5656

5757
@SuppressWarnings("try")

0 commit comments

Comments
 (0)