GP-571: Additional fixes for schemas and dbgeng

This commit is contained in:
Dan 2021-01-08 21:11:25 +00:00
parent c81a17405d
commit 8fa549119d
18 changed files with 166 additions and 69 deletions

View file

@ -91,6 +91,11 @@ public class DbgModelImpl extends AbstractDbgModel {
dbg.terminate();
}
@Override
public TargetObjectSchema getRootSchema() {
return root.getSchema();
}
@Override
public CompletableFuture<? extends TargetObject> fetchModelRoot() {
return completedRoot;

View file

@ -21,13 +21,19 @@ import java.util.concurrent.CompletableFuture;
import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo;
import agent.dbgeng.model.iface2.DbgModelTargetBreakpointContainer;
import agent.dbgeng.model.iface2.DbgModelTargetBreakpointSpec;
import ghidra.dbg.target.TargetObject;
import ghidra.dbg.target.*;
import ghidra.dbg.target.schema.TargetAttributeType;
import ghidra.dbg.target.schema.TargetObjectSchemaInfo;
import ghidra.dbg.util.PathUtils;
import ghidra.util.datastruct.ListenerSet;
@TargetObjectSchemaInfo(name = "BreakpointSpec", attributes = { //
@TargetAttributeType( //
name = TargetBreakpointSpec.CONTAINER_ATTRIBUTE_NAME, //
type = DbgModelTargetBreakpointContainerImpl.class), //
@TargetAttributeType( //
name = TargetBreakpointLocation.SPEC_ATTRIBUTE_NAME, //
type = DbgModelTargetBreakpointSpecImpl.class), //
@TargetAttributeType(type = Void.class) //
}, canonicalContainer = true)
public class DbgModelTargetBreakpointSpecImpl extends DbgModelTargetObjectImpl

View file

@ -42,7 +42,7 @@ public class DbgModelTargetConnectorContainerImpl extends DbgModelTargetObjectIm
protected final DbgModelTargetKernelConnectorImpl kernelAttacher;
public DbgModelTargetConnectorContainerImpl(DbgModelTargetRoot root) {
super(root.getModel(), root, "Connectors", "ConnectorsContainer");
super(root.getModel(), root, "Connectors", "ConnectorsContainer", null);
this.root = root;
this.processLauncher = new DbgModelTargetProcessLaunchConnectorImpl(this, "Launch process");

View file

@ -21,6 +21,7 @@ import java.util.Map;
import agent.dbgeng.manager.DbgModuleMemory;
import agent.dbgeng.model.iface2.DbgModelTargetMemoryContainer;
import agent.dbgeng.model.iface2.DbgModelTargetMemoryRegion;
import ghidra.dbg.target.TargetMemoryRegion;
import ghidra.dbg.target.schema.*;
import ghidra.dbg.util.PathUtils;
import ghidra.program.model.address.*;
@ -28,6 +29,9 @@ import ghidra.program.model.address.*;
@TargetObjectSchemaInfo(name = "MemoryRegion", elements = { //
@TargetElementType(type = Void.class) //
}, attributes = { //
@TargetAttributeType( //
name = TargetMemoryRegion.MEMORY_ATTRIBUTE_NAME, //
type = DbgModelTargetMemoryContainerImpl.class), //
@TargetAttributeType(name = "BaseAddress", type = Address.class), //
@TargetAttributeType(name = "EndAddress", type = Address.class), //
@TargetAttributeType(name = "RegionSize", type = String.class), //

View file

@ -40,7 +40,7 @@ public class DbgModelTargetObjectImpl extends DefaultTargetObject<TargetObject,
public DbgModelTargetObjectImpl(AbstractDbgModel impl, TargetObject parent, String name,
String typeHint) {
super(impl, parent, name, typeHint);
super(impl, parent, name, typeHint, null);
getManager().addStateListener(accessListener);
}

View file

@ -37,6 +37,9 @@ import ghidra.dbg.util.ConversionUtils;
@TargetObjectSchemaInfo(name = "RegisterContainer", elements = { //
@TargetElementType(type = DbgModelTargetRegisterImpl.class) //
}, attributes = { //
@TargetAttributeType( //
name = TargetRegisterBank.DESCRIPTIONS_ATTRIBUTE_NAME, //
type=DbgModelTargetRegisterContainerImpl.class),
@TargetAttributeType(type = Void.class) //
}, canonicalContainer = true)
public class DbgModelTargetRegisterContainerImpl extends DbgModelTargetObjectImpl

View file

@ -21,12 +21,16 @@ import java.util.Map;
import agent.dbgeng.manager.impl.DbgRegister;
import agent.dbgeng.model.iface2.DbgModelTargetRegister;
import agent.dbgeng.model.iface2.DbgModelTargetRegisterContainerAndBank;
import ghidra.dbg.target.TargetRegister;
import ghidra.dbg.target.schema.*;
import ghidra.dbg.util.PathUtils;
@TargetObjectSchemaInfo(name = "RegisterDescriptor", elements = { //
@TargetElementType(type = Void.class) //
}, attributes = { //
@TargetAttributeType( //
name = TargetRegister.CONTAINER_ATTRIBUTE_NAME, //
type = DbgModelTargetRegisterContainerImpl.class), //
@TargetAttributeType(type = Void.class) //
})
public class DbgModelTargetRegisterImpl extends DbgModelTargetObjectImpl

View file

@ -20,6 +20,7 @@ import java.util.Map;
import agent.dbgeng.manager.impl.DbgMinimalSymbol;
import agent.dbgeng.model.iface2.DbgModelTargetSymbol;
import ghidra.dbg.target.TargetSymbol;
import ghidra.dbg.target.schema.*;
import ghidra.dbg.util.PathUtils;
import ghidra.program.model.address.Address;
@ -27,6 +28,9 @@ import ghidra.program.model.address.Address;
@TargetObjectSchemaInfo(name = "Symbol", elements = { //
@TargetElementType(type = Void.class) //
}, attributes = { //
@TargetAttributeType( //
name = TargetSymbol.NAMESPACE_ATTRIBUTE_NAME, //
type = DbgModelTargetSymbolContainerImpl.class), //
@TargetAttributeType(type = Void.class) //
})
public class DbgModelTargetSymbolImpl extends DbgModelTargetObjectImpl
@ -52,6 +56,7 @@ public class DbgModelTargetSymbolImpl extends DbgModelTargetObjectImpl
changeAttributes(List.of(), List.of(), Map.of( //
// TODO: DATA_TYPE
NAMESPACE_ATTRIBUTE_NAME, symbols, //
VALUE_ATTRIBUTE_NAME, value, //
SIZE_ATTRIBUTE_NAME, size, //
UPDATE_MODE_ATTRIBUTE_NAME, TargetUpdateMode.FIXED //