Skip to content

Commit 8e25b52

Browse files
committed
Show debuginfo generation runtime on image build output
1 parent 7cdbfe9 commit 8e25b52

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Integer o
451451
}
452452
};
453453

454-
private static void defaultDebugInfoValueUpdateHandler(EconomicMap<OptionKey<?>, Object> values, @SuppressWarnings("unused") Integer oldValue, Integer newValue) {
454+
public static void defaultDebugInfoValueUpdateHandler(EconomicMap<OptionKey<?>, Object> values, @SuppressWarnings("unused") Integer oldValue, Integer newValue) {
455455
// force update of TrackNodeSourcePosition and DeleteLocalSymbols
456456
TrackNodeSourcePosition.update(values, newValue > 0);
457457
DeleteLocalSymbols.update(values, newValue == 0);

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ private void doRun(Map<Method, CEntryPointData> entryPoints,
663663
featureHandler.forEachFeature(feature -> feature.afterHeapLayout(config));
664664

665665
this.image = AbstractBootImage.create(k, hUniverse, hMetaAccess, nativeLibraries, heap, codeCache, hostedEntryPoints, loader.getClassLoader());
666-
image.build(debug);
666+
image.build(imageName, debug);
667667
if (NativeImageOptions.PrintUniverse.getValue()) {
668668
/*
669669
* This debug output must be printed _after_ and not _during_ image

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public NativeLibraries getNativeLibs() {
123123
* Build the image. Calling this method is a precondition to calling {@link #write}. It
124124
* typically finalizes content of the object. It does not build debug information.
125125
*/
126-
public abstract void build(DebugContext debug);
126+
public abstract void build(String imageName, DebugContext debug);
127127

128128
/**
129129
* Write the image to the named file. This also writes debug information -- either to the same

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262

6363
import com.oracle.graal.pointsto.meta.AnalysisMethod;
6464
import com.oracle.graal.pointsto.meta.AnalysisType;
65+
import com.oracle.graal.pointsto.util.Timer;
6566
import com.oracle.objectfile.BasicProgbitsSectionImpl;
6667
import com.oracle.objectfile.BuildDependency;
6768
import com.oracle.objectfile.LayoutDecision;
@@ -400,7 +401,7 @@ private ObjectFile.Symbol defineRelocationForSymbol(String name, long position)
400401
*/
401402
@Override
402403
@SuppressWarnings("try")
403-
public void build(DebugContext debug) {
404+
public void build(String imageName, DebugContext debug) {
404405
try (DebugContext.Scope buildScope = debug.scope("NativeBootImage.build")) {
405406
final CGlobalDataFeature cGlobals = CGlobalDataFeature.singleton();
406407

@@ -450,9 +451,11 @@ public void build(DebugContext debug) {
450451
* If we constructed debug info give the object file a chance to install it
451452
*/
452453
if (SubstrateOptions.GenerateDebugInfo.getValue(HostedOptionValues.singleton()) > 0) {
453-
ImageSingletons.add(SourceManager.class, new SourceManager());
454-
DebugInfoProvider provider = new NativeImageDebugInfoProvider(debug, codeCache, heap);
455-
objectFile.installDebugInfo(provider);
454+
try (Timer.StopTimer t = new Timer(imageName, "dbginfo").start()) {
455+
ImageSingletons.add(SourceManager.class, new SourceManager());
456+
DebugInfoProvider provider = new NativeImageDebugInfoProvider(debug, codeCache, heap);
457+
objectFile.installDebugInfo(provider);
458+
}
456459
}
457460
// - Write the heap to its own section.
458461
// Dynamic linkers/loaders generally don't ensure any alignment to more than page

0 commit comments

Comments
 (0)