Skip to content

Commit

Permalink
TrackNodeSourcePosition only with -O0.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Jan 27, 2023
1 parent 077c8c7 commit 67cc5c2
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import static com.oracle.svm.core.option.RuntimeOptionKey.RuntimeOptionKeyFlag.Immutable;
import static com.oracle.svm.core.option.RuntimeOptionKey.RuntimeOptionKeyFlag.RelevantForCompilationIsolates;
import static org.graalvm.compiler.core.common.GraalOptions.TrackNodeSourcePosition;
import static org.graalvm.compiler.core.common.SpectrePHTMitigations.None;
import static org.graalvm.compiler.core.common.SpectrePHTMitigations.Options.SpectrePHTBarriers;
import static org.graalvm.compiler.options.OptionType.Debug;
Expand Down Expand Up @@ -203,6 +202,8 @@ public enum OptimizationLevel {
@Override
protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, String oldValue, String newValue) {
OptimizationLevel newLevel = parseOptimizationLevel(newValue);
// `-g -O0` is recommended for a better debugging experience
GraalOptions.TrackNodeSourcePosition.update(values, newLevel == OptimizationLevel.O0);
SubstrateOptions.IncludeNodeSourcePositions.update(values, newLevel == OptimizationLevel.O0);
SubstrateOptions.SourceLevelDebug.update(values, newLevel == OptimizationLevel.O0);
SubstrateOptions.AOTTrivialInline.update(values, newLevel != OptimizationLevel.O0);
Expand Down Expand Up @@ -644,8 +645,6 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Integer o
};

public static void defaultDebugInfoValueUpdateHandler(EconomicMap<OptionKey<?>, Object> values, Integer newValue) {
/* Force update of TrackNodeSourcePosition */
TrackNodeSourcePosition.update(values, newValue > 0);
if (OS.WINDOWS.isCurrent()) {
/* Keep symbols on Windows. The symbol table is part of the pdb-file. */
DeleteLocalSymbols.update(values, newValue == 0);
Expand Down

0 comments on commit 67cc5c2

Please sign in to comment.