Skip to content

Commit

Permalink
Call it METHOD_BREAKPOINT_OPTION
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Aug 20, 2024
1 parent 49d535b commit 6987125
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public Context build() {
.err(err)
.in(in);
if (checkForWarnings != null) {
builder.option(DebugServerInfo.FN_OPTION, checkForWarnings);
builder.option(DebugServerInfo.METHOD_BREAKPOINT_OPTION, checkForWarnings);
}
if (enableDebugServer) {
builder.option(DebugServerInfo.ENABLE_OPTION, "true");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ private DebugServerInfo() {
public static final String URI = "enso://debug-server";
public static final String INSTRUMENT_NAME = "enso-debug-server";
public static final String ENABLE_OPTION = INSTRUMENT_NAME + ".enable";
public static final String FN_OPTION = INSTRUMENT_NAME + ".fn";
public static final String METHOD_BREAKPOINT_OPTION = INSTRUMENT_NAME + ".method-break-point";
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public final class ReplDebuggerInstrument extends TruffleInstrument {
/** Option for {@link DebugServerInfo#ENABLE_OPTION} */
private static final OptionKey<Boolean> ENABLE_OPTION = new OptionKey<>(false);

/** Option for {@link DebugServerInfo#FN_OPTION} */
private static final OptionKey<String> FN_OPTION = new OptionKey<>("");
/** * Option for {@link DebugServerInfo#METHOD_BREAKPOINT_OPTION} */
private static final OptionKey<String> METHOD_BREAKPOINT_OPTION = new OptionKey<>("");

/**
* Called by Truffle when this instrument is installed.
Expand All @@ -85,7 +85,7 @@ protected void onCreate(Env env) {
filter = SourceSectionFilter.newBuilder().tagIs(DebuggerTags.AlwaysHalt.class).build();
env.getInstrumenter().attachExecutionEventFactory(filter, factory);
}
if (env.getOptions().get(FN_OPTION) instanceof String replMethodName
if (env.getOptions().get(METHOD_BREAKPOINT_OPTION) instanceof String replMethodName
&& !replMethodName.isEmpty()) {
factory = new AtTheEndOfMethod(handler, env);

Expand Down Expand Up @@ -118,7 +118,10 @@ protected void onCreate(Env env) {
protected OptionDescriptors getOptionDescriptors() {
var options = new ArrayList<OptionDescriptor>();
options.add(OptionDescriptor.newBuilder(ENABLE_OPTION, DebugServerInfo.ENABLE_OPTION).build());
options.add(OptionDescriptor.newBuilder(FN_OPTION, DebugServerInfo.FN_OPTION).build());
options.add(
OptionDescriptor.newBuilder(
METHOD_BREAKPOINT_OPTION, DebugServerInfo.METHOD_BREAKPOINT_OPTION)
.build());
return OptionDescriptors.create(options);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class DebugServerInspectTest {
@BeforeClass
public static void initContext() throws Exception {
var b = ContextUtils.defaultContextBuilder().out(out).err(err);
b.option(DebugServerInfo.FN_OPTION, "ScriptTest.inspect");
b.option(DebugServerInfo.METHOD_BREAKPOINT_OPTION, "ScriptTest.inspect");
ctx = b.build();
}

Expand Down

0 comments on commit 6987125

Please sign in to comment.