Merge remote-tracking branch 'origin/patch'

This commit is contained in:
Ryan Kurtz 2024-06-13 13:26:20 -04:00
commit bd41b85f02
2 changed files with 21 additions and 4 deletions

View file

@ -42,8 +42,7 @@ import ghidra.debug.api.modules.*;
import ghidra.debug.api.modules.ModuleMapProposal.ModuleMapEntry;
import ghidra.debug.api.tracermi.*;
import ghidra.framework.options.SaveState;
import ghidra.framework.plugintool.AutoConfigState.ConfigStateField;
import ghidra.framework.plugintool.AutoConfigState.PathIsFile;
import ghidra.framework.plugintool.AutoConfigState.*;
import ghidra.framework.plugintool.PluginTool;
import ghidra.program.model.address.Address;
import ghidra.program.model.listing.Program;
@ -299,8 +298,18 @@ public abstract class AbstractTraceRmiLaunchOffer implements TraceRmiLaunchOffer
List<String> names =
program.getLanguage().getLanguageDescription().getExternalNames(tool);
if (names != null && !names.isEmpty()) {
var paramStr = (ParameterDescription<String>) param;
paramStr.set(map, names.get(0));
if (param.type == String.class) {
var paramStr = (ParameterDescription<String>) param;
paramStr.set(map, names.get(0));
}
else if (param.type == PathIsFile.class) {
var paramPIF = (ParameterDescription<PathIsFile>) param;
paramPIF.set(map, PathIsFile.fromString(names.get(0)));
}
else if (param.type == PathIsDir.class) {
var paramPID = (ParameterDescription<PathIsDir>) param;
paramPID.set(map, PathIsDir.fromString(names.get(0)));
}
}
}
}

View file

@ -305,6 +305,10 @@ public interface AutoConfigState {
}
record PathIsDir(Path path) {
public static PathIsDir fromString(String string) {
return new PathIsDir(Paths.get(string));
}
@Override
public String toString() {
return path.toString();
@ -328,6 +332,10 @@ public interface AutoConfigState {
}
record PathIsFile(Path path) {
public static PathIsFile fromString(String string) {
return new PathIsFile(Paths.get(string));
}
@Override
public String toString() {
return path.toString();