GP-3857: Port most Debugger components to TraceRmi.

This commit is contained in:
Dan 2023-11-02 10:43:31 -04:00
parent 7e4d2bcfaa
commit fd4380c07a
222 changed files with 7241 additions and 3752 deletions

View file

@ -17,7 +17,6 @@ package ghidra.dbg.target;
import ghidra.dbg.DebuggerTargetObjectIface;
import ghidra.dbg.target.schema.TargetAttributeType;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressRange;
/**
@ -50,45 +49,6 @@ public interface TargetBreakpointLocation extends TargetObject {
return getTypedAttributeNowByName(RANGE_ATTRIBUTE_NAME, AddressRange.class, null);
}
/**
* The minimum address of this location
*
* @return the address
* @deprecated use {@link #getRange()} instead
*/
@Deprecated(forRemoval = true, since = "10.2")
public default Address getAddress() {
return getRange().getMinAddress();
}
/**
* If available, get the length in bytes, of the range covered by the breakpoint.
*
* <p>
* In most cases, where the length is not available, a length of 1 should be presumed.
*
* @return the length, or {@code null} if not known
* @deprecated use {@link #getRange()} instead
*/
@Deprecated(forRemoval = true, since = "10.2")
public default Integer getLength() {
AddressRange range = getRange();
return range == null ? null : (int) range.getLength();
}
/**
* Get the length, defaulting to a given fallback, usually 1
*
* @param fallback the fallback value
* @return the length, or the fallback
* @deprecated use {@link #getRange()} instead
*/
@Deprecated(forRemoval = true, since = "10.2")
public default int getLengthOrDefault(int fallback) {
Integer length = getLength();
return length == null ? 1 : length;
}
/**
* Get a reference to the specification which generated this breakpoint.
*

View file

@ -639,7 +639,7 @@ public interface TargetMethod extends TargetObject {
* @param permitExtras false to require every named argument has a named parameter
* @return the map of validated arguments
*/
static Map<String, ?> validateArguments(Map<String, ParameterDescription<?>> parameters,
static Map<String, Object> validateArguments(Map<String, ParameterDescription<?>> parameters,
Map<String, ?> arguments, boolean permitExtras) {
if (!permitExtras) {
if (!parameters.keySet().containsAll(arguments.keySet())) {

View file

@ -156,6 +156,13 @@ import ghidra.lifecycle.Internal;
* object or throw an exception. In those cases, unless otherwise noted, this actually means the
* future will complete with that object, or complete exceptionally. Specifying this in every
* instance is just pedantic.
*
* <p>
* Assuming Trace RMI is successful, this interface will face a serious identity crisis. It will no
* longer serve its purpose as a proper Java interface, and instead will only serve as a type name
* in the object-model schema, which survives in the trace database. For some of the interfaces, we
* already have defined equivalent interfaces in the trace object manager. We will probably port
* additional interfaces over and eventually remove all of these.
*/
public interface TargetObject extends Comparable<TargetObject> {

View file

@ -23,9 +23,31 @@ import ghidra.dbg.util.PathUtils;
* This is a description of a register
*
* <p>
* This describes a register abstractly. It does not represent the actual value of a register. For
* values, see {@link TargetRegisterBank}. The description and values are separated, since the
* descriptions typically apply to the entire platform, and so can be presented just once.
* There are two conventions for presenting registers and their values:
*
* <ol>
* <li><b>Descriptions separated from values:</b> In this convention, the target presents one
* {@link TargetRegisterContainer}, and in it the various {@link TargetRegister}s, perhaps organized
* into groups. Each {@link TargetRegister} is then just an abstract description of the register,
* notably its name and size. Values are read and written using the
* {@link TargetRegisterBank#readRegister(TargetRegister)} and
* {@link TargetRegisterBank#writeRegister(TargetRegister, byte[])} methods, and related convenience
* methods. The {@link TargetRegisterBank} is the suitable bank for the desired object, usually a
* thread or frame.</li>
* <li><b>Descriptions and values together:</b> In this convention, the
* {@link TargetRegisterContainer} is the same object as the {@link TargetRegisterBank}, and so its'
* replicated for every object that has registers. The registers may be presented in groups under
* the container/bank. Each register provides its name (i.e., its index or key), its size, and its
* value (in the {@value TargetObject#VALUE_ATTRIBUTE_NAME} attribute).</li>
* </ol>
*
* <p>
* Despite the apparent efficiencies of presenting the descriptions only once, we are gravitating
* toward the descriptions-and-values together convention. This simplifies the client and
* model-inspection code a bit and will make things easier if we ever deal with targets having mixed
* architectures. If we settle on this convention, we will probably remove the
* {@link TargetRegisterContainer} interface in favor of using {@link TargetRegisterBank}. We may
* also formally introduce a {@code TargetRegisterGroup} interface.
*/
@DebuggerTargetObjectIface("Register")
public interface TargetRegister extends TargetObject {