mirror of
https://github.com/NationalSecurityAgency/ghidra
synced 2024-09-13 21:56:19 +00:00
Merge remote-tracking branch 'origin/GP-4535_emteere_FixStoreOfDefaultDisassemblyContext--SQUASHED'
This commit is contained in:
commit
5361b13e6f
|
@ -66,7 +66,7 @@ public class ConstantPropagationAnalyzer extends AbstractAnalyzer {
|
||||||
protected static final String MAX_THREAD_COUNT_OPTION_NAME = "Max Threads";
|
protected static final String MAX_THREAD_COUNT_OPTION_NAME = "Max Threads";
|
||||||
protected static final String MAX_THREAD_COUNT_OPTION_DESCRIPTION =
|
protected static final String MAX_THREAD_COUNT_OPTION_DESCRIPTION =
|
||||||
"Maximum threads for constant propagation. Too many threads causes thrashing in DB.";
|
"Maximum threads for constant propagation. Too many threads causes thrashing in DB.";
|
||||||
protected static final int MAX_THREAD_COUNT_OPTION_DEFAULT_VALUE = 2;
|
protected static final int MAX_THREAD_COUNT_OPTION_DEFAULT_VALUE = 1;
|
||||||
|
|
||||||
protected static final String MIN_KNOWN_REFADDRESS_OPTION_NAME = "Min absolute reference";
|
protected static final String MIN_KNOWN_REFADDRESS_OPTION_NAME = "Min absolute reference";
|
||||||
protected static final String MIN_KNOWN_REFADDRESS_OPTION_DESCRIPTION =
|
protected static final String MIN_KNOWN_REFADDRESS_OPTION_DESCRIPTION =
|
||||||
|
|
|
@ -184,25 +184,12 @@ public class DecompilerSwitchAnalysisCmd extends BackgroundCommand<Program> {
|
||||||
if (disSetList.contains(caseStart)) {
|
if (disSetList.contains(caseStart)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (switchContext != null) {
|
try {
|
||||||
try {
|
setSwitchTargetContext(programContext, caseStart, switchContext);
|
||||||
// Combine flowed switch context with context register value at case address
|
}
|
||||||
RegisterValue curContext =
|
catch (ContextChangeException e) {
|
||||||
programContext.getRegisterValue(baseContextRegister, caseStart);
|
// This can occur when two or more threads are working on the same function
|
||||||
if (curContext != null) {
|
continue;
|
||||||
curContext = curContext.combineValues(switchContext);
|
|
||||||
|
|
||||||
// lay down the new merged context
|
|
||||||
programContext.setRegisterValue(caseStart, caseStart, curContext);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
programContext.setRegisterValue(caseStart, caseStart, switchContext);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (ContextChangeException e) {
|
|
||||||
// This can occur when two or more threads are working on the same function
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
disSetList.add(caseStart);
|
disSetList.add(caseStart);
|
||||||
}
|
}
|
||||||
|
@ -229,6 +216,26 @@ public class DecompilerSwitchAnalysisCmd extends BackgroundCommand<Program> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setSwitchTargetContext(ProgramContext programContext, Address targetStart, RegisterValue switchContext) throws ContextChangeException {
|
||||||
|
if (switchContext == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Combine flowed switch context with context register value at case address
|
||||||
|
RegisterValue curContext =
|
||||||
|
programContext.getNonDefaultValue(switchContext.getRegister(), targetStart);
|
||||||
|
if (curContext != null) {
|
||||||
|
switchContext = curContext.combineValues(switchContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (switchContext == null || !switchContext.hasAnyValue()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// only store if different than what is already there, which could be a default value
|
||||||
|
program.getProgramContext().setRegisterValue(targetStart, targetStart, switchContext);
|
||||||
|
}
|
||||||
|
|
||||||
private void labelSwitch(JumpTable table, TaskMonitor monitor) throws CancelledException {
|
private void labelSwitch(JumpTable table, TaskMonitor monitor) throws CancelledException {
|
||||||
AddLabelCmd tableNameLabel =
|
AddLabelCmd tableNameLabel =
|
||||||
new AddLabelCmd(table.getSwitchAddress(), "switchD", SourceType.ANALYSIS);
|
new AddLabelCmd(table.getSwitchAddress(), "switchD", SourceType.ANALYSIS);
|
||||||
|
|
|
@ -583,7 +583,7 @@ public class Table {
|
||||||
* @return record count
|
* @return record count
|
||||||
*/
|
*/
|
||||||
public int getRecordCount() {
|
public int getRecordCount() {
|
||||||
return tableRecord.getRecordCount();
|
return (tableRecord == null ? 0 : tableRecord.getRecordCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -250,7 +250,7 @@ class TableRecord implements Comparable<TableRecord> {
|
||||||
* @return table's record count
|
* @return table's record count
|
||||||
*/
|
*/
|
||||||
int getRecordCount() {
|
int getRecordCount() {
|
||||||
return record.getIntValue(RECORD_COUNT_COLUMN);
|
return (record == null ? 0 : record.getIntValue(RECORD_COUNT_COLUMN));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,6 +21,7 @@ import java.util.List;
|
||||||
|
|
||||||
import db.*;
|
import db.*;
|
||||||
import db.util.ErrorHandler;
|
import db.util.ErrorHandler;
|
||||||
|
import generic.stl.Pair;
|
||||||
import ghidra.program.database.map.AddressKeyRecordIterator;
|
import ghidra.program.database.map.AddressKeyRecordIterator;
|
||||||
import ghidra.program.database.map.AddressMap;
|
import ghidra.program.database.map.AddressMap;
|
||||||
import ghidra.program.model.address.*;
|
import ghidra.program.model.address.*;
|
||||||
|
@ -85,9 +86,8 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
private Schema rangeMapSchema;
|
private Schema rangeMapSchema;
|
||||||
private Table rangeMapTable;
|
private Table rangeMapTable;
|
||||||
|
|
||||||
// caching
|
// caching, single value, so safer to check
|
||||||
private Field lastValue;
|
private Pair<AddressRange, Field> lastValue;
|
||||||
private AddressRange lastRange;
|
|
||||||
|
|
||||||
private int modCount;
|
private int modCount;
|
||||||
|
|
||||||
|
@ -136,10 +136,16 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
* @throws DuplicateNameException if there is already range map with that name
|
* @throws DuplicateNameException if there is already range map with that name
|
||||||
*/
|
*/
|
||||||
public boolean setName(String newName) throws DuplicateNameException {
|
public boolean setName(String newName) throws DuplicateNameException {
|
||||||
String newTableName = RANGE_MAP_TABLE_PREFIX + newName;
|
lock.acquire();
|
||||||
if (rangeMapTable == null || rangeMapTable.setName(newTableName)) {
|
try {
|
||||||
tableName = newTableName;
|
String newTableName = RANGE_MAP_TABLE_PREFIX + newName;
|
||||||
return true;
|
if (rangeMapTable == null || rangeMapTable.setName(newTableName)) {
|
||||||
|
tableName = newTableName;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
lock.release();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -149,13 +155,8 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
* @return true if this map is empty
|
* @return true if this map is empty
|
||||||
*/
|
*/
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
lock.acquire();
|
Table localTable = rangeMapTable;
|
||||||
try {
|
return localTable == null || localTable.getRecordCount() == 0;
|
||||||
return rangeMapTable == null || rangeMapTable.getRecordCount() == 0;
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
lock.release();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -165,7 +166,8 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
* @return record count
|
* @return record count
|
||||||
*/
|
*/
|
||||||
public int getRecordCount() {
|
public int getRecordCount() {
|
||||||
return rangeMapTable != null ? rangeMapTable.getRecordCount() : 0;
|
Table localTable = rangeMapTable;
|
||||||
|
return localTable == null ? 0 : localTable.getRecordCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -174,23 +176,26 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
* @return value or null no value exists
|
* @return value or null no value exists
|
||||||
*/
|
*/
|
||||||
public Field getValue(Address address) {
|
public Field getValue(Address address) {
|
||||||
|
if (isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// check last cached range
|
||||||
|
Pair<AddressRange, Field> localValue = lastValue;
|
||||||
|
if (localValue != null && localValue.first.contains(address)) {
|
||||||
|
return localValue.second;
|
||||||
|
}
|
||||||
lock.acquire();
|
lock.acquire();
|
||||||
try {
|
try {
|
||||||
if (rangeMapTable == null) {
|
if (rangeMapTable == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// check last cached range
|
|
||||||
if (lastRange != null && lastRange.contains(address)) {
|
|
||||||
return lastValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
DBRecord record = findRecordContaining(address);
|
DBRecord record = findRecordContaining(address);
|
||||||
List<AddressRange> ranges = getRangesForRecord(record);
|
List<AddressRange> ranges = getRangesForRecord(record);
|
||||||
for (AddressRange range : ranges) {
|
for (AddressRange range : ranges) {
|
||||||
if (range.contains(address)) {
|
if (range.contains(address)) {
|
||||||
lastRange = range;
|
Field fieldValue = record.getFieldValue(VALUE_COL);
|
||||||
lastValue = record.getFieldValue(VALUE_COL);
|
lastValue = new Pair<AddressRange, Field>(range, fieldValue);
|
||||||
return lastValue;
|
return fieldValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,16 +219,19 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
* @throws IllegalArgumentException if the end address is greater then the start address
|
* @throws IllegalArgumentException if the end address is greater then the start address
|
||||||
*/
|
*/
|
||||||
public void paintRange(Address startAddress, Address endAddress, Field value) {
|
public void paintRange(Address startAddress, Address endAddress, Field value) {
|
||||||
|
if (value == null && isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
AddressRange.checkValidRange(startAddress, endAddress);
|
AddressRange.checkValidRange(startAddress, endAddress);
|
||||||
lock.acquire();
|
lock.acquire();
|
||||||
try {
|
try {
|
||||||
|
if (value == null && rangeMapTable == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
clearCache();
|
clearCache();
|
||||||
++modCount;
|
++modCount;
|
||||||
|
|
||||||
if (rangeMapTable == null) {
|
if (rangeMapTable == null) {
|
||||||
if (value == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
createTable();
|
createTable();
|
||||||
}
|
}
|
||||||
doPaintRange(startAddress, endAddress, value);
|
doPaintRange(startAddress, endAddress, value);
|
||||||
|
@ -246,7 +254,7 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
*/
|
*/
|
||||||
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)
|
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)
|
||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
if (length <= 0 || rangeMapTable == null) {
|
if (length <= 0 || isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,6 +262,9 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
AddressRangeMapDB tmpMap = null;
|
AddressRangeMapDB tmpMap = null;
|
||||||
lock.acquire();
|
lock.acquire();
|
||||||
try {
|
try {
|
||||||
|
if (rangeMapTable == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
tmpDb = dbHandle.getScratchPad();
|
tmpDb = dbHandle.getScratchPad();
|
||||||
tmpMap = new AddressRangeMapDB(tmpDb, addressMap, lock, "TEMP", errHandler, valueField,
|
tmpMap = new AddressRangeMapDB(tmpDb, addressMap, lock, "TEMP", errHandler, valueField,
|
||||||
indexed);
|
indexed);
|
||||||
|
@ -310,9 +321,15 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
* @return set of addresses where a values has been set
|
* @return set of addresses where a values has been set
|
||||||
*/
|
*/
|
||||||
public AddressSet getAddressSet() {
|
public AddressSet getAddressSet() {
|
||||||
|
AddressSet set = new AddressSet();
|
||||||
|
if (isEmpty()) {
|
||||||
|
return set;
|
||||||
|
}
|
||||||
lock.acquire();
|
lock.acquire();
|
||||||
try {
|
try {
|
||||||
AddressSet set = new AddressSet();
|
if (rangeMapTable == null) {
|
||||||
|
return set;
|
||||||
|
}
|
||||||
AddressRangeIterator addressRanges = getAddressRanges();
|
AddressRangeIterator addressRanges = getAddressRanges();
|
||||||
for (AddressRange addressRange : addressRanges) {
|
for (AddressRange addressRange : addressRanges) {
|
||||||
set.add(addressRange);
|
set.add(addressRange);
|
||||||
|
@ -331,11 +348,15 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
*/
|
*/
|
||||||
public AddressSet getAddressSet(Field value) {
|
public AddressSet getAddressSet(Field value) {
|
||||||
AddressSet set = new AddressSet();
|
AddressSet set = new AddressSet();
|
||||||
if (rangeMapTable == null) {
|
if (isEmpty()) {
|
||||||
return set;
|
return set;
|
||||||
}
|
}
|
||||||
lock.acquire();
|
lock.acquire();
|
||||||
try {
|
try {
|
||||||
|
if (rangeMapTable == null) {
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
|
||||||
RecordIterator it = rangeMapTable.indexIterator(VALUE_COL, value, value, true);
|
RecordIterator it = rangeMapTable.indexIterator(VALUE_COL, value, value, true);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
DBRecord record = it.next();
|
DBRecord record = it.next();
|
||||||
|
@ -357,7 +378,7 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
* @return AddressRangeIterator that iterates over all occupied ranges in the map
|
* @return AddressRangeIterator that iterates over all occupied ranges in the map
|
||||||
*/
|
*/
|
||||||
public AddressRangeIterator getAddressRanges() {
|
public AddressRangeIterator getAddressRanges() {
|
||||||
if (rangeMapTable == null) {
|
if (isEmpty()) {
|
||||||
return new EmptyAddressRangeIterator();
|
return new EmptyAddressRangeIterator();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -377,7 +398,7 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
* given start address
|
* given start address
|
||||||
*/
|
*/
|
||||||
public AddressRangeIterator getAddressRanges(Address startAddress) {
|
public AddressRangeIterator getAddressRanges(Address startAddress) {
|
||||||
if (rangeMapTable == null) {
|
if (isEmpty()) {
|
||||||
return new EmptyAddressRangeIterator();
|
return new EmptyAddressRangeIterator();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -398,7 +419,7 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
* given start address
|
* given start address
|
||||||
*/
|
*/
|
||||||
public AddressRangeIterator getAddressRanges(Address startAddress, Address endAddr) {
|
public AddressRangeIterator getAddressRanges(Address startAddress, Address endAddr) {
|
||||||
if (rangeMapTable == null) {
|
if (isEmpty()) {
|
||||||
return new EmptyAddressRangeIterator();
|
return new EmptyAddressRangeIterator();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -492,14 +513,13 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
* @return an address range that contains the given address and has all the same value
|
* @return an address range that contains the given address and has all the same value
|
||||||
*/
|
*/
|
||||||
public AddressRange getAddressRangeContaining(Address address) {
|
public AddressRange getAddressRangeContaining(Address address) {
|
||||||
|
// check cache
|
||||||
|
Pair<AddressRange, Field> localValue = lastValue;
|
||||||
|
if (localValue != null && localValue.first.contains(address)) {
|
||||||
|
return localValue.first;
|
||||||
|
}
|
||||||
lock.acquire();
|
lock.acquire();
|
||||||
try {
|
try {
|
||||||
// check cache
|
|
||||||
if (lastRange != null && lastRange.contains(address)) {
|
|
||||||
return lastRange;
|
|
||||||
}
|
|
||||||
|
|
||||||
// look for a stored value range that contains that address
|
// look for a stored value range that contains that address
|
||||||
AddressRange range = findValueRangeContainingAddress(address);
|
AddressRange range = findValueRangeContainingAddress(address);
|
||||||
if (range == null) {
|
if (range == null) {
|
||||||
|
@ -522,8 +542,8 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
List<AddressRange> rangesForRecord = getRangesForRecord(record);
|
List<AddressRange> rangesForRecord = getRangesForRecord(record);
|
||||||
for (AddressRange range : rangesForRecord) {
|
for (AddressRange range : rangesForRecord) {
|
||||||
if (range.contains(address)) {
|
if (range.contains(address)) {
|
||||||
lastRange = range;
|
Field fieldValue = record.getFieldValue(VALUE_COL);
|
||||||
lastValue = record.getFieldValue(VALUE_COL);
|
lastValue = new Pair<AddressRange, Field>(range, fieldValue);
|
||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -786,14 +806,7 @@ public class AddressRangeMapDB implements DBListener {
|
||||||
* Clears the "last range" cache
|
* Clears the "last range" cache
|
||||||
*/
|
*/
|
||||||
private void clearCache() {
|
private void clearCache() {
|
||||||
lock.acquire();
|
lastValue = null;
|
||||||
try {
|
|
||||||
lastRange = null;
|
|
||||||
lastValue = null;
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
lock.release();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DBRecord getAddressWrappingRecord() throws IOException {
|
DBRecord getAddressWrappingRecord() throws IOException {
|
||||||
|
|
|
@ -1389,7 +1389,12 @@ public class Disassembler implements DisassemblerConflictHandler {
|
||||||
RegisterValue contextValue = conflict.getParseContextValue();
|
RegisterValue contextValue = conflict.getParseContextValue();
|
||||||
if (contextValue != null) {
|
if (contextValue != null) {
|
||||||
try {
|
try {
|
||||||
program.getProgramContext().setRegisterValue(address, address, contextValue);
|
RegisterValue curContextValue = program.getProgramContext().getRegisterValue(contextValue.getRegister(), address);
|
||||||
|
|
||||||
|
// only store if different than what is already there, which could be a default value
|
||||||
|
if (!contextValue.equals(curContextValue)) {
|
||||||
|
program.getProgramContext().setRegisterValue(address, address, contextValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (ContextChangeException e) {
|
catch (ContextChangeException e) {
|
||||||
// ignore - existing instruction likely blocked context modification
|
// ignore - existing instruction likely blocked context modification
|
||||||
|
|
|
@ -143,7 +143,7 @@ abstract public class AbstractStoredProgramContext extends AbstractProgramContex
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterValueStore store = map.get(register.getBaseRegister());
|
RegisterValueStore store = map.get(register.getBaseRegister());
|
||||||
if (store == null) {
|
if (store == null || store.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,8 +153,8 @@ abstract public class AbstractStoredProgramContext extends AbstractProgramContex
|
||||||
@Override
|
@Override
|
||||||
public AddressRangeIterator getRegisterValueAddressRanges(Register register) {
|
public AddressRangeIterator getRegisterValueAddressRanges(Register register) {
|
||||||
RegisterValueStore store = registerValueMap.get(register.getBaseRegister());
|
RegisterValueStore store = registerValueMap.get(register.getBaseRegister());
|
||||||
if (store == null) {
|
if (store == null || store.isEmpty()) {
|
||||||
return new AddressSet().getAddressRanges();
|
return new EmptyAddressRangeIterator();
|
||||||
}
|
}
|
||||||
return new RegisterAddressRangeIterator(register, store.getAddressRangeIterator(),
|
return new RegisterAddressRangeIterator(register, store.getAddressRangeIterator(),
|
||||||
registerValueMap);
|
registerValueMap);
|
||||||
|
@ -163,7 +163,7 @@ abstract public class AbstractStoredProgramContext extends AbstractProgramContex
|
||||||
@Override
|
@Override
|
||||||
public AddressRange getRegisterValueRangeContaining(Register register, Address addr) {
|
public AddressRange getRegisterValueRangeContaining(Register register, Address addr) {
|
||||||
RegisterValueStore store = registerValueMap.get(register.getBaseRegister());
|
RegisterValueStore store = registerValueMap.get(register.getBaseRegister());
|
||||||
if (store == null) {
|
if (store == null || store.isEmpty()) {
|
||||||
return new AddressRangeImpl(addr, addr);
|
return new AddressRangeImpl(addr, addr);
|
||||||
}
|
}
|
||||||
return store.getValueRangeContaining(addr);
|
return store.getValueRangeContaining(addr);
|
||||||
|
@ -173,8 +173,8 @@ abstract public class AbstractStoredProgramContext extends AbstractProgramContex
|
||||||
public AddressRangeIterator getRegisterValueAddressRanges(Register register, Address start,
|
public AddressRangeIterator getRegisterValueAddressRanges(Register register, Address start,
|
||||||
Address end) {
|
Address end) {
|
||||||
RegisterValueStore store = registerValueMap.get(register.getBaseRegister());
|
RegisterValueStore store = registerValueMap.get(register.getBaseRegister());
|
||||||
if (store == null) {
|
if (store == null || store.isEmpty()) {
|
||||||
return new AddressSet().getAddressRanges();
|
return new EmptyAddressRangeIterator();
|
||||||
}
|
}
|
||||||
return new RegisterAddressRangeIterator(register, store.getAddressRangeIterator(start, end),
|
return new RegisterAddressRangeIterator(register, store.getAddressRangeIterator(start, end),
|
||||||
registerValueMap);
|
registerValueMap);
|
||||||
|
@ -183,8 +183,8 @@ abstract public class AbstractStoredProgramContext extends AbstractProgramContex
|
||||||
@Override
|
@Override
|
||||||
public AddressRangeIterator getDefaultRegisterValueAddressRanges(Register register) {
|
public AddressRangeIterator getDefaultRegisterValueAddressRanges(Register register) {
|
||||||
RegisterValueStore store = defaultRegisterValueMap.get(register.getBaseRegister());
|
RegisterValueStore store = defaultRegisterValueMap.get(register.getBaseRegister());
|
||||||
if (store == null) {
|
if (store == null || store.isEmpty()) {
|
||||||
return new AddressSet().getAddressRanges();
|
return new EmptyAddressRangeIterator();
|
||||||
}
|
}
|
||||||
return new RegisterAddressRangeIterator(register, store.getAddressRangeIterator(),
|
return new RegisterAddressRangeIterator(register, store.getAddressRangeIterator(),
|
||||||
defaultRegisterValueMap);
|
defaultRegisterValueMap);
|
||||||
|
@ -194,8 +194,8 @@ abstract public class AbstractStoredProgramContext extends AbstractProgramContex
|
||||||
public AddressRangeIterator getDefaultRegisterValueAddressRanges(Register register,
|
public AddressRangeIterator getDefaultRegisterValueAddressRanges(Register register,
|
||||||
Address start, Address end) {
|
Address start, Address end) {
|
||||||
RegisterValueStore store = defaultRegisterValueMap.get(register.getBaseRegister());
|
RegisterValueStore store = defaultRegisterValueMap.get(register.getBaseRegister());
|
||||||
if (store == null) {
|
if (store == null || store.isEmpty()) {
|
||||||
return new AddressSet().getAddressRanges();
|
return new EmptyAddressRangeIterator();
|
||||||
}
|
}
|
||||||
return new RegisterAddressRangeIterator(register, store.getAddressRangeIterator(start, end),
|
return new RegisterAddressRangeIterator(register, store.getAddressRangeIterator(start, end),
|
||||||
defaultRegisterValueMap);
|
defaultRegisterValueMap);
|
||||||
|
|
Loading…
Reference in a new issue