mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
Merge remote-tracking branch
'origin/GP-3818_Dan_traceRmiLaunchOnUnix--SQUASHED' Conflicts: Ghidra/Test/IntegrationTest/src/test.slow/java/agent/dbgeng/rmi/AbstractDbgEngTraceRmiTest.java
This commit is contained in:
commit
7ccef54f19
379 changed files with 5170 additions and 1448 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue