mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
commit
20350cc37a
7 changed files with 101 additions and 95 deletions
|
@ -306,11 +306,7 @@ class PrototypeManager {
|
||||||
///////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////
|
||||||
|
|
||||||
private void populatePrototypes() {
|
private void populatePrototypes() {
|
||||||
if (program.isLanguageUpgradePending()) {
|
|
||||||
return; // do not load prototypes prior to language upgrade
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
RecordIterator iter = protoAdapter.getRecords();
|
RecordIterator iter = protoAdapter.getRecords();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
DBRecord record = iter.next();
|
DBRecord record = iter.next();
|
||||||
|
|
|
@ -29,23 +29,21 @@ import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
abstract class MemoryMapDBAdapter {
|
abstract class MemoryMapDBAdapter {
|
||||||
|
|
||||||
static final int CURRENT_VERSION = MemoryMapDBAdapterV3.V3_VERSION;
|
|
||||||
|
|
||||||
static Schema BLOCK_SCHEMA = MemoryMapDBAdapterV3.V3_BLOCK_SCHEMA;
|
static Schema BLOCK_SCHEMA = MemoryMapDBAdapterV3.V3_BLOCK_SCHEMA;
|
||||||
static Schema SUB_BLOCK_SCHEMA = MemoryMapDBAdapterV3.V3_SUB_BLOCK_SCHEMA;
|
static Schema SUB_BLOCK_SCHEMA = MemoryMapDBAdapterV3.V3_SUB_BLOCK_SCHEMA;
|
||||||
|
|
||||||
public static final int NAME_COL = MemoryMapDBAdapterV3.V3_NAME_COL;
|
static final int NAME_COL = MemoryMapDBAdapterV3.V3_NAME_COL;
|
||||||
public static final int COMMENTS_COL = MemoryMapDBAdapterV3.V3_COMMENTS_COL;
|
static final int COMMENTS_COL = MemoryMapDBAdapterV3.V3_COMMENTS_COL;
|
||||||
public static final int SOURCE_COL = MemoryMapDBAdapterV3.V3_SOURCE_COL;
|
static final int SOURCE_COL = MemoryMapDBAdapterV3.V3_SOURCE_COL;
|
||||||
public static final int PERMISSIONS_COL = MemoryMapDBAdapterV3.V3_PERMISSIONS_COL;
|
static final int PERMISSIONS_COL = MemoryMapDBAdapterV3.V3_PERMISSIONS_COL;
|
||||||
public static final int START_ADDR_COL = MemoryMapDBAdapterV3.V3_START_ADDR_COL;
|
static final int START_ADDR_COL = MemoryMapDBAdapterV3.V3_START_ADDR_COL;
|
||||||
public static final int LENGTH_COL = MemoryMapDBAdapterV3.V3_LENGTH_COL;
|
static final int LENGTH_COL = MemoryMapDBAdapterV3.V3_LENGTH_COL;
|
||||||
public static final int SEGMENT_COL = MemoryMapDBAdapterV3.V3_SEGMENT_COL;
|
static final int SEGMENT_COL = MemoryMapDBAdapterV3.V3_SEGMENT_COL;
|
||||||
|
|
||||||
public static final int SUB_PARENT_ID_COL = MemoryMapDBAdapterV3.V3_SUB_PARENT_ID_COL;
|
static final int SUB_PARENT_ID_COL = MemoryMapDBAdapterV3.V3_SUB_PARENT_ID_COL;
|
||||||
public static final int SUB_TYPE_COL = MemoryMapDBAdapterV3.V3_SUB_TYPE_COL;
|
static final int SUB_TYPE_COL = MemoryMapDBAdapterV3.V3_SUB_TYPE_COL;
|
||||||
public static final int SUB_LENGTH_COL = MemoryMapDBAdapterV3.V3_SUB_LENGTH_COL;
|
static final int SUB_LENGTH_COL = MemoryMapDBAdapterV3.V3_SUB_LENGTH_COL;
|
||||||
public static final int SUB_START_OFFSET_COL = MemoryMapDBAdapterV3.V3_SUB_START_OFFSET_COL;
|
static final int SUB_START_OFFSET_COL = MemoryMapDBAdapterV3.V3_SUB_START_OFFSET_COL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subblock record int data1 usage:
|
* Subblock record int data1 usage:
|
||||||
|
@ -57,7 +55,7 @@ abstract class MemoryMapDBAdapter {
|
||||||
* <li>{@link UninitializedSubMemoryBlock} - (not used) 0</li>
|
* <li>{@link UninitializedSubMemoryBlock} - (not used) 0</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public static final int SUB_INT_DATA1_COL = MemoryMapDBAdapterV3.V3_SUB_INT_DATA1_COL;
|
static final int SUB_INT_DATA1_COL = MemoryMapDBAdapterV3.V3_SUB_INT_DATA1_COL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subblock record long data2 usage:
|
* Subblock record long data2 usage:
|
||||||
|
@ -69,13 +67,13 @@ abstract class MemoryMapDBAdapter {
|
||||||
* <li>{@link UninitializedSubMemoryBlock} - (not used) 0</li>
|
* <li>{@link UninitializedSubMemoryBlock} - (not used) 0</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public static final int SUB_LONG_DATA2_COL = MemoryMapDBAdapterV3.V3_SUB_LONG_DATA2_COL;
|
static final int SUB_LONG_DATA2_COL = MemoryMapDBAdapterV3.V3_SUB_LONG_DATA2_COL;
|
||||||
|
|
||||||
public static final byte SUB_TYPE_BIT_MAPPED = MemoryMapDBAdapterV3.V3_SUB_TYPE_BIT_MAPPED;
|
static final byte SUB_TYPE_BIT_MAPPED = MemoryMapDBAdapterV3.V3_SUB_TYPE_BIT_MAPPED;
|
||||||
public static final byte SUB_TYPE_BYTE_MAPPED = MemoryMapDBAdapterV3.V3_SUB_TYPE_BYTE_MAPPED;
|
static final byte SUB_TYPE_BYTE_MAPPED = MemoryMapDBAdapterV3.V3_SUB_TYPE_BYTE_MAPPED;
|
||||||
public static final byte SUB_TYPE_BUFFER = MemoryMapDBAdapterV3.V3_SUB_TYPE_BUFFER;
|
static final byte SUB_TYPE_BUFFER = MemoryMapDBAdapterV3.V3_SUB_TYPE_BUFFER;
|
||||||
public static final byte SUB_TYPE_UNITIALIZED = MemoryMapDBAdapterV3.V3_SUB_TYPE_UNITIALIZED;
|
static final byte SUB_TYPE_UNITIALIZED = MemoryMapDBAdapterV3.V3_SUB_TYPE_UNITIALIZED;
|
||||||
public static final byte SUB_TYPE_FILE_BYTES = MemoryMapDBAdapterV3.V3_SUB_TYPE_FILE_BYTES;
|
static final byte SUB_TYPE_FILE_BYTES = MemoryMapDBAdapterV3.V3_SUB_TYPE_FILE_BYTES;
|
||||||
|
|
||||||
static MemoryMapDBAdapter getAdapter(DBHandle handle, int openMode, MemoryMapDB memMap,
|
static MemoryMapDBAdapter getAdapter(DBHandle handle, int openMode, MemoryMapDB memMap,
|
||||||
TaskMonitor monitor) throws VersionException, IOException {
|
TaskMonitor monitor) throws VersionException, IOException {
|
||||||
|
|
|
@ -35,22 +35,30 @@ class MemoryMapDBAdapterV0 extends MemoryMapDBAdapter {
|
||||||
|
|
||||||
private final static int VERSION = 0;
|
private final static int VERSION = 0;
|
||||||
|
|
||||||
protected final static int V0_NAME_COL = 0;
|
private final static int V0_NAME_COL = 0;
|
||||||
protected final static int V0_BUFFER_ID_COL = 1;
|
private final static int V0_BUFFER_ID_COL = 1;
|
||||||
protected final static int V0_COMMENTS_COL = 2;
|
private final static int V0_COMMENTS_COL = 2;
|
||||||
protected final static int V0_DESCRIPTION_COL = 3;
|
//private final static int V0_DESCRIPTION_COL = 3; // deprecated/ignored column
|
||||||
protected final static int V0_SOURCE_NAME_COL = 4;
|
private final static int V0_SOURCE_NAME_COL = 4;
|
||||||
protected final static int V0_SOURCE_OFFSET_COL = 5;
|
//private final static int V0_SOURCE_OFFSET_COL = 5; // deprecated/ignored column
|
||||||
protected final static int V0_IS_READ_COL = 6;
|
private final static int V0_IS_READ_COL = 6;
|
||||||
protected final static int V0_IS_WRITE_COL = 7;
|
private final static int V0_IS_WRITE_COL = 7;
|
||||||
protected final static int V0_IS_EXECUTE_COL = 8;
|
private final static int V0_IS_EXECUTE_COL = 8;
|
||||||
protected final static int V0_START_ADDR_COL = 9;
|
private final static int V0_START_ADDR_COL = 9;
|
||||||
protected final static int V0_LENGTH_COL = 10;
|
private final static int V0_LENGTH_COL = 10;
|
||||||
protected final static int V0_TYPE_COL = 11;
|
private final static int V0_TYPE_COL = 11;
|
||||||
protected final static int V0_BASE_ADDR_COL = 12;
|
private final static int V0_BASE_ADDR_COL = 12;
|
||||||
protected final static int V0_SOURCE_BLOCK_ID_COL = 13;
|
//private final static int V0_SOURCE_BLOCK_ID_COL = 13; // deprecated/ignored column
|
||||||
protected final static int V0_SEGMENT_COL = 14; // added in version 1
|
private final static int V0_SEGMENT_COL = 14; // added in version 1
|
||||||
|
|
||||||
|
// Enumerated block type values
|
||||||
|
private static final int INITIALIZED = 0;
|
||||||
|
private static final int UNINITIALIZED = 1;
|
||||||
|
private static final int BIT_MAPPED = 2;
|
||||||
|
private static final int BYTE_MAPPED = 4;
|
||||||
|
|
||||||
|
// The following schema definition documents the schema used in version 0
|
||||||
|
//
|
||||||
// private Schema SCHEMA = new Schema(0, "Key",
|
// private Schema SCHEMA = new Schema(0, "Key",
|
||||||
// new Class[] {StringField.class,
|
// new Class[] {StringField.class,
|
||||||
// IntField.class, StringField.class,
|
// IntField.class, StringField.class,
|
||||||
|
@ -111,10 +119,10 @@ class MemoryMapDBAdapterV0 extends MemoryMapDBAdapter {
|
||||||
Address start = addrFactory.oldGetAddressFromLong(rec.getLongValue(V0_START_ADDR_COL));
|
Address start = addrFactory.oldGetAddressFromLong(rec.getLongValue(V0_START_ADDR_COL));
|
||||||
long startAddr = addrMap.getKey(start, false);
|
long startAddr = addrMap.getKey(start, false);
|
||||||
long length = rec.getLongValue(V0_LENGTH_COL);
|
long length = rec.getLongValue(V0_LENGTH_COL);
|
||||||
long bufID = rec.getIntValue(V0_BUFFER_ID_COL);
|
int bufID = rec.getIntValue(V0_BUFFER_ID_COL);
|
||||||
int segment = 0;
|
int segment = 0;
|
||||||
if (expectedVersion == 1 && (start instanceof SegmentedAddress)) {
|
if (expectedVersion == 1 && (start instanceof SegmentedAddress)) {
|
||||||
segment = rec.getIntValue(V0_SEGMENT_COL);
|
segment = rec.getIntValue(V0_SEGMENT_COL); // introduced with V1
|
||||||
}
|
}
|
||||||
|
|
||||||
DBRecord blockRecord = BLOCK_SCHEMA.createRecord(key);
|
DBRecord blockRecord = BLOCK_SCHEMA.createRecord(key);
|
||||||
|
@ -136,29 +144,29 @@ class MemoryMapDBAdapterV0 extends MemoryMapDBAdapter {
|
||||||
long overlayAddr = rec.getLongValue(V0_BASE_ADDR_COL);
|
long overlayAddr = rec.getLongValue(V0_BASE_ADDR_COL);
|
||||||
overlayAddr = updateOverlayAddr(addrMap, addrFactory, overlayAddr, type);
|
overlayAddr = updateOverlayAddr(addrMap, addrFactory, overlayAddr, type);
|
||||||
|
|
||||||
SubMemoryBlock subBlock = getSubBlock(memMap, bufID, subBlockRecord, type, overlayAddr);
|
SubMemoryBlock subBlock = getSubBlock(bufID, subBlockRecord, type, overlayAddr);
|
||||||
|
|
||||||
blocks.add(new MemoryBlockDB(this, blockRecord, Arrays.asList(subBlock)));
|
blocks.add(new MemoryBlockDB(this, blockRecord, Arrays.asList(subBlock)));
|
||||||
}
|
}
|
||||||
Collections.sort(blocks);
|
Collections.sort(blocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SubMemoryBlock getSubBlock(MemoryMapDB memMap, long bufID, DBRecord record, int type,
|
private SubMemoryBlock getSubBlock(int bufID, DBRecord record, int type, long overlayAddr)
|
||||||
long overlayAddr) throws IOException {
|
throws IOException {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case MemoryMapDBAdapterV2.BIT_MAPPED:
|
case BIT_MAPPED:
|
||||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_BIT_MAPPED);
|
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_BIT_MAPPED);
|
||||||
record.setLongValue(MemoryMapDBAdapterV2.V2_OVERLAY_ADDR_COL, overlayAddr);
|
record.setLongValue(MemoryMapDBAdapter.SUB_LONG_DATA2_COL, overlayAddr);
|
||||||
return new BitMappedSubMemoryBlock(this, record);
|
return new BitMappedSubMemoryBlock(this, record);
|
||||||
case MemoryMapDBAdapterV2.BYTE_MAPPED:
|
case BYTE_MAPPED:
|
||||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_BYTE_MAPPED);
|
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_BYTE_MAPPED);
|
||||||
record.setLongValue(MemoryMapDBAdapterV2.V2_OVERLAY_ADDR_COL, overlayAddr);
|
record.setLongValue(MemoryMapDBAdapter.SUB_LONG_DATA2_COL, overlayAddr);
|
||||||
return new ByteMappedSubMemoryBlock(this, record);
|
return new ByteMappedSubMemoryBlock(this, record);
|
||||||
case MemoryMapDBAdapterV2.INITIALIZED:
|
case INITIALIZED:
|
||||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_BUFFER);
|
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_BUFFER);
|
||||||
record.setLongValue(SUB_LONG_DATA2_COL, bufID);
|
record.setIntValue(SUB_INT_DATA1_COL, bufID);
|
||||||
return new BufferSubMemoryBlock(this, record);
|
return new BufferSubMemoryBlock(this, record);
|
||||||
case MemoryMapDBAdapterV2.UNINITIALIZED:
|
case UNINITIALIZED:
|
||||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_UNITIALIZED);
|
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_UNITIALIZED);
|
||||||
return new UninitializedSubMemoryBlock(this, record);
|
return new UninitializedSubMemoryBlock(this, record);
|
||||||
default:
|
default:
|
||||||
|
@ -168,7 +176,7 @@ class MemoryMapDBAdapterV0 extends MemoryMapDBAdapter {
|
||||||
|
|
||||||
private long updateOverlayAddr(AddressMap addrMap, AddressFactory addrFactory, long overlayAddr,
|
private long updateOverlayAddr(AddressMap addrMap, AddressFactory addrFactory, long overlayAddr,
|
||||||
int type) {
|
int type) {
|
||||||
if (type == MemoryMapDBAdapterV2.BIT_MAPPED || type == MemoryMapDBAdapterV2.BYTE_MAPPED) {
|
if (type == BIT_MAPPED || type == BYTE_MAPPED) {
|
||||||
Address ov = addrFactory.oldGetAddressFromLong(overlayAddr);
|
Address ov = addrFactory.oldGetAddressFromLong(overlayAddr);
|
||||||
overlayAddr = addrMap.getKey(ov, false);
|
overlayAddr = addrMap.getKey(ov, false);
|
||||||
}
|
}
|
||||||
|
@ -239,7 +247,7 @@ class MemoryMapDBAdapterV0 extends MemoryMapDBAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
MemoryMapDB getMemoryMap() {
|
MemoryMapDB getMemoryMap() {
|
||||||
return null;
|
return memMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -26,6 +26,8 @@ import ghidra.util.exception.VersionException;
|
||||||
class MemoryMapDBAdapterV1 extends MemoryMapDBAdapterV0 {
|
class MemoryMapDBAdapterV1 extends MemoryMapDBAdapterV0 {
|
||||||
private final static int VERSION = 1;
|
private final static int VERSION = 1;
|
||||||
|
|
||||||
|
// The following schema definition documents the schema used in version 1
|
||||||
|
//
|
||||||
// private Schema SCHEMA = new Schema(VERSION, "Key",
|
// private Schema SCHEMA = new Schema(VERSION, "Key",
|
||||||
// new Class[] {StringField.class,
|
// new Class[] {StringField.class,
|
||||||
// IntField.class, StringField.class,
|
// IntField.class, StringField.class,
|
||||||
|
|
|
@ -30,30 +30,31 @@ import ghidra.util.exception.VersionException;
|
||||||
*/
|
*/
|
||||||
class MemoryMapDBAdapterV2 extends MemoryMapDBAdapter {
|
class MemoryMapDBAdapterV2 extends MemoryMapDBAdapter {
|
||||||
private static final int V2_VERSION = 2;
|
private static final int V2_VERSION = 2;
|
||||||
static final String V2_TABLE_NAME = "Memory Blocks";
|
private static final String V2_TABLE_NAME = "Memory Blocks";
|
||||||
|
|
||||||
static final int V2_NAME_COL = 0;
|
private static final int V2_NAME_COL = 0;
|
||||||
static final int V2_COMMENTS_COL = 1;
|
private static final int V2_COMMENTS_COL = 1;
|
||||||
static final int V2_SOURCE_COL = 2;
|
private static final int V2_SOURCE_COL = 2;
|
||||||
static final int V2_PERMISSIONS_COL = 3;
|
private static final int V2_PERMISSIONS_COL = 3;
|
||||||
static final int V2_START_ADDR_COL = 4;
|
private static final int V2_START_ADDR_COL = 4;
|
||||||
static final int V2_BLOCK_TYPE_COL = 5;
|
private static final int V2_BLOCK_TYPE_COL = 5;
|
||||||
static final int V2_OVERLAY_ADDR_COL = 6;
|
private static final int V2_OVERLAY_ADDR_COL = 6;
|
||||||
static final int V2_LENGTH_COL = 7;
|
private static final int V2_LENGTH_COL = 7;
|
||||||
static final int V2_CHAIN_BUF_COL = 8;
|
private static final int V2_CHAIN_BUF_COL = 8;
|
||||||
static final int V2_SEGMENT_COL = 9;
|
private static final int V2_SEGMENT_COL = 9;
|
||||||
|
|
||||||
static final int INITIALIZED = 0;
|
// Enumerated block type values
|
||||||
static final int UNINITIALIZED = 1;
|
private static final int INITIALIZED = 0;
|
||||||
static final int BIT_MAPPED = 2;
|
private static final int UNINITIALIZED = 1;
|
||||||
static final int BYTE_MAPPED = 4;
|
private static final int BIT_MAPPED = 2;
|
||||||
|
private static final int BYTE_MAPPED = 4;
|
||||||
|
|
||||||
private DBHandle handle;
|
private DBHandle handle;
|
||||||
private MemoryMapDB memMap;
|
private MemoryMapDB memMap;
|
||||||
|
|
||||||
private List<MemoryBlockDB> blocks = new ArrayList<>();
|
private List<MemoryBlockDB> blocks = new ArrayList<>();
|
||||||
|
|
||||||
// The following schema definition documents the schema used in version 2No
|
// The following schema definition documents the schema used in version 2
|
||||||
//
|
//
|
||||||
// static Schema BLOCK_SCHEMA = new Schema(CURRENT_VERSION, "Key",
|
// static Schema BLOCK_SCHEMA = new Schema(CURRENT_VERSION, "Key",
|
||||||
// new Class[] { StringField.class, StringField.class, StringField.class, ByteField.class,
|
// new Class[] { StringField.class, StringField.class, StringField.class, ByteField.class,
|
||||||
|
@ -122,19 +123,19 @@ class MemoryMapDBAdapterV2 extends MemoryMapDBAdapter {
|
||||||
private SubMemoryBlock getSubBlock(int bufID, DBRecord record, int type, long overlayAddr)
|
private SubMemoryBlock getSubBlock(int bufID, DBRecord record, int type, long overlayAddr)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case MemoryMapDBAdapterV2.BIT_MAPPED:
|
case BIT_MAPPED:
|
||||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_BIT_MAPPED);
|
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_BIT_MAPPED);
|
||||||
record.setLongValue(MemoryMapDBAdapter.SUB_LONG_DATA2_COL, overlayAddr);
|
record.setLongValue(MemoryMapDBAdapter.SUB_LONG_DATA2_COL, overlayAddr);
|
||||||
return new BitMappedSubMemoryBlock(this, record);
|
return new BitMappedSubMemoryBlock(this, record);
|
||||||
case MemoryMapDBAdapterV2.BYTE_MAPPED:
|
case BYTE_MAPPED:
|
||||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_BYTE_MAPPED);
|
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_BYTE_MAPPED);
|
||||||
record.setLongValue(MemoryMapDBAdapter.SUB_LONG_DATA2_COL, overlayAddr);
|
record.setLongValue(MemoryMapDBAdapter.SUB_LONG_DATA2_COL, overlayAddr);
|
||||||
return new ByteMappedSubMemoryBlock(this, record);
|
return new ByteMappedSubMemoryBlock(this, record);
|
||||||
case MemoryMapDBAdapterV2.INITIALIZED:
|
case INITIALIZED:
|
||||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_BUFFER);
|
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_BUFFER);
|
||||||
record.setIntValue(SUB_INT_DATA1_COL, bufID);
|
record.setIntValue(SUB_INT_DATA1_COL, bufID);
|
||||||
return new BufferSubMemoryBlock(this, record);
|
return new BufferSubMemoryBlock(this, record);
|
||||||
case MemoryMapDBAdapterV2.UNINITIALIZED:
|
case UNINITIALIZED:
|
||||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_UNITIALIZED);
|
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_UNITIALIZED);
|
||||||
return new UninitializedSubMemoryBlock(this, record);
|
return new UninitializedSubMemoryBlock(this, record);
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -32,30 +32,30 @@ import ghidra.util.exception.*;
|
||||||
* This version introduces the concept of sub memory blocks and FileBytes
|
* This version introduces the concept of sub memory blocks and FileBytes
|
||||||
*/
|
*/
|
||||||
public class MemoryMapDBAdapterV3 extends MemoryMapDBAdapter {
|
public class MemoryMapDBAdapterV3 extends MemoryMapDBAdapter {
|
||||||
public static final int V3_VERSION = 3;
|
private static final int V3_VERSION = 3;
|
||||||
public static final String TABLE_NAME = "Memory Blocks";
|
private static final String TABLE_NAME = "Memory Blocks";
|
||||||
public static final String SUB_BLOCK_TABLE_NAME = "Sub Memory Blocks";
|
private static final String SUB_BLOCK_TABLE_NAME = "Sub Memory Blocks";
|
||||||
|
|
||||||
public static final int V3_NAME_COL = 0;
|
static final int V3_NAME_COL = 0;
|
||||||
public static final int V3_COMMENTS_COL = 1;
|
static final int V3_COMMENTS_COL = 1;
|
||||||
public static final int V3_SOURCE_COL = 2;
|
static final int V3_SOURCE_COL = 2;
|
||||||
public static final int V3_PERMISSIONS_COL = 3;
|
static final int V3_PERMISSIONS_COL = 3;
|
||||||
public static final int V3_START_ADDR_COL = 4;
|
static final int V3_START_ADDR_COL = 4;
|
||||||
public static final int V3_LENGTH_COL = 5;
|
static final int V3_LENGTH_COL = 5;
|
||||||
public static final int V3_SEGMENT_COL = 6;
|
static final int V3_SEGMENT_COL = 6;
|
||||||
|
|
||||||
public static final int V3_SUB_PARENT_ID_COL = 0;
|
static final int V3_SUB_PARENT_ID_COL = 0;
|
||||||
public static final int V3_SUB_TYPE_COL = 1;
|
static final int V3_SUB_TYPE_COL = 1;
|
||||||
public static final int V3_SUB_LENGTH_COL = 2;
|
static final int V3_SUB_LENGTH_COL = 2;
|
||||||
public static final int V3_SUB_START_OFFSET_COL = 3;
|
static final int V3_SUB_START_OFFSET_COL = 3;
|
||||||
public static final int V3_SUB_INT_DATA1_COL = 4;
|
static final int V3_SUB_INT_DATA1_COL = 4;
|
||||||
public static final int V3_SUB_LONG_DATA2_COL = 5;
|
static final int V3_SUB_LONG_DATA2_COL = 5;
|
||||||
|
|
||||||
public static final byte V3_SUB_TYPE_BIT_MAPPED = 0;
|
static final byte V3_SUB_TYPE_BIT_MAPPED = 0;
|
||||||
public static final byte V3_SUB_TYPE_BYTE_MAPPED = 1;
|
static final byte V3_SUB_TYPE_BYTE_MAPPED = 1;
|
||||||
public static final byte V3_SUB_TYPE_BUFFER = 2;
|
static final byte V3_SUB_TYPE_BUFFER = 2;
|
||||||
public static final byte V3_SUB_TYPE_UNITIALIZED = 3;
|
static final byte V3_SUB_TYPE_UNITIALIZED = 3;
|
||||||
public static final byte V3_SUB_TYPE_FILE_BYTES = 4;
|
static final byte V3_SUB_TYPE_FILE_BYTES = 4;
|
||||||
|
|
||||||
static Schema V3_BLOCK_SCHEMA = new Schema(V3_VERSION, "Key",
|
static Schema V3_BLOCK_SCHEMA = new Schema(V3_VERSION, "Key",
|
||||||
new Field[] { StringField.INSTANCE, StringField.INSTANCE, StringField.INSTANCE,
|
new Field[] { StringField.INSTANCE, StringField.INSTANCE, StringField.INSTANCE,
|
||||||
|
|
|
@ -1560,7 +1560,8 @@ public class SymbolManager implements SymbolTable, ManagerDB {
|
||||||
long parentId, SymbolType symType) {
|
long parentId, SymbolType symType) {
|
||||||
|
|
||||||
// create a label history record
|
// create a label history record
|
||||||
if (symType == SymbolType.LABEL || symType == SymbolType.FUNCTION) {
|
if (!symbol.isDynamic() &&
|
||||||
|
(symType == SymbolType.LABEL || symType == SymbolType.FUNCTION)) {
|
||||||
createLabelHistoryRecord(addr, null, name, LabelHistory.REMOVE);
|
createLabelHistoryRecord(addr, null, name, LabelHistory.REMOVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue