mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-01-09 14:08:03 -05:00
Merge remote-tracking branch 'origin/GP-0_Dan_workaroundEcj2025-12' into patch
This commit is contained in:
@@ -18,6 +18,7 @@ package ghidra.app.plugin.core.debug.gui.tracermi;
|
||||
import java.awt.Component;
|
||||
import java.beans.*;
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JLabel;
|
||||
@@ -112,11 +113,17 @@ public class RemoteMethodInvocationDialog extends AbstractDebuggerParameterDialo
|
||||
return arguments;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T> void withParamType(RemoteParameter parameter, ValStr<?> value,
|
||||
BiConsumer<Class<T>, ValStr<T>> func) {
|
||||
func.accept((Class<T>) parameterType(parameter), (ValStr<T>) value);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void parameterSaveValue(RemoteParameter parameter, SaveState state, String key,
|
||||
ValStr<?> value) {
|
||||
ConfigStateField.putState(state, parameterType(parameter).asSubclass(Object.class), key,
|
||||
value.val());
|
||||
withParamType(parameter, value,
|
||||
(t, v) -> ConfigStateField.putState(state, t, key, v.val()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.objects.components;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractDebuggerParameterDialog;
|
||||
import ghidra.debug.api.ValStr;
|
||||
import ghidra.framework.options.SaveState;
|
||||
import ghidra.framework.plugintool.AutoConfigState.ConfigStateField;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.trace.model.target.iface.TraceMethod;
|
||||
import ghidra.trace.model.target.iface.TraceMethod.ParameterDescription;
|
||||
|
||||
@Deprecated(forRemoval = true, since = "11.3")
|
||||
public class DebuggerMethodInvocationDialog
|
||||
extends AbstractDebuggerParameterDialog<ParameterDescription<?>> {
|
||||
|
||||
public DebuggerMethodInvocationDialog(PluginTool tool, String title, String buttonText,
|
||||
Icon buttonIcon) {
|
||||
super(tool, title, buttonText, buttonIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String parameterName(ParameterDescription<?> parameter) {
|
||||
return parameter.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<?> parameterType(ParameterDescription<?> parameter) {
|
||||
return parameter.type;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String parameterLabel(ParameterDescription<?> parameter) {
|
||||
return parameter.display;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String parameterToolTip(ParameterDescription<?> parameter) {
|
||||
return parameter.description;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ValStr<?> parameterDefault(ParameterDescription<?> parameter) {
|
||||
return ValStr.from(parameter.defaultValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Set<?> parameterChoices(ParameterDescription<?> parameter) {
|
||||
return parameter.choices;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, ValStr<?>> validateArguments(
|
||||
Map<String, ParameterDescription<?>> parameters, Map<String, ValStr<?>> arguments) {
|
||||
Map<String, ?> args = ValStr.toPlainMap(arguments);
|
||||
return ValStr.fromPlainMap(TraceMethod.validateArguments(parameters, args, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void parameterSaveValue(ParameterDescription<?> parameter, SaveState state,
|
||||
String key, ValStr<?> value) {
|
||||
ConfigStateField.putState(state, parameter.type.asSubclass(Object.class), key, value.val());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ValStr<?> parameterLoadValue(ParameterDescription<?> parameter, SaveState state,
|
||||
String key) {
|
||||
return ValStr.from(ConfigStateField.getState(state, parameter.type, key));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user