mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GT-3112 - PDB Universal - review changes
This commit is contained in:
parent
a1d7ed2cb2
commit
9f7fc60f76
65 changed files with 1046 additions and 1045 deletions
|
@ -47,6 +47,8 @@ public class SymbolPathParser {
|
|||
}
|
||||
// if (name.indexOf(Namespace.DELIMITER) == -1) {
|
||||
// following is temporary kludge due to struct (blah). TODO: figure/fix
|
||||
// This particular test for starting with the open parenthesis is to work around a type
|
||||
// seen in "Rust."
|
||||
if (name.startsWith("(") || name.indexOf(Namespace.DELIMITER) == -1) {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(name);
|
||||
|
|
|
@ -28,6 +28,17 @@ import ghidra.util.exception.DuplicateNameException;
|
|||
* be overridden so it can provide its own test implementation and return value.
|
||||
*/
|
||||
public class MemoryBlockStub implements MemoryBlock {
|
||||
Address start;
|
||||
Address end;
|
||||
|
||||
public MemoryBlockStub() {
|
||||
this(Address.NO_ADDRESS, Address.NO_ADDRESS);
|
||||
}
|
||||
|
||||
public MemoryBlockStub(Address start, Address end) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(MemoryBlock o) {
|
||||
|
@ -51,12 +62,12 @@ public class MemoryBlockStub implements MemoryBlock {
|
|||
|
||||
@Override
|
||||
public Address getStart() {
|
||||
throw new UnsupportedOperationException();
|
||||
return start;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Address getEnd() {
|
||||
throw new UnsupportedOperationException();
|
||||
return end;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -131,7 +142,7 @@ public class MemoryBlockStub implements MemoryBlock {
|
|||
|
||||
@Override
|
||||
public boolean isOverlay() {
|
||||
throw new UnsupportedOperationException();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -176,7 +187,7 @@ public class MemoryBlockStub implements MemoryBlock {
|
|||
|
||||
@Override
|
||||
public MemoryBlockType getType() {
|
||||
throw new UnsupportedOperationException();
|
||||
return MemoryBlockType.DEFAULT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,21 +32,22 @@ import ghidra.util.task.TaskMonitor;
|
|||
* for all methods in the Memory interface. Any method that is needed for your test can then
|
||||
* be overridden so it can provide its own test implementation and return value.
|
||||
*/
|
||||
public class MemoryStub implements Memory {
|
||||
public class MemoryStub extends AddressSet implements Memory {
|
||||
byte[] myMemoryBytes;
|
||||
MemoryBlock myMemoryBlock;
|
||||
|
||||
@Override
|
||||
public boolean contains(Address addr) {
|
||||
throw new UnsupportedOperationException();
|
||||
public MemoryStub() {
|
||||
this(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 });
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Address start, Address end) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(AddressSetView rangeSet) {
|
||||
throw new UnsupportedOperationException();
|
||||
public MemoryStub(byte[] bytes) {
|
||||
super();
|
||||
this.myMemoryBytes = bytes;
|
||||
AddressSpace space = new GenericAddressSpace("Mem", 32, AddressSpace.TYPE_RAM, 0);
|
||||
Address start = space.getAddress(0);
|
||||
Address end = space.getAddress(bytes.length - 1);
|
||||
addRange(start, end);
|
||||
myMemoryBlock = new MemoryBlockStub(start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -124,36 +125,11 @@ public class MemoryStub implements Memory {
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressSet intersect(AddressSetView view) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressSet intersectRange(Address start, Address end) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressSet union(AddressSetView addrSet) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressSet subtract(AddressSetView addrSet) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressSet xor(AddressSetView addrSet) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSameAddresses(AddressSetView view) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AddressRange getFirstRange() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
@ -241,9 +217,8 @@ public class MemoryStub implements Memory {
|
|||
|
||||
@Override
|
||||
public MemoryBlock createByteMappedBlock(String name, Address start, Address mappedAddress,
|
||||
long length, ByteMappingScheme byteMappingScheme, boolean overlay)
|
||||
throws LockException, MemoryConflictException, AddressOverflowException,
|
||||
IllegalArgumentException {
|
||||
long length, ByteMappingScheme byteMappingScheme, boolean overlay) throws LockException,
|
||||
MemoryConflictException, AddressOverflowException, IllegalArgumentException {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue