mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-3818: Create TraceRMI launcher framework. Launch script for gdb.
This commit is contained in:
@@ -280,7 +280,7 @@ public interface TargetMethod extends TargetObject {
|
||||
* @param <T> the type of the parameter
|
||||
* @param type the class representing the type of the parameter
|
||||
* @param name the name of the parameter
|
||||
* @param choices the non-empty set of choices
|
||||
* @param choices the non-empty set of choices. The first is the default.
|
||||
* @param display the human-readable name of this parameter
|
||||
* @param description the human-readable description of this parameter
|
||||
* @return the new parameter description
|
||||
@@ -292,6 +292,27 @@ public interface TargetMethod extends TargetObject {
|
||||
choices);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a parameter having enumerated choices
|
||||
*
|
||||
* @param <T> the type of the parameter
|
||||
* @param type the class representing the type of the parameter
|
||||
* @param name the name of the parameter
|
||||
* @param choices the non-empty set of choices
|
||||
* @param defaultValue the default value of this parameter
|
||||
* @param display the human-readable name of this parameter
|
||||
* @param description the human-readable description of this parameter
|
||||
* @return the new parameter description
|
||||
*/
|
||||
public static <T> ParameterDescription<T> choices(Class<T> type, String name,
|
||||
Collection<T> choices, T defaultValue, String display, String description) {
|
||||
if (!choices.contains(defaultValue)) {
|
||||
throw new IllegalArgumentException("Default must be one of the choices.");
|
||||
}
|
||||
return new ParameterDescription<>(type, name, false, defaultValue, display, description,
|
||||
choices);
|
||||
}
|
||||
|
||||
protected static boolean isRequired(Class<?> type, Param param) {
|
||||
if (!type.isPrimitive()) {
|
||||
return param.required();
|
||||
@@ -440,7 +461,7 @@ public interface TargetMethod extends TargetObject {
|
||||
}
|
||||
if (required) {
|
||||
throw new DebuggerIllegalArgumentException(
|
||||
"Missing required parameter '" + name + "'");
|
||||
"Missing required parameter '" + display + "' (" + name + ")");
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user