diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/analysis/ReachabilityTracePrinter.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/analysis/ReachabilityTracePrinter.java index c613421a0202b..983fc3381447f 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/analysis/ReachabilityTracePrinter.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/analysis/ReachabilityTracePrinter.java @@ -42,6 +42,7 @@ import com.oracle.graal.pointsto.util.AnalysisError; import com.oracle.svm.core.option.HostedOptionKey; import com.oracle.svm.core.option.LocatableMultiOptionValue; +import com.oracle.svm.core.option.SubstrateOptionsParser; public final class ReachabilityTracePrinter { public static class Options { @@ -68,7 +69,7 @@ public static void report(String imageName, OptionValues options, String reports String trace = stringWriter.toString(); ReportUtils.report("trace for types", reportsPath, "trace_types_" + baseImageName, "txt", writer -> writer.print(trace)); - String abortOnTypeReachableOption = "-H:" + Options.AbortOnTypeReachable.getName() + "=" + String.join(",", typePatterns); + String abortOnTypeReachableOption = SubstrateOptionsParser.commandArgument(Options.AbortOnTypeReachable, String.join(",", typePatterns)); String message = "Image building is interrupted as the types specified via " + abortOnTypeReachableOption + " are reachable. See the generated report for a complete reachability trace."; consoleMessageBuilder.append(message); @@ -83,7 +84,7 @@ public static void report(String imageName, OptionValues options, String reports String trace = stringWriter.toString(); ReportUtils.report("trace for methods", reportsPath, "trace_methods_" + baseImageName, "txt", writer -> writer.print(trace)); - String abortOnMethodReachableOption = "-H:" + Options.AbortOnMethodReachable.getName() + "=" + String.join(",", methodPatterns); + String abortOnMethodReachableOption = SubstrateOptionsParser.commandArgument(Options.AbortOnMethodReachable, String.join(",", methodPatterns)); String message = "Image building is interrupted as the methods specified via " + abortOnMethodReachableOption + " are reachable. See the generated report for a complete reachability trace."; consoleMessageBuilder.append(message); @@ -98,7 +99,7 @@ public static void report(String imageName, OptionValues options, String reports String trace = stringWriter.toString(); ReportUtils.report("trace for fields", reportsPath, "trace_fields_" + baseImageName, "txt", writer -> writer.print(trace)); - String abortOnFieldReachableOption = "-H:" + Options.AbortOnFieldReachable.getName() + "=" + String.join(",", fieldPatterns); + String abortOnFieldReachableOption = SubstrateOptionsParser.commandArgument(Options.AbortOnFieldReachable, String.join(",", fieldPatterns)); String message = "Image building is interrupted as the fields specified via " + abortOnFieldReachableOption + " are reachable. See the generated report for a complete reachability trace."; consoleMessageBuilder.append(message);