mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-22 04:05:39 +00:00
GP-2974: Fixing warnings
This commit is contained in:
parent
113156a19f
commit
7fa3389119
@ -263,7 +263,7 @@ public class IsfDataTypeWriter {
|
|||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
for (String key : keylist) {
|
for (String key : keylist) {
|
||||||
DataType dataType = map.get(key);
|
DataType dataType = map.get(key);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (key.contains(".conflict")) {
|
if (key.contains(".conflict")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ public class DebuggerCopyPlan {
|
|||||||
byte[] buf = new byte[4096];
|
byte[] buf = new byte[4096];
|
||||||
AddressRangeChunker chunker = new AddressRangeChunker(fromRange, buf.length);
|
AddressRangeChunker chunker = new AddressRangeChunker(fromRange, buf.length);
|
||||||
for (AddressRange chunk : chunker) {
|
for (AddressRange chunk : chunker) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = chunk.getMinAddress();
|
Address addr = chunk.getMinAddress();
|
||||||
int len = (int) chunk.getLength();
|
int len = (int) chunk.getLength();
|
||||||
from.getMemory().getBytes(addr, buf, 0, len);
|
from.getMemory().getBytes(addr, buf, 0, len);
|
||||||
@ -124,7 +124,7 @@ public class DebuggerCopyPlan {
|
|||||||
Listing intoListing = into.getListing();
|
Listing intoListing = into.getListing();
|
||||||
for (Instruction ins : from.getListing()
|
for (Instruction ins : from.getListing()
|
||||||
.getInstructions(new AddressSet(fromRange), true)) {
|
.getInstructions(new AddressSet(fromRange), true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (!ins.getPrototype().getLanguage().equals(into.getLanguage())) {
|
if (!ins.getPrototype().getLanguage().equals(into.getLanguage())) {
|
||||||
// Filter out "guest" instructions
|
// Filter out "guest" instructions
|
||||||
continue;
|
continue;
|
||||||
@ -148,7 +148,7 @@ public class DebuggerCopyPlan {
|
|||||||
Listing intoListing = into.getListing();
|
Listing intoListing = into.getListing();
|
||||||
for (Data data : from.getListing()
|
for (Data data : from.getListing()
|
||||||
.getDefinedData(new AddressSet(fromRange), true)) {
|
.getDefinedData(new AddressSet(fromRange), true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long off = data.getMinAddress().subtract(fromRange.getMinAddress());
|
long off = data.getMinAddress().subtract(fromRange.getMinAddress());
|
||||||
Address dest = intoAddress.add(off);
|
Address dest = intoAddress.add(off);
|
||||||
DataType dt = data.getDataType();
|
DataType dt = data.getDataType();
|
||||||
@ -170,7 +170,7 @@ public class DebuggerCopyPlan {
|
|||||||
Listing intoListing = into.getListing();
|
Listing intoListing = into.getListing();
|
||||||
for (Data data : from.getListing()
|
for (Data data : from.getListing()
|
||||||
.getDefinedData(new AddressSet(fromRange), true)) {
|
.getDefinedData(new AddressSet(fromRange), true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long off = data.getMinAddress().subtract(fromRange.getMinAddress());
|
long off = data.getMinAddress().subtract(fromRange.getMinAddress());
|
||||||
Address dest = intoAddress.add(off);
|
Address dest = intoAddress.add(off);
|
||||||
DataType dt = data.getDataType();
|
DataType dt = data.getDataType();
|
||||||
@ -187,7 +187,7 @@ public class DebuggerCopyPlan {
|
|||||||
SymbolTable intoTable = into.getSymbolTable();
|
SymbolTable intoTable = into.getSymbolTable();
|
||||||
for (Symbol label : from.getSymbolTable()
|
for (Symbol label : from.getSymbolTable()
|
||||||
.getSymbols(new AddressSet(fromRange), SymbolType.LABEL, true)) {
|
.getSymbols(new AddressSet(fromRange), SymbolType.LABEL, true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (label.getSource() == SourceType.DEFAULT) {
|
if (label.getSource() == SourceType.DEFAULT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -222,7 +222,7 @@ public class DebuggerCopyPlan {
|
|||||||
for (TraceBreakpoint bpt : from.getTrace()
|
for (TraceBreakpoint bpt : from.getTrace()
|
||||||
.getBreakpointManager()
|
.getBreakpointManager()
|
||||||
.getBreakpointsIntersecting(Lifespan.at(from.getSnap()), fromRange)) {
|
.getBreakpointsIntersecting(Lifespan.at(from.getSnap()), fromRange)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long off = bpt.getMinAddress().subtract(fromRange.getMinAddress());
|
long off = bpt.getMinAddress().subtract(fromRange.getMinAddress());
|
||||||
Address dest = intoAddress.add(off);
|
Address dest = intoAddress.add(off);
|
||||||
ProgramBreakpoint pb =
|
ProgramBreakpoint pb =
|
||||||
@ -245,7 +245,7 @@ public class DebuggerCopyPlan {
|
|||||||
Iterator<Bookmark> bit =
|
Iterator<Bookmark> bit =
|
||||||
from.getBookmarkManager().getBookmarksIterator(fromRange.getMinAddress(), true);
|
from.getBookmarkManager().getBookmarksIterator(fromRange.getMinAddress(), true);
|
||||||
while (bit.hasNext()) {
|
while (bit.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Bookmark bm = bit.next();
|
Bookmark bm = bit.next();
|
||||||
if (bm.getAddress().compareTo(fromRange.getMaxAddress()) > 0) {
|
if (bm.getAddress().compareTo(fromRange.getMaxAddress()) > 0) {
|
||||||
break;
|
break;
|
||||||
@ -270,7 +270,7 @@ public class DebuggerCopyPlan {
|
|||||||
ReferenceManager intoRefs = into.getReferenceManager();
|
ReferenceManager intoRefs = into.getReferenceManager();
|
||||||
for (Reference ref : from.getReferenceManager()
|
for (Reference ref : from.getReferenceManager()
|
||||||
.getReferenceIterator(fromRange.getMinAddress())) {
|
.getReferenceIterator(fromRange.getMinAddress())) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (ref.getFromAddress().compareTo(fromRange.getMaxAddress()) > 0) {
|
if (ref.getFromAddress().compareTo(fromRange.getMaxAddress()) > 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -304,7 +304,7 @@ public class DebuggerCopyPlan {
|
|||||||
Listing intoListing = into.getListing();
|
Listing intoListing = into.getListing();
|
||||||
for (Address addr : fromListing.getCommentAddressIterator(new AddressSet(fromRange),
|
for (Address addr : fromListing.getCommentAddressIterator(new AddressSet(fromRange),
|
||||||
true)) {
|
true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long off = addr.subtract(fromRange.getMinAddress());
|
long off = addr.subtract(fromRange.getMinAddress());
|
||||||
Address dest = intoAddress.add(off);
|
Address dest = intoAddress.add(off);
|
||||||
// Ugly, but there's not MAX/MIN_COMMENT_TYPE
|
// Ugly, but there's not MAX/MIN_COMMENT_TYPE
|
||||||
|
@ -305,7 +305,7 @@ public abstract class AbstractQueryTableModel<T> extends ThreadedTableModel<T, T
|
|||||||
}
|
}
|
||||||
for (T t : (Iterable<T>) streamRows(trace, query, span)::iterator) {
|
for (T t : (Iterable<T>) streamRows(trace, query, span)::iterator) {
|
||||||
accumulator.add(t);
|
accumulator.add(t);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ public class ObjectNode extends GTreeSlowLoadingNode { //extends GTreeNode
|
|||||||
List<GTreeNode> children = children();
|
List<GTreeNode> children = children();
|
||||||
monitor = new TreeTaskMonitor(monitor, children.size());
|
monitor = new TreeTaskMonitor(monitor, children.size());
|
||||||
for (GTreeNode child : children) {
|
for (GTreeNode child : children) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
count += child.loadAll(monitor);
|
count += child.loadAll(monitor);
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
}
|
}
|
||||||
|
@ -762,7 +762,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
|||||||
protected static void doAddMappings(Trace trace, Collection<MapEntry<?, ?>> entries,
|
protected static void doAddMappings(Trace trace, Collection<MapEntry<?, ?>> entries,
|
||||||
TaskMonitor monitor, boolean truncateExisting) throws CancelledException {
|
TaskMonitor monitor, boolean truncateExisting) throws CancelledException {
|
||||||
for (MapEntry<?, ?> ent : entries) {
|
for (MapEntry<?, ?> ent : entries) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
try {
|
try {
|
||||||
DebuggerStaticMappingUtils.addMapping(ent, truncateExisting);
|
DebuggerStaticMappingUtils.addMapping(ent, truncateExisting);
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ public class UnwindAnalysis {
|
|||||||
public void executeSet(SymPcodeExecutor exec, AddressSetView set)
|
public void executeSet(SymPcodeExecutor exec, AddressSetView set)
|
||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
for (Instruction i : program.getListing().getInstructions(set, true)) {
|
for (Instruction i : program.getListing().getInstructions(set, true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
exec.execute(PcodeProgram.fromInstruction(i, true), PcodeUseropLibrary.nil());
|
exec.execute(PcodeProgram.fromInstruction(i, true), PcodeUseropLibrary.nil());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,7 @@ public abstract class AbstractBaseDBTraceDefinedUnitsView<T extends AbstractDBTr
|
|||||||
cacheForSequence.invalidate();
|
cacheForSequence.invalidate();
|
||||||
for (T unit : mapSpace.reduce(
|
for (T unit : mapSpace.reduce(
|
||||||
TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
|
TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (unit.getStartSnap() < startSnap) {
|
if (unit.getStartSnap() < startSnap) {
|
||||||
Lifespan oldSpan = unit.getLifespan();
|
Lifespan oldSpan = unit.getLifespan();
|
||||||
if (clearContext) {
|
if (clearContext) {
|
||||||
|
@ -491,7 +491,7 @@ public class DBTraceCodeManager extends AbstractDBTraceSpaceBasedManager<DBTrace
|
|||||||
monitor.setMaximum(protoStore.getRecordCount());
|
monitor.setMaximum(protoStore.getRecordCount());
|
||||||
for (Iterator<DBTraceCodePrototypeEntry> it = protoStore.asMap().values().iterator(); it
|
for (Iterator<DBTraceCodePrototypeEntry> it = protoStore.asMap().values().iterator(); it
|
||||||
.hasNext();) {
|
.hasNext();) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
DBTraceCodePrototypeEntry protoEnt = it.next();
|
DBTraceCodePrototypeEntry protoEnt = it.next();
|
||||||
if (protoEnt.prototype.getLanguage() != guest.getLanguage()) {
|
if (protoEnt.prototype.getLanguage() != guest.getLanguage()) {
|
||||||
|
@ -188,7 +188,7 @@ public class DBTraceCodeSpace implements TraceCodeSpace, DBTraceSpaceBased {
|
|||||||
|
|
||||||
for (DBTraceInstruction instruction : instructionMapSpace.reduce(
|
for (DBTraceInstruction instruction : instructionMapSpace.reduce(
|
||||||
TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
|
TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
if (instruction.platform != guest) {
|
if (instruction.platform != guest) {
|
||||||
continue;
|
continue;
|
||||||
@ -200,7 +200,7 @@ public class DBTraceCodeSpace implements TraceCodeSpace, DBTraceSpaceBased {
|
|||||||
monitor.setMaximum(dataMapSpace.size()); // This is OK
|
monitor.setMaximum(dataMapSpace.size()); // This is OK
|
||||||
for (DBTraceData dataUnit : dataMapSpace.reduce(
|
for (DBTraceData dataUnit : dataMapSpace.reduce(
|
||||||
TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
|
TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
if (dataUnit.platform != guest) {
|
if (dataUnit.platform != guest) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -658,7 +658,7 @@ public abstract class AbstractDBTraceProgramViewListing implements TraceProgramV
|
|||||||
AddressSet result = new AddressSet();
|
AddressSet result = new AddressSet();
|
||||||
for (AddressRange range : getUndefinedRangeIterator(set, true)) {
|
for (AddressRange range : getUndefinedRangeIterator(set, true)) {
|
||||||
result.add(range);
|
result.add(range);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ public class DBTraceProgramViewBookmarkManager implements TraceProgramViewBookma
|
|||||||
Collection<DBTraceBookmark> bookmarks = bookmarkManager.getBookmarksByType(type);
|
Collection<DBTraceBookmark> bookmarks = bookmarkManager.getBookmarksByType(type);
|
||||||
monitor.initialize(bookmarks.size());
|
monitor.initialize(bookmarks.size());
|
||||||
for (DBTraceBookmark bm : bookmarks) {
|
for (DBTraceBookmark bm : bookmarks) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
if (!bm.getLifespan().contains(program.snap)) {
|
if (!bm.getLifespan().contains(program.snap)) {
|
||||||
continue;
|
continue;
|
||||||
@ -171,7 +171,7 @@ public class DBTraceProgramViewBookmarkManager implements TraceProgramViewBookma
|
|||||||
try (LockHold hold = program.trace.lockWrite()) {
|
try (LockHold hold = program.trace.lockWrite()) {
|
||||||
monitor.initialize(set.getNumAddresses());
|
monitor.initialize(set.getNumAddresses());
|
||||||
for (AddressRange rng : set) {
|
for (AddressRange rng : set) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.incrementProgress(rng.getLength());
|
monitor.incrementProgress(rng.getLength());
|
||||||
DBTraceBookmarkSpace space =
|
DBTraceBookmarkSpace space =
|
||||||
bookmarkManager.getBookmarkSpace(rng.getAddressSpace(), false);
|
bookmarkManager.getBookmarkSpace(rng.getAddressSpace(), false);
|
||||||
@ -180,7 +180,7 @@ public class DBTraceProgramViewBookmarkManager implements TraceProgramViewBookma
|
|||||||
}
|
}
|
||||||
for (TraceBookmark bm : space.getBookmarksIntersecting(Lifespan.at(program.snap),
|
for (TraceBookmark bm : space.getBookmarksIntersecting(Lifespan.at(program.snap),
|
||||||
rng)) {
|
rng)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (!bm.getLifespan().contains(program.snap)) {
|
if (!bm.getLifespan().contains(program.snap)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ public class DBTraceProgramViewFunctionManager implements FunctionManager {
|
|||||||
Iterator<? extends DBTraceFunctionSymbol> it =
|
Iterator<? extends DBTraceFunctionSymbol> it =
|
||||||
getFunctionsInRange(new AddressRangeImpl(startAddr, endAddr), true);
|
getFunctionsInRange(new AddressRangeImpl(startAddr, endAddr), true);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
it.next().delete();
|
it.next().delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ public class DBTraceProgramViewListing extends AbstractDBTraceProgramViewListing
|
|||||||
for (AddressRange range : program.getAddressFactory()
|
for (AddressRange range : program.getAddressFactory()
|
||||||
.getAddressSet(startAddr,
|
.getAddressSet(startAddr,
|
||||||
endAddr)) {
|
endAddr)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
codeOperations.definedUnits()
|
codeOperations.definedUnits()
|
||||||
.clear(Lifespan.at(program.snap), range, clearContext, monitor);
|
.clear(Lifespan.at(program.snap), range, clearContext, monitor);
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ public interface Scheduler {
|
|||||||
emuThread.finishInstruction();
|
emuThread.finishInstruction();
|
||||||
}
|
}
|
||||||
for (int i = 0; i < slice.tickCount; i++) {
|
for (int i = 0; i < slice.tickCount; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
emuThread.stepInstruction();
|
emuThread.stepInstruction();
|
||||||
completedTicks++;
|
completedTicks++;
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ public class SkipStep extends AbstractStep {
|
|||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
for (int i = 0; i < tickCount; i++) {
|
for (int i = 0; i < tickCount; i++) {
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
stepper.skip(emuThread);
|
stepper.skip(emuThread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ public class TickStep extends AbstractStep {
|
|||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
for (int i = 0; i < tickCount; i++) {
|
for (int i = 0; i < tickCount; i++) {
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
stepper.tick(emuThread);
|
stepper.tick(emuThread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public abstract class DBDomainObjectSupport extends DomainObjectAdapterDB {
|
|||||||
|
|
||||||
protected <T> T createManager(String managerName, ManagerSupplier<T> supplier)
|
protected <T> T createManager(String managerName, ManagerSupplier<T> supplier)
|
||||||
throws CancelledException, IOException {
|
throws CancelledException, IOException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.setMessage("Creating " + managerName);
|
monitor.setMessage("Creating " + managerName);
|
||||||
try {
|
try {
|
||||||
return supplier.create(openMode, monitor);
|
return supplier.create(openMode, monitor);
|
||||||
|
@ -94,7 +94,7 @@ public class FunctionStartClassifier {
|
|||||||
results = classifyQ.waitForResults();
|
results = classifyQ.waitForResults();
|
||||||
}
|
}
|
||||||
catch (InterruptedException e) {
|
catch (InterruptedException e) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Msg.error(this, "Exception while classifying functions: " + e.getMessage());
|
Msg.error(this, "Exception while classifying functions: " + e.getMessage());
|
||||||
}
|
}
|
||||||
long end = System.nanoTime();
|
long end = System.nanoTime();
|
||||||
|
@ -303,7 +303,7 @@ public class FunctionStartRFParams {
|
|||||||
funcEntries = new AddressSet();
|
funcEntries = new AddressSet();
|
||||||
funcInteriors = new AddressSet();
|
funcInteriors = new AddressSet();
|
||||||
while (fIter.hasNext()) {
|
while (fIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function func = fIter.next();
|
Function func = fIter.next();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
if (func.getBody().getNumAddresses() < minFuncSize) {
|
if (func.getBody().getNumAddresses() < minFuncSize) {
|
||||||
|
@ -52,7 +52,7 @@ public class GetAddressesToClassifyTask extends Task {
|
|||||||
monitor.initialize(prog.getFunctionManager().getFunctionCount());
|
monitor.initialize(prog.getFunctionManager().getFunctionCount());
|
||||||
FunctionIterator fIter = prog.getFunctionManager().getFunctions(true);
|
FunctionIterator fIter = prog.getFunctionManager().getFunctions(true);
|
||||||
while (fIter.hasNext()) {
|
while (fIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
Function func = fIter.next();
|
Function func = fIter.next();
|
||||||
execNonFunc = execNonFunc.subtract(func.getBody());
|
execNonFunc = execNonFunc.subtract(func.getBody());
|
||||||
|
@ -116,7 +116,7 @@ public class ModelTrainingUtils {
|
|||||||
TaskMonitor monitor) throws CancelledException {
|
TaskMonitor monitor) throws CancelledException {
|
||||||
AddressSet following = new AddressSet();
|
AddressSet following = new AddressSet();
|
||||||
for (Address addr : addresses.getAddresses(true)) {
|
for (Address addr : addresses.getAddresses(true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
CodeUnit cu = program.getListing().getCodeUnitAfter(addr);
|
CodeUnit cu = program.getListing().getCodeUnitAfter(addr);
|
||||||
if (cu == null) {
|
if (cu == null) {
|
||||||
continue;
|
continue;
|
||||||
@ -149,7 +149,7 @@ public class ModelTrainingUtils {
|
|||||||
TaskMonitor monitor) throws CancelledException {
|
TaskMonitor monitor) throws CancelledException {
|
||||||
AddressSet preceding = new AddressSet();
|
AddressSet preceding = new AddressSet();
|
||||||
for (Address addr : addresses.getAddresses(true)) {
|
for (Address addr : addresses.getAddresses(true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
CodeUnit cu = program.getListing().getCodeUnitBefore(addr);
|
CodeUnit cu = program.getListing().getCodeUnitBefore(addr);
|
||||||
if (cu == null) {
|
if (cu == null) {
|
||||||
continue;
|
continue;
|
||||||
@ -182,7 +182,7 @@ public class ModelTrainingUtils {
|
|||||||
program.getListing().getDefinedData(program.getMemory().getExecuteSet(), true);
|
program.getListing().getDefinedData(program.getMemory().getExecuteSet(), true);
|
||||||
AddressSet definedData = new AddressSet();
|
AddressSet definedData = new AddressSet();
|
||||||
for (Data d : dataIter) {
|
for (Data d : dataIter) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
definedData.add(
|
definedData.add(
|
||||||
new AddressRangeImpl(d.getAddress(), d.getAddress().add(d.getLength() - 1)));
|
new AddressRangeImpl(d.getAddress(), d.getAddress().add(d.getLength() - 1)));
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ public class ModelTrainingUtils {
|
|||||||
monitor.initialize(source.getNumAddresses());
|
monitor.initialize(source.getNumAddresses());
|
||||||
Iterator<Address> addressIter = source.getAddresses(true);
|
Iterator<Address> addressIter = source.getAddresses(true);
|
||||||
while (addressIter.hasNext()) {
|
while (addressIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = addressIter.next();
|
Address addr = addressIter.next();
|
||||||
monitor.incrementProgress(1L);
|
monitor.incrementProgress(1L);
|
||||||
List<Feature> trainingVector =
|
List<Feature> trainingVector =
|
||||||
|
@ -338,7 +338,7 @@ public class RandomForestTrainingTask extends Task {
|
|||||||
|
|
||||||
List<CARTClassificationTrainer> trainers = new ArrayList<>();
|
List<CARTClassificationTrainer> trainers = new ArrayList<>();
|
||||||
for (int i = 0; i < NUM_TREES; ++i) {
|
for (int i = 0; i < NUM_TREES; ++i) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
//Integer.MAX_VALUE: unlimited depth
|
//Integer.MAX_VALUE: unlimited depth
|
||||||
trainers.add(new CARTClassificationTrainer(Integer.MAX_VALUE, featureFraction,
|
trainers.add(new CARTClassificationTrainer(Integer.MAX_VALUE, featureFraction,
|
||||||
ThreadLocalRandom.current().nextLong()));
|
ThreadLocalRandom.current().nextLong()));
|
||||||
@ -371,7 +371,7 @@ public class RandomForestTrainingTask extends Task {
|
|||||||
new VotingCombiner());
|
new VotingCombiner());
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Msg.error(this, "Exception while training model: " + e.getMessage());
|
Msg.error(this, "Exception while training model: " + e.getMessage());
|
||||||
}
|
}
|
||||||
return randomForest;
|
return randomForest;
|
||||||
@ -411,7 +411,7 @@ public class RandomForestTrainingTask extends Task {
|
|||||||
RandomForestFunctionFinderPlugin.FUNC_START, errors);
|
RandomForestFunctionFinderPlugin.FUNC_START, errors);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Msg.error(this,
|
Msg.error(this,
|
||||||
"Exception while evaluating model on known function starts: " + e.getMessage());
|
"Exception while evaluating model on known function starts: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -430,7 +430,7 @@ public class RandomForestTrainingTask extends Task {
|
|||||||
RandomForestFunctionFinderPlugin.NON_START, errors);
|
RandomForestFunctionFinderPlugin.NON_START, errors);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Msg.error(this,
|
Msg.error(this,
|
||||||
"Exception while evaluating model on known function interiors: " + e.getMessage());
|
"Exception while evaluating model on known function interiors: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public class RandomSubsetUtils {
|
|||||||
int addressesVisited = 0;
|
int addressesVisited = 0;
|
||||||
int listIndex = 0;
|
int listIndex = 0;
|
||||||
while (iter.hasNext() && addressesAdded < k) {
|
while (iter.hasNext() && addressesAdded < k) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = iter.next();
|
Address addr = iter.next();
|
||||||
if (sortedRandom.get(listIndex) == addressesVisited) {
|
if (sortedRandom.get(listIndex) == addressesVisited) {
|
||||||
randomAddresses.add(addr);
|
randomAddresses.add(addr);
|
||||||
|
@ -42,7 +42,7 @@ public class BasicBlockCounterFunctionAlgorithm implements FunctionAlgorithm {
|
|||||||
|
|
||||||
int blockCount = 0;
|
int blockCount = 0;
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
iterator.next();
|
iterator.next();
|
||||||
blockCount++;
|
blockCount++;
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
@ -41,7 +41,7 @@ public class ReferenceFunctionAlgorithm implements FunctionAlgorithm {
|
|||||||
AddressIterator iterator = referenceManager.getReferenceSourceIterator(body, true);
|
AddressIterator iterator = referenceManager.getReferenceSourceIterator(body, true);
|
||||||
int referenceCount = 0;
|
int referenceCount = 0;
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address address = iterator.next();
|
Address address = iterator.next();
|
||||||
Reference[] referencesFrom = referenceManager.getReferencesFrom(address);
|
Reference[] referencesFrom = referenceManager.getReferencesFrom(address);
|
||||||
referenceCount += referencesFrom.length;
|
referenceCount += referencesFrom.length;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -35,7 +34,7 @@ public class SampleSearcher {
|
|||||||
monitor.initialize(program.getFunctionManager().getFunctionCount());
|
monitor.initialize(program.getFunctionManager().getFunctionCount());
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
if (monitor.isCancelled()) {
|
if (monitor.isCancelled()) {
|
||||||
monitor.clearCanceled(); //otherwise the partial results won't be shown
|
monitor.clearCancelled(); //otherwise the partial results won't be shown
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Function fun = it.next();
|
Function fun = it.next();
|
||||||
|
@ -58,7 +58,7 @@ public class CompareSleighExternal extends GhidraScript {
|
|||||||
|
|
||||||
long align = currentProgram.getLanguage().getInstructionAlignment();
|
long align = currentProgram.getLanguage().getInstructionAlignment();
|
||||||
while (addresses.hasNext()) {
|
while (addresses.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = addresses.next();
|
Address addr = addresses.next();
|
||||||
|
|
||||||
completed++;
|
completed++;
|
||||||
|
@ -54,7 +54,7 @@ public class ConsistencyCheck extends GhidraScript {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (!df.canSave() || !currentProgram.hasExclusiveAccess()) {
|
if (!df.canSave() || !currentProgram.hasExclusiveAccess()) {
|
||||||
popup("Program database is NOT consistent!\nRebuild requires exclusive checkout.");
|
popup("Program database is NOT consistent!\nRebuild requires exclusive checkout.");
|
||||||
@ -72,7 +72,7 @@ public class ConsistencyCheck extends GhidraScript {
|
|||||||
|
|
||||||
programMgr.closeProgram(currentProgram, true);
|
programMgr.closeProgram(currentProgram, true);
|
||||||
|
|
||||||
monitor.clearCanceled(); // compensate for Script Manager cancelling task on program close
|
monitor.clearCancelled(); // compensate for Script Manager cancelling task on program close
|
||||||
|
|
||||||
dbh = program.getDBHandle();
|
dbh = program.getDBHandle();
|
||||||
try {
|
try {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -98,7 +97,7 @@ public class MoveMemoryRangeContents extends GhidraScript {
|
|||||||
monitor.setMessage("Clearing old symbols...");
|
monitor.setMessage("Clearing old symbols...");
|
||||||
SymbolIterator symIter = program.getSymbolTable().getSymbolIterator(destStart, true);
|
SymbolIterator symIter = program.getSymbolTable().getSymbolIterator(destStart, true);
|
||||||
while (symIter.hasNext()) {
|
while (symIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Symbol sym = symIter.next();
|
Symbol sym = symIter.next();
|
||||||
if (sym.getAddress().compareTo(destEnd) > 0) {
|
if (sym.getAddress().compareTo(destEnd) > 0) {
|
||||||
break;
|
break;
|
||||||
@ -118,7 +117,7 @@ public class MoveMemoryRangeContents extends GhidraScript {
|
|||||||
Address srcAddr = srcStart;
|
Address srcAddr = srcStart;
|
||||||
Address destAddr = destStart;
|
Address destAddr = destStart;
|
||||||
while (true) {
|
while (true) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
int cnt = program.getMemory().getBytes(srcAddr, bytes, 0, Math.min(len, bytes.length));
|
int cnt = program.getMemory().getBytes(srcAddr, bytes, 0, Math.min(len, bytes.length));
|
||||||
currentProgram.getMemory().setBytes(destAddr, bytes, 0, cnt);
|
currentProgram.getMemory().setBytes(destAddr, bytes, 0, cnt);
|
||||||
len -= cnt;
|
len -= cnt;
|
||||||
|
@ -55,7 +55,7 @@ public class AssociateExternalPELibrariesScript extends GhidraScript {
|
|||||||
String[] externalLibraryNames = externalManager.getExternalLibraryNames();
|
String[] externalLibraryNames = externalManager.getExternalLibraryNames();
|
||||||
|
|
||||||
for (String name : externalLibraryNames) {
|
for (String name : externalLibraryNames) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
List<DomainFile> ciLibraries = getProgramsCaseInsensitive(name, libraries);
|
List<DomainFile> ciLibraries = getProgramsCaseInsensitive(name, libraries);
|
||||||
if (ciLibraries.isEmpty()) {
|
if (ciLibraries.isEmpty()) {
|
||||||
@ -83,7 +83,7 @@ public class AssociateExternalPELibrariesScript extends GhidraScript {
|
|||||||
List<DomainFile> matchingFiles = new ArrayList<DomainFile>();
|
List<DomainFile> matchingFiles = new ArrayList<DomainFile>();
|
||||||
|
|
||||||
for (DomainFile file : projectFiles) {
|
for (DomainFile file : projectFiles) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (!file.getName().equalsIgnoreCase(name)) {
|
if (!file.getName().equalsIgnoreCase(name)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -42,7 +42,7 @@ public class CallotherCensusScript extends GhidraScript {
|
|||||||
|
|
||||||
InstructionIterator instIter = currentProgram.getListing().getInstructions(true);
|
InstructionIterator instIter = currentProgram.getListing().getInstructions(true);
|
||||||
while (instIter.hasNext()) {
|
while (instIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Instruction inst = instIter.next();
|
Instruction inst = instIter.next();
|
||||||
for (PcodeOp op : inst.getPcode()) {
|
for (PcodeOp op : inst.getPcode()) {
|
||||||
if (op.getOpcode() == PcodeOp.CALLOTHER) {
|
if (op.getOpcode() == PcodeOp.CALLOTHER) {
|
||||||
|
@ -83,7 +83,7 @@ public class CreateHelpTemplateScript extends GhidraScript {
|
|||||||
printWriter.println("<blockquote>");
|
printWriter.println("<blockquote>");
|
||||||
List<DockingActionIf> actions = getActions(tool, plugin);
|
List<DockingActionIf> actions = getActions(tool, plugin);
|
||||||
for (DockingActionIf action : actions) {
|
for (DockingActionIf action : actions) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
printWriter.println("\t" + "<h3><A name=\"" + action.getName().replace(' ', '_') +
|
printWriter.println("\t" + "<h3><A name=\"" + action.getName().replace(' ', '_') +
|
||||||
"\"></A>" + action.getName() + "</h3>");
|
"\"></A>" + action.getName() + "</h3>");
|
||||||
printWriter.println("\t\t" + "<blockquote>");
|
printWriter.println("\t\t" + "<blockquote>");
|
||||||
|
@ -56,7 +56,7 @@ public class CreateRelocationBasedOperandReferences extends GhidraScript {
|
|||||||
int refCount = 0;
|
int refCount = 0;
|
||||||
|
|
||||||
while (relocations.hasNext()) {
|
while (relocations.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Relocation r = relocations.next();
|
Relocation r = relocations.next();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public class EditBytesScript extends GhidraScript {
|
|||||||
boolean containedInBlock = false;
|
boolean containedInBlock = false;
|
||||||
|
|
||||||
while (containedInBlock == false) {
|
while (containedInBlock == false) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
newBytes = askBytes("Replace Bytes", "Replace bytes at cursor with:");
|
newBytes = askBytes("Replace Bytes", "Replace bytes at cursor with:");
|
||||||
endAddr = currentLocation.getByteAddress().add(newBytes.length - 1);
|
endAddr = currentLocation.getByteAddress().add(newBytes.length - 1);
|
||||||
activeAddr = currentLocation.getByteAddress();
|
activeAddr = currentLocation.getByteAddress();
|
||||||
|
@ -57,7 +57,7 @@ public class ExportProgramScript extends GhidraScript {
|
|||||||
RelocationTable relocTable = currentProgram.getRelocationTable();
|
RelocationTable relocTable = currentProgram.getRelocationTable();
|
||||||
Iterator<Relocation> iter = relocTable.getRelocations();
|
Iterator<Relocation> iter = relocTable.getRelocations();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Relocation reloc = iter.next();
|
Relocation reloc = iter.next();
|
||||||
Address relocStart = reloc.getAddress();
|
Address relocStart = reloc.getAddress();
|
||||||
@ -102,7 +102,7 @@ public class ExportProgramScript extends GhidraScript {
|
|||||||
// the original
|
// the original
|
||||||
for (long i = 0; i < size; i++) {
|
for (long i = 0; i < size; i++) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
byte originalByte = fileBytes.getOriginalByte(i);
|
byte originalByte = fileBytes.getOriginalByte(i);
|
||||||
byte currentByte = fileBytes.getModifiedByte(i);
|
byte currentByte = fileBytes.getModifiedByte(i);
|
||||||
@ -158,7 +158,7 @@ public class ExportProgramScript extends GhidraScript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Address address : list) {
|
for (Address address : list) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (set.contains(address)) {
|
if (set.contains(address)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public class ExtractELFDebugFilesScript extends GhidraScript {
|
|||||||
void processDir(GFile dir, File destDir) throws IOException, CancelledException {
|
void processDir(GFile dir, File destDir) throws IOException, CancelledException {
|
||||||
List<GFile> listing = dir.getListing();
|
List<GFile> listing = dir.getListing();
|
||||||
for (GFile file : listing) {
|
for (GFile file : listing) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ public class ExtractELFDebugFilesScript extends GhidraScript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (GFile file : listing) {
|
for (GFile file : listing) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
processDir(file, destDir);
|
processDir(file, destDir);
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
String newCategoryName = new String();
|
String newCategoryName = new String();
|
||||||
while (index < categoryName.length()) {
|
while (index < categoryName.length()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (categoryName.substring(index).startsWith("::") && !insideBrackets) {
|
if (categoryName.substring(index).startsWith("::") && !insideBrackets) {
|
||||||
newCategoryName = newCategoryName.concat("/");
|
newCategoryName = newCategoryName.concat("/");
|
||||||
@ -453,7 +453,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
SymbolIterator symbols = symbolTable.getSymbolIterator("*" + string1 + "*", true);
|
SymbolIterator symbols = symbolTable.getSymbolIterator("*" + string1 + "*", true);
|
||||||
|
|
||||||
while (symbols.hasNext()) {
|
while (symbols.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Symbol symbol = symbols.next();
|
Symbol symbol = symbols.next();
|
||||||
Address symbolAddress = symbol.getAddress();
|
Address symbolAddress = symbol.getAddress();
|
||||||
|
|
||||||
@ -483,7 +483,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
|
|
||||||
SymbolIterator symbols = symbolTable.getSymbols(symbolName);
|
SymbolIterator symbols = symbolTable.getSymbols(symbolName);
|
||||||
while (symbols.hasNext()) {
|
while (symbols.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Symbol symbol = symbols.next();
|
Symbol symbol = symbols.next();
|
||||||
if (symbol.getParentNamespace().getName().equals(namespaceName)) {
|
if (symbol.getParentNamespace().getName().equals(namespaceName)) {
|
||||||
Namespace namespace = symbol.getParentNamespace();
|
Namespace namespace = symbol.getParentNamespace();
|
||||||
@ -519,7 +519,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
Iterator<Symbol> typeinfoIterator = typeinfoSymbols.iterator();
|
Iterator<Symbol> typeinfoIterator = typeinfoSymbols.iterator();
|
||||||
while (typeinfoIterator.hasNext()) {
|
while (typeinfoIterator.hasNext()) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Symbol typeinfoSymbol = typeinfoIterator.next();
|
Symbol typeinfoSymbol = typeinfoIterator.next();
|
||||||
Address typeinfoAddress = typeinfoSymbol.getAddress();
|
Address typeinfoAddress = typeinfoSymbol.getAddress();
|
||||||
@ -696,7 +696,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
Iterator<Symbol> vtableIterator = listOfVtableSymbols.iterator();
|
Iterator<Symbol> vtableIterator = listOfVtableSymbols.iterator();
|
||||||
while (vtableIterator.hasNext()) {
|
while (vtableIterator.hasNext()) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Symbol vtableSymbol = vtableIterator.next();
|
Symbol vtableSymbol = vtableIterator.next();
|
||||||
Namespace vtableNamespace = vtableSymbol.getParentNamespace();
|
Namespace vtableNamespace = vtableSymbol.getParentNamespace();
|
||||||
@ -949,7 +949,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
try {
|
try {
|
||||||
while (index < numZeros) {
|
while (index < numZeros) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (getByte(address.add(index)) != 0x00) {
|
if (getByte(address.add(index)) != 0x00) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1220,7 +1220,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
SymbolIterator symbols = symbolTable.getSymbols(addressSet, SymbolType.LABEL, true);
|
SymbolIterator symbols = symbolTable.getSymbols(addressSet, SymbolType.LABEL, true);
|
||||||
|
|
||||||
while (symbols.hasNext()) {
|
while (symbols.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Symbol symbol = symbols.next();
|
Symbol symbol = symbols.next();
|
||||||
if (exact && symbol.getName().equals(symbolName)) {
|
if (exact && symbol.getName().equals(symbolName)) {
|
||||||
symbolsInSet.add(symbol);
|
symbolsInSet.add(symbol);
|
||||||
|
@ -81,10 +81,10 @@ public class GraphClassesScript extends GhidraScript {
|
|||||||
private void getClassStructures(Category[] categories) throws CancelledException {
|
private void getClassStructures(Category[] categories) throws CancelledException {
|
||||||
|
|
||||||
for (Category category : categories) {
|
for (Category category : categories) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
DataType[] dataTypes = category.getDataTypes();
|
DataType[] dataTypes = category.getDataTypes();
|
||||||
for (DataType dataType : dataTypes) {
|
for (DataType dataType : dataTypes) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (dataType.getName().equals(category.getName()) &&
|
if (dataType.getName().equals(category.getName()) &&
|
||||||
dataType instanceof Structure) {
|
dataType instanceof Structure) {
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ public class GraphClassesScript extends GhidraScript {
|
|||||||
|
|
||||||
for (Structure classStructure : classStructures) {
|
for (Structure classStructure : classStructures) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
String description = classStructure.getDescription();
|
String description = classStructure.getDescription();
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ public class GraphClassesScript extends GhidraScript {
|
|||||||
DataTypeComponent[] components = childStructure.getComponents();
|
DataTypeComponent[] components = childStructure.getComponents();
|
||||||
for (DataTypeComponent component : components) {
|
for (DataTypeComponent component : components) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
DataType componentDataType = component.getDataType();
|
DataType componentDataType = component.getDataType();
|
||||||
if (componentDataType instanceof Structure &&
|
if (componentDataType instanceof Structure &&
|
||||||
componentDataType.getName().equals(parentName)) {
|
componentDataType.getName().equals(parentName)) {
|
||||||
@ -291,7 +291,7 @@ public class GraphClassesScript extends GhidraScript {
|
|||||||
|
|
||||||
List<Structure> parentStructures = new ArrayList<>();
|
List<Structure> parentStructures = new ArrayList<>();
|
||||||
for (Structure classStructure : classStructures) {
|
for (Structure classStructure : classStructures) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (classStructure.getName().equals(parentName)) {
|
if (classStructure.getName().equals(parentName)) {
|
||||||
parentStructures.add(classStructure);
|
parentStructures.add(classStructure);
|
||||||
|
@ -43,7 +43,7 @@ public class MarkCallOtherPcode extends GhidraScript {
|
|||||||
|
|
||||||
InstructionIterator instructions = currentProgram.getListing().getInstructions(set, true);
|
InstructionIterator instructions = currentProgram.getListing().getInstructions(set, true);
|
||||||
while (instructions.hasNext()) {
|
while (instructions.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Instruction instr = instructions.next();
|
Instruction instr = instructions.next();
|
||||||
|
|
||||||
PcodeOp[] pcode = instr.getPcode();
|
PcodeOp[] pcode = instr.getPcode();
|
||||||
|
@ -42,7 +42,7 @@ public class MarkUnimplementedPcode extends GhidraScript {
|
|||||||
|
|
||||||
InstructionIterator instructions = currentProgram.getListing().getInstructions(set, true);
|
InstructionIterator instructions = currentProgram.getListing().getInstructions(set, true);
|
||||||
while (instructions.hasNext()) {
|
while (instructions.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Instruction instr = instructions.next();
|
Instruction instr = instructions.next();
|
||||||
|
|
||||||
PcodeOp[] pcode = instr.getPcode();
|
PcodeOp[] pcode = instr.getPcode();
|
||||||
|
@ -30,7 +30,7 @@ public class ProgressExampleScript extends GhidraScript {
|
|||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
// Note: any script wishing to be responsive to a cancellation from the GUI needs to
|
// Note: any script wishing to be responsive to a cancellation from the GUI needs to
|
||||||
// call checkCancelled()
|
// call checkCancelled()
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Thread.sleep(1000); // pause a bit so we can see progress
|
Thread.sleep(1000); // pause a bit so we can see progress
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ public class PropagateX86ConstantReferences extends GhidraScript {
|
|||||||
tableSizeMax = 64;
|
tableSizeMax = 64;
|
||||||
tableIndexOffset = 0;
|
tableIndexOffset = 0;
|
||||||
for (long assume = 0; assume < tableSizeMax; assume++) {
|
for (long assume = 0; assume < tableSizeMax; assume++) {
|
||||||
assumeValue = new Long(assume);
|
assumeValue = Long.valueOf(assume);
|
||||||
hitTheGuard = false;
|
hitTheGuard = false;
|
||||||
|
|
||||||
symEval.flowConstants(branchSet.getMinAddress(), branchSet, eval, false,
|
symEval.flowConstants(branchSet.getMinAddress(), branchSet, eval, false,
|
||||||
|
@ -88,7 +88,7 @@ public class RemoveUserCheckoutsScript extends GhidraScript {
|
|||||||
private int removeCheckouts(RepositoryAdapter repository, String folderPath, String uid, TaskMonitor monitor) throws IOException, CancelledException {
|
private int removeCheckouts(RepositoryAdapter repository, String folderPath, String uid, TaskMonitor monitor) throws IOException, CancelledException {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (RepositoryItem item : repository.getItemList(folderPath)) {
|
for (RepositoryItem item : repository.getItemList(folderPath)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
count += removeCheckouts(repository, item, uid);
|
count += removeCheckouts(repository, item, uid);
|
||||||
}
|
}
|
||||||
for (String subfolder : repository.getSubfolderList(folderPath)) {
|
for (String subfolder : repository.getSubfolderList(folderPath)) {
|
||||||
|
@ -104,11 +104,11 @@ public class RepositoryFileUpgradeScript extends GhidraScript {
|
|||||||
private int listCheckouts(DomainFolder folder) throws IOException, CancelledException {
|
private int listCheckouts(DomainFolder folder) throws IOException, CancelledException {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (DomainFile df : folder.getFiles()) {
|
for (DomainFile df : folder.getFiles()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
count += listCheckouts(df);
|
count += listCheckouts(df);
|
||||||
}
|
}
|
||||||
for (DomainFolder subfolder : folder.getFolders()) {
|
for (DomainFolder subfolder : folder.getFolders()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
count += listCheckouts(subfolder);
|
count += listCheckouts(subfolder);
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
@ -130,13 +130,13 @@ public class RepositoryFileUpgradeScript extends GhidraScript {
|
|||||||
private int performProgramUpgrades(DomainFolder folder) throws IOException, CancelledException {
|
private int performProgramUpgrades(DomainFolder folder) throws IOException, CancelledException {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (DomainFile df : folder.getFiles()) {
|
for (DomainFile df : folder.getFiles()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (performProgramUpgrade(df)) {
|
if (performProgramUpgrade(df)) {
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (DomainFolder subfolder : folder.getFolders()) {
|
for (DomainFolder subfolder : folder.getFolders()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
count += performProgramUpgrades(subfolder);
|
count += performProgramUpgrades(subfolder);
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
|
@ -250,7 +250,7 @@ public class ResolveX86orX64LinuxSyscallsScript extends GhidraScript {
|
|||||||
TaskMonitor tMonitor) throws CancelledException {
|
TaskMonitor tMonitor) throws CancelledException {
|
||||||
Map<Function, Set<Address>> funcsToCalls = new HashMap<>();
|
Map<Function, Set<Address>> funcsToCalls = new HashMap<>();
|
||||||
for (Function func : program.getFunctionManager().getFunctionsNoStubs(true)) {
|
for (Function func : program.getFunctionManager().getFunctionsNoStubs(true)) {
|
||||||
tMonitor.checkCanceled();
|
tMonitor.checkCancelled();
|
||||||
for (Instruction inst : program.getListing().getInstructions(func.getBody(), true)) {
|
for (Instruction inst : program.getListing().getInstructions(func.getBody(), true)) {
|
||||||
if (tester.test(inst)) {
|
if (tester.test(inst)) {
|
||||||
Set<Address> callSites = funcsToCalls.get(func);
|
Set<Address> callSites = funcsToCalls.get(func);
|
||||||
|
@ -430,7 +430,7 @@ public class SearchBaseExtended extends GhidraScript {
|
|||||||
private boolean containsOnBit(byte[] array) {
|
private boolean containsOnBit(byte[] array) {
|
||||||
|
|
||||||
for (byte element : array) {
|
for (byte element : array) {
|
||||||
Byte temp = new Byte(element);
|
Byte temp = Byte.valueOf(element);
|
||||||
int value = temp.intValue();
|
int value = temp.intValue();
|
||||||
if (value != 0) {
|
if (value != 0) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -63,7 +63,7 @@ public class SearchForImageBaseOffsets extends GhidraScript {
|
|||||||
byte byteArray[] = new byte[numBytes];
|
byte byteArray[] = new byte[numBytes];
|
||||||
|
|
||||||
for (int i = 0; i < numBytes; i++) {
|
for (int i = 0; i < numBytes; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
byteArray[i] = (byte) (value >> (8 * i) & 0xff);
|
byteArray[i] = (byte) (value >> (8 * i) & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ public class SearchForImageBaseOffsets extends GhidraScript {
|
|||||||
Address start = currentProgram.getMinAddress();
|
Address start = currentProgram.getMinAddress();
|
||||||
Address found = find(start, byteArray);
|
Address found = find(start, byteArray);
|
||||||
while (found != null) {
|
while (found != null) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
println(found.toString());
|
println(found.toString());
|
||||||
start = found.add(1);
|
start = found.add(1);
|
||||||
found = find(start, byteArray);
|
found = find(start, byteArray);
|
||||||
|
@ -102,7 +102,7 @@ public class SearchForImageBaseOffsetsScript extends GhidraScript {
|
|||||||
byte byteArray[] = new byte[numBytes];
|
byte byteArray[] = new byte[numBytes];
|
||||||
|
|
||||||
for (int i = 0; i < numBytes; i++) {
|
for (int i = 0; i < numBytes; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
byteArray[i] = (byte) (value >> (BITS_PER_BYTE * i) & BYTE_MASK);
|
byteArray[i] = (byte) (value >> (BITS_PER_BYTE * i) & BYTE_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ public class SearchForImageBaseOffsetsScript extends GhidraScript {
|
|||||||
byte byteArray[] = new byte[numBytes];
|
byte byteArray[] = new byte[numBytes];
|
||||||
|
|
||||||
for (int i = 0; i < numBytes; i++) {
|
for (int i = 0; i < numBytes; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
byteArray[i] = (byte) (value >> (8 * (numBytes - (i + 1))) & 0xff);
|
byteArray[i] = (byte) (value >> (8 * (numBytes - (i + 1))) & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ public class SearchForImageBaseOffsetsScript extends GhidraScript {
|
|||||||
Address start = currentProgram.getMinAddress();
|
Address start = currentProgram.getMinAddress();
|
||||||
Address found = find(start, byteArray);
|
Address found = find(start, byteArray);
|
||||||
while (found != null) {
|
while (found != null) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
addressSet.add(found);
|
addressSet.add(found);
|
||||||
start = found.add(1);
|
start = found.add(1);
|
||||||
found = find(start, byteArray);
|
found = find(start, byteArray);
|
||||||
@ -153,7 +153,7 @@ public class SearchForImageBaseOffsetsScript extends GhidraScript {
|
|||||||
|
|
||||||
AddressIterator addresses = addressSet.getAddresses(true);
|
AddressIterator addresses = addressSet.getAddresses(true);
|
||||||
while (addresses.hasNext()) {
|
while (addresses.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address address = addresses.next();
|
Address address = addresses.next();
|
||||||
println(address.toString());
|
println(address.toString());
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
|
|
||||||
ElfSectionHeader[] stringSections = elf.getSections(ElfSectionHeaderConstants.SHT_STRTAB);
|
ElfSectionHeader[] stringSections = elf.getSections(ElfSectionHeaderConstants.SHT_STRTAB);
|
||||||
for (ElfSectionHeader stringSection : stringSections) {
|
for (ElfSectionHeader stringSection : stringSections) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
try {
|
try {
|
||||||
Address addr = addr(stringSection.getOffset());
|
Address addr = addr(stringSection.getOffset());
|
||||||
Address maxAddr = addr.addNoWrap(stringSection.getSize() - 1);
|
Address maxAddr = addr.addNoWrap(stringSection.getSize() - 1);
|
||||||
@ -176,7 +176,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
private void processSectionHeaders(ElfHeader elf, Listing listing) throws Exception {
|
private void processSectionHeaders(ElfHeader elf, Listing listing) throws Exception {
|
||||||
ElfSectionHeader[] sections = elf.getSections();
|
ElfSectionHeader[] sections = elf.getSections();
|
||||||
for (int i = 0; i < sections.length; i++) {
|
for (int i = 0; i < sections.length; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
String name = sections[i].getNameAsString();
|
String name = sections[i].getNameAsString();
|
||||||
|
|
||||||
DataType sectionDT = sections[i].toDataType();
|
DataType sectionDT = sections[i].toDataType();
|
||||||
@ -229,7 +229,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
|
|
||||||
ElfProgramHeader[] programHeaders = elf.getProgramHeaders();
|
ElfProgramHeader[] programHeaders = elf.getProgramHeaders();
|
||||||
for (int i = 0; i < programHeaders.length; i++) {
|
for (int i = 0; i < programHeaders.length; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Data d = array.getComponent(i);
|
Data d = array.getComponent(i);
|
||||||
d.setComment(CodeUnit.EOL_COMMENT, programHeaders[i].getComment());
|
d.setComment(CodeUnit.EOL_COMMENT, programHeaders[i].getComment());
|
||||||
|
|
||||||
@ -243,7 +243,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
for (ElfProgramHeader programHeader : elf.getProgramHeaders(
|
for (ElfProgramHeader programHeader : elf.getProgramHeaders(
|
||||||
ElfProgramHeaderConstants.PT_INTERP)) {
|
ElfProgramHeaderConstants.PT_INTERP)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long offset = programHeader.getOffset();
|
long offset = programHeader.getOffset();
|
||||||
if (offset == 0) {
|
if (offset == 0) {
|
||||||
Msg.warn(this, " Dynamic table appears to have been stripped from binary");
|
Msg.warn(this, " Dynamic table appears to have been stripped from binary");
|
||||||
@ -281,7 +281,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
BinaryReader reader = new BinaryReader(provider, !program.getMemory().isBigEndian());
|
BinaryReader reader = new BinaryReader(provider, !program.getMemory().isBigEndian());
|
||||||
|
|
||||||
for (int i = 0; i < dynamics.length; i++) {
|
for (int i = 0; i < dynamics.length; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Data dynamicData = dynamicTableData.getComponent(i);
|
Data dynamicData = dynamicTableData.getComponent(i);
|
||||||
if (dynamicData == null) {
|
if (dynamicData == null) {
|
||||||
@ -360,7 +360,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
|
|
||||||
ElfSymbolTable[] symbolTables = elf.getSymbolTables();
|
ElfSymbolTable[] symbolTables = elf.getSymbolTables();
|
||||||
for (ElfSymbolTable symbolTable2 : symbolTables) {
|
for (ElfSymbolTable symbolTable2 : symbolTables) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Address symbolTableAddr = addr(symbolTable2.getFileOffset());
|
Address symbolTableAddr = addr(symbolTable2.getFileOffset());
|
||||||
|
|
||||||
@ -406,7 +406,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
monitor.setMessage("Processing relocation tables...");
|
monitor.setMessage("Processing relocation tables...");
|
||||||
ElfRelocationTable[] relocationTables = elf.getRelocationTables();
|
ElfRelocationTable[] relocationTables = elf.getRelocationTables();
|
||||||
for (ElfRelocationTable relocationTable : relocationTables) {
|
for (ElfRelocationTable relocationTable : relocationTables) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
ElfSectionHeader relocationSection = relocationTable.getTableSectionHeader();
|
ElfSectionHeader relocationSection = relocationTable.getTableSectionHeader();
|
||||||
String relocSectionName = "<section-not-found>";
|
String relocSectionName = "<section-not-found>";
|
||||||
if (relocationSection != null) {
|
if (relocationSection != null) {
|
||||||
|
@ -189,7 +189,7 @@ public class ApplyFunctionDataTypesCmd extends BackgroundCommand {
|
|||||||
|
|
||||||
monitor.initialize(functionNameMap.size());
|
monitor.initialize(functionNameMap.size());
|
||||||
for (String functionName : functionNameMap.keySet()) {
|
for (String functionName : functionNameMap.keySet()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
FunctionDefinition fdef = functionNameMap.get(functionName);
|
FunctionDefinition fdef = functionNameMap.get(functionName);
|
||||||
checkForSymbol(monitor, functionName, fdef, symbolMap, null);
|
checkForSymbol(monitor, functionName, fdef, symbolMap, null);
|
||||||
@ -205,10 +205,10 @@ public class ApplyFunctionDataTypesCmd extends BackgroundCommand {
|
|||||||
private void collectFunctionDefinitions(Category cat, TaskMonitor monitor,
|
private void collectFunctionDefinitions(Category cat, TaskMonitor monitor,
|
||||||
Map<String, FunctionDefinition> functionNameMap) throws CancelledException {
|
Map<String, FunctionDefinition> functionNameMap) throws CancelledException {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
for (DataType dt : cat.getDataTypes()) {
|
for (DataType dt : cat.getDataTypes()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (!(dt instanceof FunctionDefinition)) {
|
if (!(dt instanceof FunctionDefinition)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ public class CaptureFunctionDataTypesCmd extends BackgroundCommand {
|
|||||||
FunctionManager functionManager = program.getFunctionManager();
|
FunctionManager functionManager = program.getFunctionManager();
|
||||||
FunctionIterator functions = functionManager.getFunctions(set, true);
|
FunctionIterator functions = functionManager.getFunctions(set, true);
|
||||||
while (functions.hasNext()) {
|
while (functions.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function function = functions.next();
|
Function function = functions.next();
|
||||||
FunctionSignature signature = function.getSignature(true);
|
FunctionSignature signature = function.getSignature(true);
|
||||||
FunctionDefinitionDataType functionDef =
|
FunctionDefinitionDataType functionDef =
|
||||||
|
@ -409,7 +409,7 @@ public class CreateFunctionCmd extends BackgroundCommand {
|
|||||||
throws CancelledException, OverlappingFunctionException {
|
throws CancelledException, OverlappingFunctionException {
|
||||||
Iterator<Function> iter = program.getFunctionManager().getFunctionsOverlapping(body);
|
Iterator<Function> iter = program.getFunctionManager().getFunctionsOverlapping(body);
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function elem = iter.next();
|
Function elem = iter.next();
|
||||||
AddressSetView funcBody = elem.getBody();
|
AddressSetView funcBody = elem.getBody();
|
||||||
if (funcBody.contains(entry)) {
|
if (funcBody.contains(entry)) {
|
||||||
@ -440,7 +440,7 @@ public class CreateFunctionCmd extends BackgroundCommand {
|
|||||||
TaskMonitor monitor) throws CancelledException {
|
TaskMonitor monitor) throws CancelledException {
|
||||||
Iterator<Function> iter = program.getFunctionManager().getFunctionsOverlapping(body);
|
Iterator<Function> iter = program.getFunctionManager().getFunctionsOverlapping(body);
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function elem = iter.next();
|
Function elem = iter.next();
|
||||||
if (elem.getEntryPoint().equals(entry)) {
|
if (elem.getEntryPoint().equals(entry)) {
|
||||||
// if finding the entrypoint, need to redefine the functions body.
|
// if finding the entrypoint, need to redefine the functions body.
|
||||||
@ -705,7 +705,7 @@ public class CreateFunctionCmd extends BackgroundCommand {
|
|||||||
Iterator<Function> iter = program.getFunctionManager().getFunctionsOverlapping(newBody);
|
Iterator<Function> iter = program.getFunctionManager().getFunctionsOverlapping(newBody);
|
||||||
|
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function elem = iter.next();
|
Function elem = iter.next();
|
||||||
if (elem.getEntryPoint().equals(entry)) {
|
if (elem.getEntryPoint().equals(entry)) {
|
||||||
// if finding the entrypoint, need to redefine the functions body.
|
// if finding the entrypoint, need to redefine the functions body.
|
||||||
|
@ -129,7 +129,7 @@ public class FunctionResultStateStackAnalysisCmd extends BackgroundCommand {
|
|||||||
ArrayList<Function> funcList = new ArrayList<Function>(); // list of functions needing stack frames created
|
ArrayList<Function> funcList = new ArrayList<Function>(); // list of functions needing stack frames created
|
||||||
stack.push(f);
|
stack.push(f);
|
||||||
while (!stack.isEmpty()) {
|
while (!stack.isEmpty()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function func = stack.pop();
|
Function func = stack.pop();
|
||||||
// if the purge for the function is unknown, it has not been looked at yet.
|
// if the purge for the function is unknown, it has not been looked at yet.
|
||||||
// we need to add it to the list to analyze its stack frame.
|
// we need to add it to the list to analyze its stack frame.
|
||||||
@ -139,7 +139,7 @@ public class FunctionResultStateStackAnalysisCmd extends BackgroundCommand {
|
|||||||
AddressIterator iter =
|
AddressIterator iter =
|
||||||
program.getReferenceManager().getReferenceSourceIterator(func.getBody(), true);
|
program.getReferenceManager().getReferenceSourceIterator(func.getBody(), true);
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address fromAddr = iter.next();
|
Address fromAddr = iter.next();
|
||||||
Reference refs[] =
|
Reference refs[] =
|
||||||
program.getReferenceManager().getFlowReferencesFrom(fromAddr);
|
program.getReferenceManager().getFlowReferencesFrom(fromAddr);
|
||||||
@ -174,7 +174,7 @@ public class FunctionResultStateStackAnalysisCmd extends BackgroundCommand {
|
|||||||
int default_stackshift = defaultModel.getStackshift();
|
int default_stackshift = defaultModel.getStackshift();
|
||||||
|
|
||||||
while (!funcList.isEmpty()) {
|
while (!funcList.isEmpty()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function func = funcList.remove(0);
|
Function func = funcList.remove(0);
|
||||||
monitor.setMessage("Stack " + func.getName());
|
monitor.setMessage("Stack " + func.getName());
|
||||||
|
|
||||||
@ -385,7 +385,7 @@ public class FunctionResultStateStackAnalysisCmd extends BackgroundCommand {
|
|||||||
VarnodeOperation vop = (VarnodeOperation) exp;
|
VarnodeOperation vop = (VarnodeOperation) exp;
|
||||||
Varnode[] inputValues = vop.getInputValues();
|
Varnode[] inputValues = vop.getInputValues();
|
||||||
for (int i = 0; i < inputValues.length; i++) {
|
for (int i = 0; i < inputValues.length; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (vn.equals(inputValues[i])) {
|
if (vn.equals(inputValues[i])) {
|
||||||
inputValues[i] = value;
|
inputValues[i] = value;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -140,7 +139,7 @@ public class FunctionStackAnalysisCmd extends BackgroundCommand {
|
|||||||
ArrayList<Function> funcList = new ArrayList<Function>(); // list of functions needing stack frames created
|
ArrayList<Function> funcList = new ArrayList<Function>(); // list of functions needing stack frames created
|
||||||
stack.push(f);
|
stack.push(f);
|
||||||
while (!stack.isEmpty()) {
|
while (!stack.isEmpty()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function func = stack.pop();
|
Function func = stack.pop();
|
||||||
if (func.isThunk()) {
|
if (func.isThunk()) {
|
||||||
continue;
|
continue;
|
||||||
@ -163,7 +162,7 @@ public class FunctionStackAnalysisCmd extends BackgroundCommand {
|
|||||||
// int default_purge = program.getCompilerSpec().getCallStackMod();
|
// int default_purge = program.getCompilerSpec().getCallStackMod();
|
||||||
// int default_stackshift = program.getCompilerSpec().getCallStackShift();
|
// int default_stackshift = program.getCompilerSpec().getCallStackShift();
|
||||||
while (!funcList.isEmpty()) {
|
while (!funcList.isEmpty()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function func = funcList.remove(0);
|
Function func = funcList.remove(0);
|
||||||
SourceType oldSignatureSource = func.getSignatureSource();
|
SourceType oldSignatureSource = func.getSignatureSource();
|
||||||
|
|
||||||
@ -218,7 +217,7 @@ public class FunctionStackAnalysisCmd extends BackgroundCommand {
|
|||||||
|
|
||||||
InstructionIterator iter = program.getListing().getInstructions(func.getBody(), true);
|
InstructionIterator iter = program.getListing().getInstructions(func.getBody(), true);
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Instruction instr = iter.next();
|
Instruction instr = iter.next();
|
||||||
|
|
||||||
// process any stack pointer references
|
// process any stack pointer references
|
||||||
|
@ -149,7 +149,7 @@ public class NewFunctionStackAnalysisCmd extends BackgroundCommand {
|
|||||||
ArrayList<Function> funcList = new ArrayList<>(); // list of functions needing stack frames created
|
ArrayList<Function> funcList = new ArrayList<>(); // list of functions needing stack frames created
|
||||||
stack.push(f);
|
stack.push(f);
|
||||||
while (!stack.isEmpty()) {
|
while (!stack.isEmpty()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function func = stack.pop();
|
Function func = stack.pop();
|
||||||
if (func.isThunk()) {
|
if (func.isThunk()) {
|
||||||
continue;
|
continue;
|
||||||
@ -183,7 +183,7 @@ public class NewFunctionStackAnalysisCmd extends BackgroundCommand {
|
|||||||
// Process all the functions identified as needing stack analysis.
|
// Process all the functions identified as needing stack analysis.
|
||||||
// The list will have the lowest level functions analyzed first.
|
// The list will have the lowest level functions analyzed first.
|
||||||
while (!funcList.isEmpty()) {
|
while (!funcList.isEmpty()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function func = funcList.remove(0);
|
Function func = funcList.remove(0);
|
||||||
SourceType oldSignatureSource = func.getSignatureSource();
|
SourceType oldSignatureSource = func.getSignatureSource();
|
||||||
|
|
||||||
@ -742,7 +742,7 @@ public class NewFunctionStackAnalysisCmd extends BackgroundCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Variable getVariableContaining(int offset, List<Variable> sortedVariables) {
|
private Variable getVariableContaining(int offset, List<Variable> sortedVariables) {
|
||||||
Object key = new Integer(offset);
|
Object key = Integer.valueOf(offset);
|
||||||
int index = Collections.binarySearch(sortedVariables, key, StackVariableComparator.get());
|
int index = Collections.binarySearch(sortedVariables, key, StackVariableComparator.get());
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
return sortedVariables.get(index);
|
return sortedVariables.get(index);
|
||||||
@ -773,7 +773,7 @@ public class NewFunctionStackAnalysisCmd extends BackgroundCommand {
|
|||||||
* @param sortedVariables
|
* @param sortedVariables
|
||||||
*/
|
*/
|
||||||
private void addVariableToSortedList(Variable var, List<Variable> sortedVariables) {
|
private void addVariableToSortedList(Variable var, List<Variable> sortedVariables) {
|
||||||
int index = Collections.binarySearch(sortedVariables, new Integer(var.getStackOffset()),
|
int index = Collections.binarySearch(sortedVariables, Integer.valueOf(var.getStackOffset()),
|
||||||
StackVariableComparator.get());
|
StackVariableComparator.get());
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
throw new AssertException("Unexpected variable conflict");
|
throw new AssertException("Unexpected variable conflict");
|
||||||
|
@ -167,7 +167,7 @@ public abstract class AbstractModularizationCmd extends BackgroundCommand {
|
|||||||
|
|
||||||
CodeBlockReferenceIterator iterator = sourceBlock.getDestinations(monitor);
|
CodeBlockReferenceIterator iterator = sourceBlock.getDestinations(monitor);
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
CodeBlockReference destination = iterator.next();
|
CodeBlockReference destination = iterator.next();
|
||||||
CodeBlock targetBlock = getDestinationBlock(destination);
|
CodeBlock targetBlock = getDestinationBlock(destination);
|
||||||
|
@ -57,7 +57,7 @@ public class ComplexityDepthModularizationCmd extends AbstractModularizationCmd
|
|||||||
List<CodeBlockVertex> list = partition.get(i);
|
List<CodeBlockVertex> list = partition.get(i);
|
||||||
ProgramModule levelModule = createModule(destinationModule, "Level " + i);
|
ProgramModule levelModule = createModule(destinationModule, "Level " + i);
|
||||||
for (CodeBlockVertex v : list) {
|
for (CodeBlockVertex v : list) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
makeFragment(program, levelModule, v);
|
makeFragment(program, levelModule, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ public class DominanceModularizationCmd extends AbstractModularizationCmd {
|
|||||||
makeFragment(program, currentModule, vertex);
|
makeFragment(program, currentModule, vertex);
|
||||||
|
|
||||||
for (CodeBlockVertex child : children) {
|
for (CodeBlockVertex child : children) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
rebuildProgramTree(dg, child, currentModule);
|
rebuildProgramTree(dg, child, currentModule);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ public class ModuleAlgorithmCmd extends BackgroundCommand {
|
|||||||
parent.moveChild(newName, index);
|
parent.moveChild(newName, index);
|
||||||
}
|
}
|
||||||
while (cbi.hasNext()) {
|
while (cbi.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
CodeBlock cb = cbi.next();
|
CodeBlock cb = cbi.next();
|
||||||
monitor.setMessage("Processing code block @ " + cb.getMinAddress().toString(true));
|
monitor.setMessage("Processing code block @ " + cb.getMinAddress().toString(true));
|
||||||
ArrayList<CodeBlock> list = new ArrayList<CodeBlock>();
|
ArrayList<CodeBlock> list = new ArrayList<CodeBlock>();
|
||||||
@ -190,7 +190,7 @@ public class ModuleAlgorithmCmd extends BackgroundCommand {
|
|||||||
parentModule = module;
|
parentModule = module;
|
||||||
}
|
}
|
||||||
for (CodeBlock codeBlock : list) {
|
for (CodeBlock codeBlock : list) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
ProgramFragment fragment = createFragment(parentModule, codeBlock);
|
ProgramFragment fragment = createFragment(parentModule, codeBlock);
|
||||||
moveCodeUnits(fragment, codeBlock, monitor);
|
moveCodeUnits(fragment, codeBlock, monitor);
|
||||||
}
|
}
|
||||||
|
@ -271,7 +271,7 @@ public class DataTypeMergeManager implements MergeResolver {
|
|||||||
private void processSourceArchiveChanges() throws CancelledException {
|
private void processSourceArchiveChanges() throws CancelledException {
|
||||||
conflictOption = OPTION_MY;
|
conflictOption = OPTION_MY;
|
||||||
for (Long element : myArchiveChangeList) {
|
for (Long element : myArchiveChangeList) {
|
||||||
currentMonitor.checkCanceled();
|
currentMonitor.checkCancelled();
|
||||||
currentMonitor.setProgress(++progressIndex);
|
currentMonitor.setProgress(++progressIndex);
|
||||||
|
|
||||||
long id = element.longValue();
|
long id = element.longValue();
|
||||||
@ -321,7 +321,7 @@ public class DataTypeMergeManager implements MergeResolver {
|
|||||||
|
|
||||||
private void processSourceArchiveAdditions() throws CancelledException {
|
private void processSourceArchiveAdditions() throws CancelledException {
|
||||||
for (Long element : myArchiveAddedList) {
|
for (Long element : myArchiveAddedList) {
|
||||||
currentMonitor.checkCanceled();
|
currentMonitor.checkCancelled();
|
||||||
currentMonitor.setProgress(++progressIndex);
|
currentMonitor.setProgress(++progressIndex);
|
||||||
|
|
||||||
long id = element.longValue();
|
long id = element.longValue();
|
||||||
@ -384,7 +384,7 @@ public class DataTypeMergeManager implements MergeResolver {
|
|||||||
private void processSourceArchiveConflicts() throws CancelledException {
|
private void processSourceArchiveConflicts() throws CancelledException {
|
||||||
|
|
||||||
for (Long element : archiveConflictList) {
|
for (Long element : archiveConflictList) {
|
||||||
currentMonitor.checkCanceled();
|
currentMonitor.checkCancelled();
|
||||||
currentMonitor.setProgress(++progressIndex);
|
currentMonitor.setProgress(++progressIndex);
|
||||||
|
|
||||||
long sourceArchiveID = element.longValue();
|
long sourceArchiveID = element.longValue();
|
||||||
@ -415,7 +415,7 @@ public class DataTypeMergeManager implements MergeResolver {
|
|||||||
*/
|
*/
|
||||||
private void processCategoriesAdded() throws CancelledException {
|
private void processCategoriesAdded() throws CancelledException {
|
||||||
for (Long element : myCatAddedList) {
|
for (Long element : myCatAddedList) {
|
||||||
currentMonitor.checkCanceled();
|
currentMonitor.checkCancelled();
|
||||||
currentMonitor.setProgress(++progressIndex);
|
currentMonitor.setProgress(++progressIndex);
|
||||||
|
|
||||||
long id = element.longValue();
|
long id = element.longValue();
|
||||||
@ -435,7 +435,7 @@ public class DataTypeMergeManager implements MergeResolver {
|
|||||||
private void processCategoryConflicts() throws CancelledException {
|
private void processCategoryConflicts() throws CancelledException {
|
||||||
|
|
||||||
for (Long element : catConflictList) {
|
for (Long element : catConflictList) {
|
||||||
currentMonitor.checkCanceled();
|
currentMonitor.checkCancelled();
|
||||||
currentMonitor.setProgress(++progressIndex);
|
currentMonitor.setProgress(++progressIndex);
|
||||||
|
|
||||||
long id = element.longValue();
|
long id = element.longValue();
|
||||||
@ -463,7 +463,7 @@ public class DataTypeMergeManager implements MergeResolver {
|
|||||||
|
|
||||||
private void processCategoryChanges() throws CancelledException {
|
private void processCategoryChanges() throws CancelledException {
|
||||||
for (Long element : myCatChangeList) {
|
for (Long element : myCatChangeList) {
|
||||||
currentMonitor.checkCanceled();
|
currentMonitor.checkCancelled();
|
||||||
currentMonitor.setProgress(++progressIndex);
|
currentMonitor.setProgress(++progressIndex);
|
||||||
|
|
||||||
long id = element.longValue();
|
long id = element.longValue();
|
||||||
@ -476,7 +476,7 @@ public class DataTypeMergeManager implements MergeResolver {
|
|||||||
|
|
||||||
private void processCategoriesDeleted() throws CancelledException {
|
private void processCategoriesDeleted() throws CancelledException {
|
||||||
for (Long element : myCatChangeList) {
|
for (Long element : myCatChangeList) {
|
||||||
currentMonitor.checkCanceled();
|
currentMonitor.checkCancelled();
|
||||||
|
|
||||||
long id = element.longValue();
|
long id = element.longValue();
|
||||||
processCategoryDeleted(id);
|
processCategoryDeleted(id);
|
||||||
@ -485,7 +485,7 @@ public class DataTypeMergeManager implements MergeResolver {
|
|||||||
|
|
||||||
private void processDataTypeConflicts() throws CancelledException {
|
private void processDataTypeConflicts() throws CancelledException {
|
||||||
while (dtConflictList.size() > 0) {
|
while (dtConflictList.size() > 0) {
|
||||||
currentMonitor.checkCanceled();
|
currentMonitor.checkCancelled();
|
||||||
currentMonitor.setProgress(++progressIndex);
|
currentMonitor.setProgress(++progressIndex);
|
||||||
|
|
||||||
long id = dtConflictList.get(0).longValue();
|
long id = dtConflictList.get(0).longValue();
|
||||||
@ -1550,7 +1550,7 @@ public class DataTypeMergeManager implements MergeResolver {
|
|||||||
private void processDataTypeChanges() throws CancelledException {
|
private void processDataTypeChanges() throws CancelledException {
|
||||||
|
|
||||||
for (Long element : myDtChangeList) {
|
for (Long element : myDtChangeList) {
|
||||||
currentMonitor.checkCanceled();
|
currentMonitor.checkCancelled();
|
||||||
currentMonitor.setProgress(++progressIndex);
|
currentMonitor.setProgress(++progressIndex);
|
||||||
|
|
||||||
long id = element.longValue();
|
long id = element.longValue();
|
||||||
@ -2201,7 +2201,7 @@ public class DataTypeMergeManager implements MergeResolver {
|
|||||||
|
|
||||||
private void processDataTypesDeleted() throws CancelledException {
|
private void processDataTypesDeleted() throws CancelledException {
|
||||||
for (Long element : myDtChangeList) {
|
for (Long element : myDtChangeList) {
|
||||||
currentMonitor.checkCanceled();
|
currentMonitor.checkCancelled();
|
||||||
|
|
||||||
long id = element.longValue();
|
long id = element.longValue();
|
||||||
processDataTypeDeleted(id);
|
processDataTypeDeleted(id);
|
||||||
@ -2213,7 +2213,7 @@ public class DataTypeMergeManager implements MergeResolver {
|
|||||||
*/
|
*/
|
||||||
private void processDataTypesAdded() throws CancelledException {
|
private void processDataTypesAdded() throws CancelledException {
|
||||||
for (Long element : myDtAddedList) {
|
for (Long element : myDtAddedList) {
|
||||||
currentMonitor.checkCanceled();
|
currentMonitor.checkCancelled();
|
||||||
currentMonitor.setProgress(++progressIndex);
|
currentMonitor.setProgress(++progressIndex);
|
||||||
|
|
||||||
long myDtKey = element.longValue();
|
long myDtKey = element.longValue();
|
||||||
|
@ -402,7 +402,7 @@ abstract class AbstractFunctionMerger implements ListingMergeConstants {
|
|||||||
*/
|
*/
|
||||||
void determineFunctionConflicts(Function[] functions, boolean ignoreNames, TaskMonitor monitor)
|
void determineFunctionConflicts(Function[] functions, boolean ignoreNames, TaskMonitor monitor)
|
||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
boolean isExternalFunction = (functions[LATEST] != null) ? functions[LATEST].isExternal()
|
boolean isExternalFunction = (functions[LATEST] != null) ? functions[LATEST].isExternal()
|
||||||
: ((functions[MY] != null) ? functions[MY].isExternal()
|
: ((functions[MY] != null) ? functions[MY].isExternal()
|
||||||
: functions[ORIGINAL].isExternal());
|
: functions[ORIGINAL].isExternal());
|
||||||
@ -504,7 +504,7 @@ abstract class AbstractFunctionMerger implements ListingMergeConstants {
|
|||||||
*/
|
*/
|
||||||
boolean determineSignatureConflicts(Function[] functions, TaskMonitor monitor)
|
boolean determineSignatureConflicts(Function[] functions, TaskMonitor monitor)
|
||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address entry = (functions[LATEST] != null) ? functions[LATEST].getEntryPoint()
|
Address entry = (functions[LATEST] != null) ? functions[LATEST].getEntryPoint()
|
||||||
: ((functions[MY] != null) ? functions[MY].getEntryPoint()
|
: ((functions[MY] != null) ? functions[MY].getEntryPoint()
|
||||||
: functions[ORIGINAL].getEntryPoint());
|
: functions[ORIGINAL].getEntryPoint());
|
||||||
@ -1064,7 +1064,7 @@ abstract class AbstractFunctionMerger implements ListingMergeConstants {
|
|||||||
List<LocalVariableConflict> determineLocalVariableInfoConflicts(Function[] functions,
|
List<LocalVariableConflict> determineLocalVariableInfoConflicts(Function[] functions,
|
||||||
boolean autoMerge, FunctionVariableStorageConflicts storageConflicts,
|
boolean autoMerge, FunctionVariableStorageConflicts storageConflicts,
|
||||||
TaskMonitor monitor) throws CancelledException {
|
TaskMonitor monitor) throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
ArrayList<LocalVariableConflict> varConflictList = null;
|
ArrayList<LocalVariableConflict> varConflictList = null;
|
||||||
Address entry = (functions[LATEST] != null) ? functions[LATEST].getEntryPoint()
|
Address entry = (functions[LATEST] != null) ? functions[LATEST].getEntryPoint()
|
||||||
: ((functions[MY] != null) ? functions[MY].getEntryPoint()
|
: ((functions[MY] != null) ? functions[MY].getEntryPoint()
|
||||||
@ -1374,7 +1374,7 @@ abstract class AbstractFunctionMerger implements ListingMergeConstants {
|
|||||||
int chosenConflictOption, TaskMonitor monitor) throws CancelledException {
|
int chosenConflictOption, TaskMonitor monitor) throws CancelledException {
|
||||||
Iterator<ParamInfoConflict> iter = paramInfoConflicts.iterator();
|
Iterator<ParamInfoConflict> iter = paramInfoConflicts.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
ParamInfoConflict pc = iter.next();
|
ParamInfoConflict pc = iter.next();
|
||||||
mergeParamInfo(entryPt, pc, chosenConflictOption, monitor);
|
mergeParamInfo(entryPt, pc, chosenConflictOption, monitor);
|
||||||
}
|
}
|
||||||
@ -1406,7 +1406,7 @@ abstract class AbstractFunctionMerger implements ListingMergeConstants {
|
|||||||
|
|
||||||
Iterator<ParamInfoConflict> iter = paramInfoConflicts.iterator();
|
Iterator<ParamInfoConflict> iter = paramInfoConflicts.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
ParamInfoConflict pc = iter.next();
|
ParamInfoConflict pc = iter.next();
|
||||||
mergeParamInfo(functions, pc, chosenConflictOption, monitor);
|
mergeParamInfo(functions, pc, chosenConflictOption, monitor);
|
||||||
}
|
}
|
||||||
@ -1437,7 +1437,7 @@ abstract class AbstractFunctionMerger implements ListingMergeConstants {
|
|||||||
int chosenConflictOption, TaskMonitor monitor) throws CancelledException {
|
int chosenConflictOption, TaskMonitor monitor) throws CancelledException {
|
||||||
Iterator<LocalVariableConflict> iter = localVarConflicts.iterator();
|
Iterator<LocalVariableConflict> iter = localVarConflicts.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
LocalVariableConflict lvc = iter.next();
|
LocalVariableConflict lvc = iter.next();
|
||||||
mergeLocal(entryPt, lvc, chosenConflictOption, monitor);
|
mergeLocal(entryPt, lvc, chosenConflictOption, monitor);
|
||||||
}
|
}
|
||||||
@ -1445,7 +1445,7 @@ abstract class AbstractFunctionMerger implements ListingMergeConstants {
|
|||||||
|
|
||||||
protected void mergeLocal(Address entryPt, LocalVariableConflict localVarConflict,
|
protected void mergeLocal(Address entryPt, LocalVariableConflict localVarConflict,
|
||||||
int chosenConflictOption, TaskMonitor monitor) throws CancelledException {
|
int chosenConflictOption, TaskMonitor monitor) throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Variable[] vars = localVarConflict.vars; // [0]=Original, [1]=Latest, [2]=My
|
Variable[] vars = localVarConflict.vars; // [0]=Original, [1]=Latest, [2]=My
|
||||||
int conflicts = localVarConflict.varConflicts;
|
int conflicts = localVarConflict.varConflicts;
|
||||||
// if ((conflicts & VAR_REMOVED) != 0) {
|
// if ((conflicts & VAR_REMOVED) != 0) {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -457,7 +456,7 @@ class BookmarkMerger extends AbstractListingMerger {
|
|||||||
if ((bookmarkChoice == ASK_USER) && askUser && mergeManager != null) {
|
if ((bookmarkChoice == ASK_USER) && askUser && mergeManager != null) {
|
||||||
showMergePanel(listingPanel, bmuid.address, bmuid.bookmarkType,
|
showMergePanel(listingPanel, bmuid.address, bmuid.bookmarkType,
|
||||||
bmuid.bookmarkCategory, monitor);
|
bmuid.bookmarkCategory, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int optionToUse =
|
int optionToUse =
|
||||||
|
@ -492,7 +492,7 @@ class CodeUnitMerger extends AbstractListingMerger {
|
|||||||
conflictInfoPanel.setCodeUnitInfo(range, conflictIndex + 1, totalConflicts);
|
conflictInfoPanel.setCodeUnitInfo(range, conflictIndex + 1, totalConflicts);
|
||||||
conflictInfoPanel.setConflictInfo(1, 1);
|
conflictInfoPanel.setConflictInfo(1, 1);
|
||||||
showMergePanel(listingPanel, rangeMin, rangeMax, monitor);
|
showMergePanel(listingPanel, rangeMin, rangeMax, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
chosenConflictOption = getSelectedOption(conflictPanel);
|
chosenConflictOption = getSelectedOption(conflictPanel);
|
||||||
monitor.setMaximum(totalConflicts);
|
monitor.setMaximum(totalConflicts);
|
||||||
monitor.setProgress(conflictIndex + 1);
|
monitor.setProgress(conflictIndex + 1);
|
||||||
@ -736,7 +736,7 @@ class CodeUnitMerger extends AbstractListingMerger {
|
|||||||
register, addrRange.getMinAddress(), addrRange.getMaxAddress());
|
register, addrRange.getMinAddress(), addrRange.getMaxAddress());
|
||||||
resultContext.remove(addrRange.getMinAddress(), addrRange.getMaxAddress(), register);
|
resultContext.remove(addrRange.getMinAddress(), addrRange.getMaxAddress(), register);
|
||||||
while (origValueIter.hasNext()) {
|
while (origValueIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
AddressRange valueRange = origValueIter.next();
|
AddressRange valueRange = origValueIter.next();
|
||||||
RegisterValue value =
|
RegisterValue value =
|
||||||
originContext.getRegisterValue(register, valueRange.getMinAddress());
|
originContext.getRegisterValue(register, valueRange.getMinAddress());
|
||||||
@ -791,7 +791,7 @@ class CodeUnitMerger extends AbstractListingMerger {
|
|||||||
// Get each code unit out of the iterator and set it in the merged
|
// Get each code unit out of the iterator and set it in the merged
|
||||||
// program if it is an instruction.
|
// program if it is an instruction.
|
||||||
while (sourceCodeUnits.hasNext()) {
|
while (sourceCodeUnits.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
CodeUnit cu = sourceCodeUnits.next();
|
CodeUnit cu = sourceCodeUnits.next();
|
||||||
if (mergeCount > granularity) {
|
if (mergeCount > granularity) {
|
||||||
monitor.setProgress(mergeProgress);
|
monitor.setProgress(mergeProgress);
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -297,7 +296,7 @@ class CommentMerger extends AbstractListingMerger {
|
|||||||
}
|
}
|
||||||
if (chosenConflictOption == ASK_USER && mergeManager != null) {
|
if (chosenConflictOption == ASK_USER && mergeManager != null) {
|
||||||
showMergePanel(listingPanel, addr, programMergeFilterCommentType, monitor);
|
showMergePanel(listingPanel, addr, programMergeFilterCommentType, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
merge(addr, programMergeFilterCommentType, chosenConflictOption, monitor);
|
merge(addr, programMergeFilterCommentType, chosenConflictOption, monitor);
|
||||||
|
@ -148,7 +148,7 @@ class EquateMerger extends AbstractListingMerger {
|
|||||||
// Each operand index can have multiple scalars
|
// Each operand index can have multiple scalars
|
||||||
Scalar[] scalars = getScalars(resultCU, opIndex);
|
Scalar[] scalars = getScalars(resultCU, opIndex);
|
||||||
for (Scalar scalar : scalars) {
|
for (Scalar scalar : scalars) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
getOperandScalarConflicts(addr, opIndex, scalar);
|
getOperandScalarConflicts(addr, opIndex, scalar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -329,7 +329,7 @@ class EquateMerger extends AbstractListingMerger {
|
|||||||
else {
|
else {
|
||||||
if (askUser && mergeManager != null) {
|
if (askUser && mergeManager != null) {
|
||||||
setupConflictPanel(listingPanel, equateConflict);
|
setupConflictPanel(listingPanel, equateConflict);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
merge(equateConflict.address, equateConflict.opIndex,
|
merge(equateConflict.address, equateConflict.opIndex,
|
||||||
|
@ -473,7 +473,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
initializeAutoMerge("Auto-merging External Labels and Functions and determining conflicts.",
|
initializeAutoMerge("Auto-merging External Labels and Functions and determining conflicts.",
|
||||||
progressMin, progressMax, monitor);
|
progressMin, progressMax, monitor);
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
clearResolveInfo();
|
clearResolveInfo();
|
||||||
|
|
||||||
setupSymbolChanges(monitor); // Creates ID arrays used by processing methods.
|
setupSymbolChanges(monitor); // Creates ID arrays used by processing methods.
|
||||||
@ -591,7 +591,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
AddressIterator latestModifiedAddressIterator = latestExternalSet.getAddresses(true);
|
AddressIterator latestModifiedAddressIterator = latestExternalSet.getAddresses(true);
|
||||||
while (latestModifiedAddressIterator.hasNext()) {
|
while (latestModifiedAddressIterator.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address externalAddress = latestModifiedAddressIterator.next();
|
Address externalAddress = latestModifiedAddressIterator.next();
|
||||||
Symbol latestSymbol = symbolTables[LATEST].getPrimarySymbol(externalAddress);
|
Symbol latestSymbol = symbolTables[LATEST].getPrimarySymbol(externalAddress);
|
||||||
if (latestSymbol == null) {
|
if (latestSymbol == null) {
|
||||||
@ -624,7 +624,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
private void getNonSymbolChangesForMyExternals(TaskMonitor monitor) throws CancelledException {
|
private void getNonSymbolChangesForMyExternals(TaskMonitor monitor) throws CancelledException {
|
||||||
AddressIterator myModifiedAddressIterator = myExternalSet.getAddresses(true);
|
AddressIterator myModifiedAddressIterator = myExternalSet.getAddresses(true);
|
||||||
while (myModifiedAddressIterator.hasNext()) {
|
while (myModifiedAddressIterator.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address externalAddress = myModifiedAddressIterator.next();
|
Address externalAddress = myModifiedAddressIterator.next();
|
||||||
Symbol mySymbol = symbolTables[MY].getPrimarySymbol(externalAddress);
|
Symbol mySymbol = symbolTables[MY].getPrimarySymbol(externalAddress);
|
||||||
if (mySymbol == null) {
|
if (mySymbol == null) {
|
||||||
@ -711,7 +711,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
private void mergeExternalDetail(int type, ExternalLocation resultExternalLocation,
|
private void mergeExternalDetail(int type, ExternalLocation resultExternalLocation,
|
||||||
ExternalLocation fromExternalLocation, TaskMonitor monitor) throws CancelledException {
|
ExternalLocation fromExternalLocation, TaskMonitor monitor) throws CancelledException {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
// See if both changed to same value.
|
// See if both changed to same value.
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -1106,7 +1106,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void determineExternalRemoveConflicts(TaskMonitor monitor) throws CancelledException {
|
private void determineExternalRemoveConflicts(TaskMonitor monitor) throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (totalChanges <= 0) {
|
if (totalChanges <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1157,7 +1157,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void determineExternalChangeConflicts(TaskMonitor monitor) throws CancelledException {
|
private void determineExternalChangeConflicts(TaskMonitor monitor) throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (totalChanges <= 0) {
|
if (totalChanges <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1174,7 +1174,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
private void processExternalsChangedInLatest(TaskMonitor monitor) throws CancelledException {
|
private void processExternalsChangedInLatest(TaskMonitor monitor) throws CancelledException {
|
||||||
Iterator<Long> latestIterator = latestModifiedIDs.iterator();
|
Iterator<Long> latestIterator = latestModifiedIDs.iterator();
|
||||||
while (latestIterator.hasNext()) {
|
while (latestIterator.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long latestID = latestIterator.next();
|
long latestID = latestIterator.next();
|
||||||
long originalID = resolveOriginalIDFromLatestID(latestID);
|
long originalID = resolveOriginalIDFromLatestID(latestID);
|
||||||
long myID = resolveMyIDFromOriginalID(originalID);
|
long myID = resolveMyIDFromOriginalID(originalID);
|
||||||
@ -1211,7 +1211,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
private void processExternalsChangedInMy(TaskMonitor monitor) throws CancelledException {
|
private void processExternalsChangedInMy(TaskMonitor monitor) throws CancelledException {
|
||||||
Iterator<Long> myIterator = myModifiedIDs.iterator();
|
Iterator<Long> myIterator = myModifiedIDs.iterator();
|
||||||
while (myIterator.hasNext()) {
|
while (myIterator.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long myID = myIterator.next();
|
long myID = myIterator.next();
|
||||||
long originalID = resolveOriginalIDFromMyID(myID);
|
long originalID = resolveOriginalIDFromMyID(myID);
|
||||||
long latestID = resolveLatestIDFromOriginalID(originalID);
|
long latestID = resolveLatestIDFromOriginalID(originalID);
|
||||||
@ -1426,7 +1426,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
*/
|
*/
|
||||||
public void replaceExternalDataType(ExternalLocation resultExternalLocation,
|
public void replaceExternalDataType(ExternalLocation resultExternalLocation,
|
||||||
ExternalLocation fromExternalLocation, TaskMonitor monitor) throws CancelledException {
|
ExternalLocation fromExternalLocation, TaskMonitor monitor) throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (fromExternalLocation != null && resultExternalLocation != null) {
|
if (fromExternalLocation != null && resultExternalLocation != null) {
|
||||||
DataType fromDataTypeForResult = getResultDataType(fromExternalLocation);
|
DataType fromDataTypeForResult = getResultDataType(fromExternalLocation);
|
||||||
DataType resultDataType = resultExternalLocation.getDataType();
|
DataType resultDataType = resultExternalLocation.getDataType();
|
||||||
@ -1526,7 +1526,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void determineExternalAddConflicts(TaskMonitor monitor) throws CancelledException {
|
private void determineExternalAddConflicts(TaskMonitor monitor) throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (totalChanges <= 0) {
|
if (totalChanges <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1540,7 +1540,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
// MY adds may conflict with LATEST adds that are already in RESULT.
|
// MY adds may conflict with LATEST adds that are already in RESULT.
|
||||||
Iterator<Long> myIterator = myAddIDs.iterator();
|
Iterator<Long> myIterator = myAddIDs.iterator();
|
||||||
while (myIterator.hasNext()) {
|
while (myIterator.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long myID = myIterator.next();
|
long myID = myIterator.next();
|
||||||
Symbol mySymbol = symbolTables[MY].getSymbol(myID);
|
Symbol mySymbol = symbolTables[MY].getSymbol(myID);
|
||||||
// Non-primary symbols are "original" symbols and we don't need to match these.
|
// Non-primary symbols are "original" symbols and we don't need to match these.
|
||||||
@ -2016,7 +2016,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
choicesPanel.setConflictType("External Function Removal");
|
choicesPanel.setConflictType("External Function Removal");
|
||||||
|
|
||||||
setupConflictPanel(listingMergePanel, choicesPanel, externalLocations, monitor);
|
setupConflictPanel(listingMergePanel, choicesPanel, externalLocations, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If we have a external function removal choice then a "Use For All" has already occurred.
|
// If we have a external function removal choice then a "Use For All" has already occurred.
|
||||||
@ -2069,7 +2069,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
choicesPanel.setConflictType("Function Detail");
|
choicesPanel.setConflictType("Function Detail");
|
||||||
|
|
||||||
setupConflictPanel(listingPanel, choicesPanel, externalLocations, monitor);
|
setupConflictPanel(listingPanel, choicesPanel, externalLocations, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mergeFunctionDetails(functions, currentConflictOption, monitor);
|
mergeFunctionDetails(functions, currentConflictOption, monitor);
|
||||||
@ -2128,7 +2128,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
choicesPanel.setConflictType("Function Return");
|
choicesPanel.setConflictType("Function Return");
|
||||||
|
|
||||||
setupConflictPanel(listingPanel, choicesPanel, externalLocations, monitor);
|
setupConflictPanel(listingPanel, choicesPanel, externalLocations, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mergeFunctionReturn(functions, currentConflictOption, monitor);
|
mergeFunctionReturn(functions, currentConflictOption, monitor);
|
||||||
@ -2145,14 +2145,14 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
if (variableStorageChoice != ASK_USER) {
|
if (variableStorageChoice != ASK_USER) {
|
||||||
for (Pair<List<Variable>, List<Variable>> pair : variableStorageConflicts
|
for (Pair<List<Variable>, List<Variable>> pair : variableStorageConflicts
|
||||||
.getOverlappingVariables()) {
|
.getOverlappingVariables()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
mergeVariableStorage(functions, pair, variableStorageChoice, monitor);
|
mergeVariableStorage(functions, pair, variableStorageChoice, monitor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (askUser && mergeManager != null) {
|
else if (askUser && mergeManager != null) {
|
||||||
for (Pair<List<Variable>, List<Variable>> pair : variableStorageConflicts
|
for (Pair<List<Variable>, List<Variable>> pair : variableStorageConflicts
|
||||||
.getOverlappingVariables()) {
|
.getOverlappingVariables()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
boolean useForAll = (variableStorageChoice != ASK_USER);
|
boolean useForAll = (variableStorageChoice != ASK_USER);
|
||||||
if (useForAll) {
|
if (useForAll) {
|
||||||
mergeVariableStorage(functions, pair, variableStorageChoice, monitor);
|
mergeVariableStorage(functions, pair, variableStorageChoice, monitor);
|
||||||
@ -2170,7 +2170,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
else {
|
else {
|
||||||
for (Pair<List<Variable>, List<Variable>> pair : variableStorageConflicts
|
for (Pair<List<Variable>, List<Variable>> pair : variableStorageConflicts
|
||||||
.getOverlappingVariables()) {
|
.getOverlappingVariables()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
mergeVariableStorage(functions, pair, currentConflictOption, monitor);
|
mergeVariableStorage(functions, pair, currentConflictOption, monitor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2192,7 +2192,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
choicesPanel.setConflictType("Function Parameter Signature");
|
choicesPanel.setConflictType("Function Parameter Signature");
|
||||||
|
|
||||||
setupConflictPanel(listingPanel, choicesPanel, externalLocations, monitor);
|
setupConflictPanel(listingPanel, choicesPanel, externalLocations, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mergeParameters(functions, currentConflictOption, monitor);
|
mergeParameters(functions, currentConflictOption, monitor);
|
||||||
@ -2212,7 +2212,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
else if (askUser && mergeManager != null) {
|
else if (askUser && mergeManager != null) {
|
||||||
Iterator<ParamInfoConflict> iter = paramInfoConflicts.iterator();
|
Iterator<ParamInfoConflict> iter = paramInfoConflicts.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
ParamInfoConflict pc = iter.next();
|
ParamInfoConflict pc = iter.next();
|
||||||
boolean useForAll = (parameterInfoChoice != ASK_USER);
|
boolean useForAll = (parameterInfoChoice != ASK_USER);
|
||||||
if (useForAll) {
|
if (useForAll) {
|
||||||
@ -2226,7 +2226,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
choicesPanel.setConflictType("Function Parameter Info");
|
choicesPanel.setConflictType("Function Parameter Info");
|
||||||
|
|
||||||
setupConflictPanel(listingPanel, choicesPanel, externalLocations, monitor);
|
setupConflictPanel(listingPanel, choicesPanel, externalLocations, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2244,7 +2244,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
}
|
}
|
||||||
if (askUser && mergeManager != null) {
|
if (askUser && mergeManager != null) {
|
||||||
for (LocalVariableConflict localVariableConflict : localVarConflicts) {
|
for (LocalVariableConflict localVariableConflict : localVarConflicts) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
ConflictPanel choicesPanel;
|
ConflictPanel choicesPanel;
|
||||||
if ((localVariableConflict.varConflicts & VAR_REMOVED) != 0) {
|
if ((localVariableConflict.varConflicts & VAR_REMOVED) != 0) {
|
||||||
currentExternalConflictType =
|
currentExternalConflictType =
|
||||||
@ -2411,26 +2411,26 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
|
|
||||||
// Handle External Detail Conflicts
|
// Handle External Detail Conflicts
|
||||||
if (externalDetailConflicts.contains(myAddress)) {
|
if (externalDetailConflicts.contains(myAddress)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
handleExternalDetailsConflict(externalLocations, chosenConflictOption, monitor);
|
handleExternalDetailsConflict(externalLocations, chosenConflictOption, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle External Data Type Conflicts
|
// Handle External Data Type Conflicts
|
||||||
if (externalDataTypeConflicts.contains(myAddress)) {
|
if (externalDataTypeConflicts.contains(myAddress)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
handleExternalDataTypeConflict(externalLocations, chosenConflictOption, monitor);
|
handleExternalDataTypeConflict(externalLocations, chosenConflictOption, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle External Function versus Data Type Conflicts
|
// Handle External Function versus Data Type Conflicts
|
||||||
if (externalFunctionVersusDataTypeConflicts.contains(myAddress)) {
|
if (externalFunctionVersusDataTypeConflicts.contains(myAddress)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
handleExternalFunctionVersusDataTypeConflict(externalLocations, chosenConflictOption,
|
handleExternalFunctionVersusDataTypeConflict(externalLocations, chosenConflictOption,
|
||||||
monitor);
|
monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle Detailed Function Conflicts
|
// Handle Detailed Function Conflicts
|
||||||
if (funcSet.contains(myAddress)) {
|
if (funcSet.contains(myAddress)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address myEntryPoint = myAddress;
|
Address myEntryPoint = myAddress;
|
||||||
Function[] functions = getFunctions(externalLocations);
|
Function[] functions = getFunctions(externalLocations);
|
||||||
updateExternalNameInfo(externalLocations, MY);
|
updateExternalNameInfo(externalLocations, MY);
|
||||||
@ -2572,7 +2572,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
choicesPanel.setConflictType("External Details");
|
choicesPanel.setConflictType("External Details");
|
||||||
|
|
||||||
setupConflictPanel(listingMergePanel, choicesPanel, externalLocations, monitor);
|
setupConflictPanel(listingMergePanel, choicesPanel, externalLocations, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If we have a external details choice then a "Use For All" has already occurred.
|
// If we have a external details choice then a "Use For All" has already occurred.
|
||||||
@ -2613,7 +2613,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
choicesPanel.setConflictType("External Data Type");
|
choicesPanel.setConflictType("External Data Type");
|
||||||
|
|
||||||
setupConflictPanel(listingMergePanel, choicesPanel, externalLocations, monitor);
|
setupConflictPanel(listingMergePanel, choicesPanel, externalLocations, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If we have a external data type choice then a "Use For All" has already occurred.
|
// If we have a external data type choice then a "Use For All" has already occurred.
|
||||||
@ -2641,7 +2641,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
choicesPanel.setConflictType("External Function Versus Data Type");
|
choicesPanel.setConflictType("External Function Versus Data Type");
|
||||||
|
|
||||||
setupConflictPanel(listingMergePanel, choicesPanel, externalLocations, monitor);
|
setupConflictPanel(listingMergePanel, choicesPanel, externalLocations, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If we have a external function vs. data type choice then a "Use For All" has already occurred.
|
// If we have a external function vs. data type choice then a "Use For All" has already occurred.
|
||||||
@ -2683,7 +2683,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
|
|
||||||
setupAddConflictPanel(addConflictPanel, choicesPanel, externalLocations[LATEST],
|
setupAddConflictPanel(addConflictPanel, choicesPanel, externalLocations[LATEST],
|
||||||
externalLocations[MY], monitor);
|
externalLocations[MY], monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If we have a external add choice then a "Use For All" has already occurred.
|
// If we have a external add choice then a "Use For All" has already occurred.
|
||||||
@ -2733,7 +2733,7 @@ public class ExternalFunctionMerger extends AbstractFunctionMerger implements Li
|
|||||||
choicesPanel.setConflictType("External Removal");
|
choicesPanel.setConflictType("External Removal");
|
||||||
|
|
||||||
setupConflictPanel(listingMergePanel, choicesPanel, externalLocations, monitor);
|
setupConflictPanel(listingMergePanel, choicesPanel, externalLocations, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If we have a function remove choice then a "Use For All" has already occurred.
|
// If we have a function remove choice then a "Use For All" has already occurred.
|
||||||
|
@ -591,7 +591,7 @@ public class ExternalProgramMerger implements MergeResolver, ListingMergeConstan
|
|||||||
for (int conflictIndex = 0; conflictIndex < totalConflicts; conflictIndex++) {
|
for (int conflictIndex = 0; conflictIndex < totalConflicts; conflictIndex++) {
|
||||||
IDGroup idGroup = extPgms.get(conflictIndex);
|
IDGroup idGroup = extPgms.get(conflictIndex);
|
||||||
if ((externalProgramChoice == ASK_USER) && askUser && mergeManager != null) {
|
if ((externalProgramChoice == ASK_USER) && askUser && mergeManager != null) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
showMergePanel(idGroup, monitor);
|
showMergePanel(idGroup, monitor);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -852,14 +852,14 @@ public class ExternalProgramMerger implements MergeResolver, ListingMergeConstan
|
|||||||
int transactionID = resultPgm.startTransaction(getDescription());
|
int transactionID = resultPgm.startTransaction(getDescription());
|
||||||
boolean commit = false;
|
boolean commit = false;
|
||||||
try {
|
try {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
clearResolveInfo();
|
clearResolveInfo();
|
||||||
|
|
||||||
autoMerge(monitor);
|
autoMerge(monitor);
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
mergeConflicts(ASK_USER, monitor);
|
mergeConflicts(ASK_USER, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
clearConflictPanel();
|
clearConflictPanel();
|
||||||
showResolveInfo();
|
showResolveInfo();
|
||||||
commit = true;
|
commit = true;
|
||||||
|
@ -275,7 +275,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
// Auto-merge parts of functions where possible and determine conflicts.
|
// Auto-merge parts of functions where possible and determine conflicts.
|
||||||
AddressIterator iter = possibleDetailConflicts.getAddresses(true);
|
AddressIterator iter = possibleDetailConflicts.getAddresses(true);
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
updateProgress((int) (DETAILS_CONFLICT_START +
|
updateProgress((int) (DETAILS_CONFLICT_START +
|
||||||
((addressCount * DETAILS_CONFLICT_SIZE) / totalAddresses)));
|
((addressCount * DETAILS_CONFLICT_SIZE) / totalAddresses)));
|
||||||
Address entry = iter.next();
|
Address entry = iter.next();
|
||||||
@ -334,7 +334,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
while (latestIter.hasNext()) {
|
while (latestIter.hasNext()) {
|
||||||
monitor.setProgress(count++);
|
monitor.setProgress(count++);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address entry = latestIter.next();
|
Address entry = latestIter.next();
|
||||||
Function originalFunc = functionManagers[ORIGINAL].getFunctionAt(entry);
|
Function originalFunc = functionManagers[ORIGINAL].getFunctionAt(entry);
|
||||||
Function latestFunc = functionManagers[LATEST].getFunctionAt(entry);
|
Function latestFunc = functionManagers[LATEST].getFunctionAt(entry);
|
||||||
@ -361,7 +361,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
while (latestIter.hasNext()) {
|
while (latestIter.hasNext()) {
|
||||||
monitor.setProgress(count++);
|
monitor.setProgress(count++);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address entry = latestIter.next();
|
Address entry = latestIter.next();
|
||||||
Function originalFunc = functionManagers[ORIGINAL].getFunctionAt(entry);
|
Function originalFunc = functionManagers[ORIGINAL].getFunctionAt(entry);
|
||||||
Function latestFunc = functionManagers[LATEST].getFunctionAt(entry);
|
Function latestFunc = functionManagers[LATEST].getFunctionAt(entry);
|
||||||
@ -384,7 +384,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
while (myIter.hasNext()) {
|
while (myIter.hasNext()) {
|
||||||
monitor.setProgress(count++);
|
monitor.setProgress(count++);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address entry = myIter.next();
|
Address entry = myIter.next();
|
||||||
Function originalFunc = functionManagers[ORIGINAL].getFunctionAt(entry);
|
Function originalFunc = functionManagers[ORIGINAL].getFunctionAt(entry);
|
||||||
Function myFunc = functionManagers[MY].getFunctionAt(entry);
|
Function myFunc = functionManagers[MY].getFunctionAt(entry);
|
||||||
@ -409,12 +409,12 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
*/
|
*/
|
||||||
private void determineOverlapConflicts(AddressSet changeSet, TaskMonitor monitor)
|
private void determineOverlapConflicts(AddressSet changeSet, TaskMonitor monitor)
|
||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
AddressSet alreadyChecked = new AddressSet();
|
AddressSet alreadyChecked = new AddressSet();
|
||||||
AddressIterator iter = changeSet.getAddresses(true);
|
AddressIterator iter = changeSet.getAddresses(true);
|
||||||
// Look at every address where the Latest or My made a function change.
|
// Look at every address where the Latest or My made a function change.
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address changeEntry = iter.next(); // Entry Point of function being checked.
|
Address changeEntry = iter.next(); // Entry Point of function being checked.
|
||||||
if (overlapAddressSet.contains(changeEntry)) {
|
if (overlapAddressSet.contains(changeEntry)) {
|
||||||
continue;
|
continue;
|
||||||
@ -497,7 +497,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
|
|
||||||
private void determineBodyConflicts(AddressSetView addrs, TaskMonitor monitor)
|
private void determineBodyConflicts(AddressSetView addrs, TaskMonitor monitor)
|
||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long totalAddresses = addrs.getNumAddresses();
|
long totalAddresses = addrs.getNumAddresses();
|
||||||
monitor.initialize(totalAddresses);
|
monitor.initialize(totalAddresses);
|
||||||
long granularity = (totalAddresses / 100) + 1;
|
long granularity = (totalAddresses / 100) + 1;
|
||||||
@ -523,7 +523,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
|
|
||||||
private void determineBodyConflicts(Address entry, Function original, Function latest,
|
private void determineBodyConflicts(Address entry, Function original, Function latest,
|
||||||
Function my, TaskMonitor monitor) throws CancelledException {
|
Function my, TaskMonitor monitor) throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
AddressSetView originalAddrs = (original != null) ? original.getBody() : null;
|
AddressSetView originalAddrs = (original != null) ? original.getBody() : null;
|
||||||
AddressSetView latestAddrs = (latest != null) ? latest.getBody() : null;
|
AddressSetView latestAddrs = (latest != null) ? latest.getBody() : null;
|
||||||
AddressSetView myAddrs = (my != null) ? my.getBody() : null;
|
AddressSetView myAddrs = (my != null) ? my.getBody() : null;
|
||||||
@ -556,7 +556,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
|
|
||||||
private void determineRemoveConflicts(AddressSet possibleConflicts, TaskMonitor monitor)
|
private void determineRemoveConflicts(AddressSet possibleConflicts, TaskMonitor monitor)
|
||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
AddressSet myRemoveConflicts =
|
AddressSet myRemoveConflicts =
|
||||||
removeMy.intersect(changeLatest).intersect(possibleConflicts);
|
removeMy.intersect(changeLatest).intersect(possibleConflicts);
|
||||||
AddressSet latestRemoveConflicts =
|
AddressSet latestRemoveConflicts =
|
||||||
@ -570,7 +570,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
|
|
||||||
private void determineThunkConflicts(Function[] functions, TaskMonitor monitor)
|
private void determineThunkConflicts(Function[] functions, TaskMonitor monitor)
|
||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
boolean latestIsThunk = functions[LATEST].isThunk();
|
boolean latestIsThunk = functions[LATEST].isThunk();
|
||||||
boolean myIsThunk = functions[MY].isThunk();
|
boolean myIsThunk = functions[MY].isThunk();
|
||||||
@ -842,7 +842,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
|
|
||||||
setupAddressSetConflictPanel(listingPanel, choicesPanel, addr,
|
setupAddressSetConflictPanel(listingPanel, choicesPanel, addr,
|
||||||
overlapConflicts.get(addr), monitor);
|
overlapConflicts.get(addr), monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If we have a function overlap choice then a "Use For All" has already occurred.
|
// If we have a function overlap choice then a "Use For All" has already occurred.
|
||||||
@ -865,7 +865,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
|
|
||||||
setupAddressSetConflictPanel(listingPanel, choicesPanel, addr, getBodySet(addr),
|
setupAddressSetConflictPanel(listingPanel, choicesPanel, addr, getBodySet(addr),
|
||||||
monitor);
|
monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If we have a function body choice then a "Use For All" has already occurred.
|
// If we have a function body choice then a "Use For All" has already occurred.
|
||||||
@ -888,7 +888,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
choicesPanel.setConflictType("Function Removal");
|
choicesPanel.setConflictType("Function Removal");
|
||||||
|
|
||||||
setupConflictPanel(listingPanel, choicesPanel, addr, monitor);
|
setupConflictPanel(listingPanel, choicesPanel, addr, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If we have a function remove choice then a "Use For All" has already occurred.
|
// If we have a function remove choice then a "Use For All" has already occurred.
|
||||||
@ -930,7 +930,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
choicesPanel.setConflictType("Function Detail");
|
choicesPanel.setConflictType("Function Detail");
|
||||||
|
|
||||||
setupConflictPanel(listingPanel, choicesPanel, addr, monitor);
|
setupConflictPanel(listingPanel, choicesPanel, addr, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mergeFunctionDetails(functions, currentConflictOption, monitor);
|
mergeFunctionDetails(functions, currentConflictOption, monitor);
|
||||||
@ -983,7 +983,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
choicesPanel.setConflictType("Function Return");
|
choicesPanel.setConflictType("Function Return");
|
||||||
|
|
||||||
setupConflictPanel(listingPanel, choicesPanel, addr, monitor);
|
setupConflictPanel(listingPanel, choicesPanel, addr, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mergeFunctionReturn(functions, currentConflictOption, monitor);
|
mergeFunctionReturn(functions, currentConflictOption, monitor);
|
||||||
@ -1000,14 +1000,14 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
if (variableStorageChoice != ASK_USER) {
|
if (variableStorageChoice != ASK_USER) {
|
||||||
for (Pair<List<Variable>, List<Variable>> pair : variableStorageConflicts
|
for (Pair<List<Variable>, List<Variable>> pair : variableStorageConflicts
|
||||||
.getOverlappingVariables()) {
|
.getOverlappingVariables()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
mergeVariableStorage(addr, pair, variableStorageChoice, monitor);
|
mergeVariableStorage(addr, pair, variableStorageChoice, monitor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (askUser && mergeManager != null) {
|
else if (askUser && mergeManager != null) {
|
||||||
for (Pair<List<Variable>, List<Variable>> pair : variableStorageConflicts
|
for (Pair<List<Variable>, List<Variable>> pair : variableStorageConflicts
|
||||||
.getOverlappingVariables()) {
|
.getOverlappingVariables()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
boolean useForAll = (variableStorageChoice != ASK_USER);
|
boolean useForAll = (variableStorageChoice != ASK_USER);
|
||||||
if (useForAll) {
|
if (useForAll) {
|
||||||
mergeVariableStorage(addr, pair, variableStorageChoice, monitor);
|
mergeVariableStorage(addr, pair, variableStorageChoice, monitor);
|
||||||
@ -1025,7 +1025,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
else {
|
else {
|
||||||
for (Pair<List<Variable>, List<Variable>> pair : variableStorageConflicts
|
for (Pair<List<Variable>, List<Variable>> pair : variableStorageConflicts
|
||||||
.getOverlappingVariables()) {
|
.getOverlappingVariables()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
mergeVariableStorage(addr, pair, currentConflictOption, monitor);
|
mergeVariableStorage(addr, pair, currentConflictOption, monitor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1047,7 +1047,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
choicesPanel.setConflictType("Function Parameter Signature");
|
choicesPanel.setConflictType("Function Parameter Signature");
|
||||||
|
|
||||||
setupConflictPanel(listingPanel, choicesPanel, addr, monitor);
|
setupConflictPanel(listingPanel, choicesPanel, addr, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mergeParameters(addr, currentConflictOption, monitor);
|
mergeParameters(addr, currentConflictOption, monitor);
|
||||||
@ -1067,7 +1067,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
else if (askUser && mergeManager != null) {
|
else if (askUser && mergeManager != null) {
|
||||||
Iterator<ParamInfoConflict> iter = paramInfoConflicts.iterator();
|
Iterator<ParamInfoConflict> iter = paramInfoConflicts.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
ParamInfoConflict pc = iter.next();
|
ParamInfoConflict pc = iter.next();
|
||||||
boolean useForAll = (parameterInfoChoice != ASK_USER);
|
boolean useForAll = (parameterInfoChoice != ASK_USER);
|
||||||
if (useForAll) {
|
if (useForAll) {
|
||||||
@ -1080,7 +1080,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
choicesPanel.setConflictType("Function Parameter Info");
|
choicesPanel.setConflictType("Function Parameter Info");
|
||||||
|
|
||||||
setupConflictPanel(listingPanel, choicesPanel, pc.entry, monitor);
|
setupConflictPanel(listingPanel, choicesPanel, pc.entry, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1098,7 +1098,7 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
}
|
}
|
||||||
if (askUser && mergeManager != null) {
|
if (askUser && mergeManager != null) {
|
||||||
for (LocalVariableConflict localVariableConflict : localVarConflicts) {
|
for (LocalVariableConflict localVariableConflict : localVarConflicts) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
ConflictPanel choicesPanel = null;
|
ConflictPanel choicesPanel = null;
|
||||||
if ((localVariableConflict.varConflicts & VAR_REMOVED) != 0) {
|
if ((localVariableConflict.varConflicts & VAR_REMOVED) != 0) {
|
||||||
currentConflictType = FunctionConflictType.REMOVED_LOCAL_VARIABLE_CONFLICT;
|
currentConflictType = FunctionConflictType.REMOVED_LOCAL_VARIABLE_CONFLICT;
|
||||||
@ -1187,12 +1187,12 @@ class FunctionMerger extends AbstractFunctionMerger implements ListingMerger {
|
|||||||
choicesPanel.setConflictType("Thunk Function");
|
choicesPanel.setConflictType("Thunk Function");
|
||||||
|
|
||||||
setupConflictPanel(listingPanel, choicesPanel, thunkConflictAddress, monitor);
|
setupConflictPanel(listingPanel, choicesPanel, thunkConflictAddress, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
merge(thunkConflictAddress, currentConflictOption, monitor);
|
merge(thunkConflictAddress, currentConflictOption, monitor);
|
||||||
}
|
}
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
|
|
||||||
showResolveErrors(ERROR_TITLE);
|
showResolveErrors(ERROR_TITLE);
|
||||||
|
@ -210,7 +210,7 @@ public class FunctionTagListingMerger extends AbstractListingMerger {
|
|||||||
else {
|
else {
|
||||||
showMergePanel(listingPanel, addr, id, monitor);
|
showMergePanel(listingPanel, addr, id, monitor);
|
||||||
}
|
}
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ public class FunctionTagMerger implements MergeResolver, ListingMergeConstants {
|
|||||||
monitor.initialize(totalConflicts);
|
monitor.initialize(totalConflicts);
|
||||||
for (long id : tagConflicts.keySet()) {
|
for (long id : tagConflicts.keySet()) {
|
||||||
if ((conflictChoice == ASK_USER) && askUser && mergeManager != null) {
|
if ((conflictChoice == ASK_USER) && askUser && mergeManager != null) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
currentlyMergingTagID = id;
|
currentlyMergingTagID = id;
|
||||||
showMergePanel(id, monitor);
|
showMergePanel(id, monitor);
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ public class ProgramContextMergeManager implements MergeResolver, ListingMergeCo
|
|||||||
mergeManager.updateProgress(currentProgressPercentage,
|
mergeManager.updateProgress(currentProgressPercentage,
|
||||||
"Merging register values for " + regName);
|
"Merging register values for " + regName);
|
||||||
monitor.setProgress(i);
|
monitor.setProgress(i);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
rmm =
|
rmm =
|
||||||
new RegisterMergeManager(regName, mergeManager, resultPgm, originalPgm,
|
new RegisterMergeManager(regName, mergeManager, resultPgm, originalPgm,
|
||||||
latestPgm, myPgm, latestChanges, myChanges);
|
latestPgm, myPgm, latestChanges, myChanges);
|
||||||
|
@ -571,7 +571,7 @@ class ReferenceMerger extends AbstractListingMerger {
|
|||||||
opIndexes = new ArrayList<>();
|
opIndexes = new ArrayList<>();
|
||||||
typeConflicts.put(address, opIndexes);
|
typeConflicts.put(address, opIndexes);
|
||||||
}
|
}
|
||||||
opIndexes.add(new Integer(opIndex));
|
opIndexes.add(Integer.valueOf(opIndex));
|
||||||
conflictSet.addRange(address, address);
|
conflictSet.addRange(address, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -599,7 +599,7 @@ class ReferenceMerger extends AbstractListingMerger {
|
|||||||
opIndexes = new ArrayList<>();
|
opIndexes = new ArrayList<>();
|
||||||
primaryConflicts.put(address, opIndexes);
|
primaryConflicts.put(address, opIndexes);
|
||||||
}
|
}
|
||||||
opIndexes.add(new Integer(opIndex));
|
opIndexes.add(Integer.valueOf(opIndex));
|
||||||
conflictSet.addRange(address, address);
|
conflictSet.addRange(address, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -735,7 +735,7 @@ class ReferenceMerger extends AbstractListingMerger {
|
|||||||
if (opIndexList == null || opIndexList.size() == 0) {
|
if (opIndexList == null || opIndexList.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (opIndexList.contains(new Integer(opIndex))) {
|
if (opIndexList.contains(Integer.valueOf(opIndex))) {
|
||||||
currentReference = null;
|
currentReference = null;
|
||||||
currentAddress = addr;
|
currentAddress = addr;
|
||||||
currentOpIndex = opIndex;
|
currentOpIndex = opIndex;
|
||||||
@ -748,7 +748,7 @@ class ReferenceMerger extends AbstractListingMerger {
|
|||||||
else {
|
else {
|
||||||
if (askUser && mergeManager != null) {
|
if (askUser && mergeManager != null) {
|
||||||
showConflictPanel(listingPanel, TYPE_CONFLICT);
|
showConflictPanel(listingPanel, TYPE_CONFLICT);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
resolveTypeConflict(addr, opIndex, chosenConflictOption);
|
resolveTypeConflict(addr, opIndex, chosenConflictOption);
|
||||||
@ -779,7 +779,7 @@ class ReferenceMerger extends AbstractListingMerger {
|
|||||||
else {
|
else {
|
||||||
if (askUser && mergeManager != null) {
|
if (askUser && mergeManager != null) {
|
||||||
showConflictPanel(listingPanel, REMOVE_CONFLICT);
|
showConflictPanel(listingPanel, REMOVE_CONFLICT);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
resolveRemoveVsChange(currentReference, chosenConflictOption);
|
resolveRemoveVsChange(currentReference, chosenConflictOption);
|
||||||
@ -811,7 +811,7 @@ class ReferenceMerger extends AbstractListingMerger {
|
|||||||
else {
|
else {
|
||||||
if (askUser && mergeManager != null) {
|
if (askUser && mergeManager != null) {
|
||||||
showConflictPanel(listingPanel, CHANGE_CONFLICT);
|
showConflictPanel(listingPanel, CHANGE_CONFLICT);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
resolveChangeConflict(currentReference, chosenConflictOption);
|
resolveChangeConflict(currentReference, chosenConflictOption);
|
||||||
@ -846,7 +846,7 @@ class ReferenceMerger extends AbstractListingMerger {
|
|||||||
else {
|
else {
|
||||||
if (askUser && mergeManager != null) {
|
if (askUser && mergeManager != null) {
|
||||||
showConflictPanel(listingPanel, ADD_CONFLICT);
|
showConflictPanel(listingPanel, ADD_CONFLICT);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
resolveAddConflict(currentReference, chosenConflictOption);
|
resolveAddConflict(currentReference, chosenConflictOption);
|
||||||
@ -863,7 +863,7 @@ class ReferenceMerger extends AbstractListingMerger {
|
|||||||
if (opIndexList == null || opIndexList.size() == 0) {
|
if (opIndexList == null || opIndexList.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (opIndexList.contains(new Integer(opIndex))) {
|
if (opIndexList.contains(Integer.valueOf(opIndex))) {
|
||||||
// Check that the conflict still exists. It may have gotten resolved via another conflict.
|
// Check that the conflict still exists. It may have gotten resolved via another conflict.
|
||||||
if (!hasPrimaryConflict(addr, opIndex)) {
|
if (!hasPrimaryConflict(addr, opIndex)) {
|
||||||
return;
|
return;
|
||||||
@ -880,7 +880,7 @@ class ReferenceMerger extends AbstractListingMerger {
|
|||||||
else {
|
else {
|
||||||
if (askUser && mergeManager != null) {
|
if (askUser && mergeManager != null) {
|
||||||
showConflictPanel(listingPanel, PRIMARY_CONFLICT);
|
showConflictPanel(listingPanel, PRIMARY_CONFLICT);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
resolvePrimaryConflict(addr, opIndex, chosenConflictOption);
|
resolvePrimaryConflict(addr, opIndex, chosenConflictOption);
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -536,7 +535,7 @@ class RegisterMergeManager implements ListingMergeConstants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
return conflicts.toArray(new AddressRange[conflicts.size()]);
|
return conflicts.toArray(new AddressRange[conflicts.size()]);
|
||||||
}
|
}
|
||||||
|
@ -399,7 +399,7 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
tempLatestChangeIDs.length);
|
tempLatestChangeIDs.length);
|
||||||
Arrays.sort(this.latestChangeIDs);
|
Arrays.sort(this.latestChangeIDs);
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.setProgress(monitor.getProgress() + 1);
|
monitor.setProgress(monitor.getProgress() + 1);
|
||||||
getPrimariesAdded(this.myAddIDs, mySymTab, myPrimaryAddIDs, mySetPrimary);
|
getPrimariesAdded(this.myAddIDs, mySymTab, myPrimaryAddIDs, mySetPrimary);
|
||||||
getPrimariesAdded(this.latestAddIDs, latestSymTab, latestPrimaryAddIDs, latestSetPrimary);
|
getPrimariesAdded(this.latestAddIDs, latestSymTab, latestPrimaryAddIDs, latestSetPrimary);
|
||||||
@ -419,7 +419,7 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
long[] uniqueIDs = new long[first.length];
|
long[] uniqueIDs = new long[first.length];
|
||||||
int u = 0;
|
int u = 0;
|
||||||
for (long element : first) {
|
for (long element : first) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.setProgress(monitor.getProgress() + 1);
|
monitor.setProgress(monitor.getProgress() + 1);
|
||||||
boolean matched = false;
|
boolean matched = false;
|
||||||
for (long element2 : second) {
|
for (long element2 : second) {
|
||||||
@ -639,7 +639,7 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
if (currentMonitor != monitor) {
|
if (currentMonitor != monitor) {
|
||||||
currentMonitor = monitor;
|
currentMonitor = monitor;
|
||||||
}
|
}
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
setupSymbolChanges(monitor); // Creates ID arrays used by processing methods.
|
setupSymbolChanges(monitor); // Creates ID arrays used by processing methods.
|
||||||
|
|
||||||
@ -754,7 +754,7 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
monitor.initialize(list.size());
|
monitor.initialize(list.size());
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
monitor.setProgress(i);
|
monitor.setProgress(i);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long id = list.get(i);
|
long id = list.get(i);
|
||||||
Symbol resultSymbol = resultSymTab.getSymbol(id);
|
Symbol resultSymbol = resultSymTab.getSymbol(id);
|
||||||
if (resultSymbol == null) {
|
if (resultSymbol == null) {
|
||||||
@ -790,7 +790,7 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
monitor.initialize(len);
|
monitor.initialize(len);
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
monitor.setProgress(i);
|
monitor.setProgress(i);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long id = myRemoveIDs[i];
|
long id = myRemoveIDs[i];
|
||||||
Symbol originalSym = originalSymTab.getSymbol(id);
|
Symbol originalSym = originalSymTab.getSymbol(id);
|
||||||
SymbolType originalType = originalSym.getSymbolType();
|
SymbolType originalType = originalSym.getSymbolType();
|
||||||
@ -829,7 +829,7 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
monitor.initialize(len);
|
monitor.initialize(len);
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
monitor.setProgress(i);
|
monitor.setProgress(i);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
incrementProgress(1);
|
incrementProgress(1);
|
||||||
long id = myModifiedIDs[i];
|
long id = myModifiedIDs[i];
|
||||||
Symbol mySym = mySymTab.getSymbol(id);
|
Symbol mySym = mySymTab.getSymbol(id);
|
||||||
@ -1027,7 +1027,7 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
monitor.initialize(len);
|
monitor.initialize(len);
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
monitor.setProgress(i);
|
monitor.setProgress(i);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
incrementProgress(1);
|
incrementProgress(1);
|
||||||
long id = myAnchorChangeIDs[i];
|
long id = myAnchorChangeIDs[i];
|
||||||
Symbol mySym = mySymTab.getSymbol(id);
|
Symbol mySym = mySymTab.getSymbol(id);
|
||||||
@ -1051,7 +1051,7 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
AddressIterator iter = mySetPrimary.getAddresses(true);
|
AddressIterator iter = mySetPrimary.getAddresses(true);
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
incrementProgress(1);
|
incrementProgress(1);
|
||||||
Address addr = iter.next();
|
Address addr = iter.next();
|
||||||
Symbol myPrimary = mySymTab.getPrimarySymbol(addr);
|
Symbol myPrimary = mySymTab.getPrimarySymbol(addr);
|
||||||
@ -1092,7 +1092,7 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
int len = myAddIDs.length;
|
int len = myAddIDs.length;
|
||||||
monitor.initialize(len);
|
monitor.initialize(len);
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
incrementProgress(1);
|
incrementProgress(1);
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
long id = myAddIDs[i];
|
long id = myAddIDs[i];
|
||||||
@ -1205,7 +1205,7 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
MultiAddressIterator multiIter =
|
MultiAddressIterator multiIter =
|
||||||
new MultiAddressIterator(new AddressIterator[] { originalIter, latestIter, myIter });
|
new MultiAddressIterator(new AddressIterator[] { originalIter, latestIter, myIter });
|
||||||
while (multiIter.hasNext()) {
|
while (multiIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address[] addrs = multiIter.nextAddresses();
|
Address[] addrs = multiIter.nextAddresses();
|
||||||
if (addrs[0] != null) {
|
if (addrs[0] != null) {
|
||||||
if (addrs[1] == null || addrs[2] == null) {
|
if (addrs[1] == null || addrs[2] == null) {
|
||||||
@ -1232,7 +1232,7 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
// Remove entry points if possible.
|
// Remove entry points if possible.
|
||||||
AddressIterator iter = removeEntryPts.getAddresses(true);
|
AddressIterator iter = removeEntryPts.getAddresses(true);
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = iter.next();
|
Address addr = iter.next();
|
||||||
tempResultSymTab.removeExternalEntryPoint(addr);
|
tempResultSymTab.removeExternalEntryPoint(addr);
|
||||||
incrementProgress(1);
|
incrementProgress(1);
|
||||||
@ -1240,7 +1240,7 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
// Add entry points if possible.
|
// Add entry points if possible.
|
||||||
iter = addEntryPts.getAddresses(true);
|
iter = addEntryPts.getAddresses(true);
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = iter.next();
|
Address addr = iter.next();
|
||||||
tempResultSymTab.addExternalEntryPoint(addr);
|
tempResultSymTab.addExternalEntryPoint(addr);
|
||||||
incrementProgress(1);
|
incrementProgress(1);
|
||||||
@ -1515,18 +1515,18 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
|
|
||||||
public void merge(int progressMinimum, int progressMaximum, TaskMonitor monitor)
|
public void merge(int progressMinimum, int progressMaximum, TaskMonitor monitor)
|
||||||
throws ProgramConflictException, MemoryAccessException, CancelledException {
|
throws ProgramConflictException, MemoryAccessException, CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.setProgress(0);
|
monitor.setProgress(0);
|
||||||
clearResolveInfo();
|
clearResolveInfo();
|
||||||
autoMerge(progressMinimum, progressMaximum, monitor);
|
autoMerge(progressMinimum, progressMaximum, monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
mergeConflicts(monitor);
|
mergeConflicts(monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
processDeferredRemoves(monitor);
|
processDeferredRemoves(monitor);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
infoBuf.append(getDeferredRemovesInfo());
|
infoBuf.append(getDeferredRemovesInfo());
|
||||||
infoBuf.append(getRenamedConflictsInfo());
|
infoBuf.append(getRenamedConflictsInfo());
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
showResolveInfo();
|
showResolveInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2919,15 +2919,15 @@ class SymbolMerger extends AbstractListingMerger {
|
|||||||
private final static long serialVersionUID = 1;
|
private final static long serialVersionUID = 1;
|
||||||
|
|
||||||
public boolean add(long l) {
|
public boolean add(long l) {
|
||||||
return super.add(new Long(l));
|
return super.add(Long.valueOf(l));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean contains(long l) {
|
public boolean contains(long l) {
|
||||||
return super.contains(new Long(l));
|
return super.contains(Long.valueOf(l));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean remove(long l) {
|
public boolean remove(long l) {
|
||||||
return super.remove(new Long(l));
|
return super.remove(Long.valueOf(l));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ class UserDefinedPropertyMerger extends AbstractListingMerger {
|
|||||||
// Address addr = (Address) propIter.next();
|
// Address addr = (Address) propIter.next();
|
||||||
// if (sameOption[propIndex] == ASK_USER && mergeManager != null) {
|
// if (sameOption[propIndex] == ASK_USER && mergeManager != null) {
|
||||||
// showMergePanel(listingPanel, propertyName, addr);
|
// showMergePanel(listingPanel, propertyName, addr);
|
||||||
// monitor.checkCanceled();
|
// monitor.checkCancelled();
|
||||||
// }
|
// }
|
||||||
// else {
|
// else {
|
||||||
// merge(propertyName, addr, sameOption[propIndex]);
|
// merge(propertyName, addr, sameOption[propIndex]);
|
||||||
@ -365,7 +365,7 @@ class UserDefinedPropertyMerger extends AbstractListingMerger {
|
|||||||
}
|
}
|
||||||
if (sameOption[propertyIndex] == ASK_USER && mergeManager != null) {
|
if (sameOption[propertyIndex] == ASK_USER && mergeManager != null) {
|
||||||
showMergePanel(listingPanel, propertyName, addr);
|
showMergePanel(listingPanel, propertyName, addr);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
merge(propertyName, addr, sameOption[propertyIndex]);
|
merge(propertyName, addr, sameOption[propertyIndex]);
|
||||||
|
@ -361,13 +361,13 @@ public class PropertyListMergeManager implements MergeResolver {
|
|||||||
return options.getBoolean(propertyName, false) ? Boolean.TRUE : Boolean.FALSE;
|
return options.getBoolean(propertyName, false) ? Boolean.TRUE : Boolean.FALSE;
|
||||||
|
|
||||||
case DOUBLE_TYPE:
|
case DOUBLE_TYPE:
|
||||||
return new Double(options.getDouble(propertyName, 0d));
|
return Double.valueOf(options.getDouble(propertyName, 0d));
|
||||||
|
|
||||||
case INT_TYPE:
|
case INT_TYPE:
|
||||||
return new Integer(options.getInt(propertyName, 0));
|
return Integer.valueOf(options.getInt(propertyName, 0));
|
||||||
|
|
||||||
case LONG_TYPE:
|
case LONG_TYPE:
|
||||||
return new Long(options.getLong(propertyName, 0L));
|
return Long.valueOf(options.getLong(propertyName, 0L));
|
||||||
|
|
||||||
case NO_TYPE:
|
case NO_TYPE:
|
||||||
return null;
|
return null;
|
||||||
|
@ -154,14 +154,14 @@ public class ProgramTreeMergeManager implements MergeResolver {
|
|||||||
"Program Tree Merge is processing IDs changed in Checked Out...");
|
"Program Tree Merge is processing IDs changed in Checked Out...");
|
||||||
ArrayList<Long> changeList = new ArrayList<Long>();
|
ArrayList<Long> changeList = new ArrayList<Long>();
|
||||||
for (long myChangeID : myChangeIDs) {
|
for (long myChangeID : myChangeIDs) {
|
||||||
changeList.add(new Long(myChangeID));
|
changeList.add(Long.valueOf(myChangeID));
|
||||||
}
|
}
|
||||||
|
|
||||||
mergeManager.updateProgress(10,
|
mergeManager.updateProgress(10,
|
||||||
"Program Tree Merge is processing IDs added in Checked Out...");
|
"Program Tree Merge is processing IDs added in Checked Out...");
|
||||||
ArrayList<Long> myAddedList = new ArrayList<Long>();
|
ArrayList<Long> myAddedList = new ArrayList<Long>();
|
||||||
for (long element : myIDsAdded) {
|
for (long element : myIDsAdded) {
|
||||||
myAddedList.add(new Long(element));
|
myAddedList.add(Long.valueOf(element));
|
||||||
}
|
}
|
||||||
|
|
||||||
mergeManager.updateProgress(20, "Program Tree Merge is eliminating removed IDs...");
|
mergeManager.updateProgress(20, "Program Tree Merge is eliminating removed IDs...");
|
||||||
@ -171,7 +171,7 @@ public class ProgramTreeMergeManager implements MergeResolver {
|
|||||||
mergeManager.updateProgress(30, "Program Tree Merge is processing IDs added in Latest...");
|
mergeManager.updateProgress(30, "Program Tree Merge is processing IDs added in Latest...");
|
||||||
ArrayList<Long> latestAddedList = new ArrayList<Long>();
|
ArrayList<Long> latestAddedList = new ArrayList<Long>();
|
||||||
for (long element : latestIDsAdded) {
|
for (long element : latestIDsAdded) {
|
||||||
latestAddedList.add(new Long(element));
|
latestAddedList.add(Long.valueOf(element));
|
||||||
}
|
}
|
||||||
|
|
||||||
conflictsChangeList = new ArrayList<Long>(changeList);
|
conflictsChangeList = new ArrayList<Long>(changeList);
|
||||||
@ -179,7 +179,7 @@ public class ProgramTreeMergeManager implements MergeResolver {
|
|||||||
mergeManager.updateProgress(40, "Program Tree Merge is processing change IDs...");
|
mergeManager.updateProgress(40, "Program Tree Merge is processing change IDs...");
|
||||||
ArrayList<Long> latestChangeList = new ArrayList<Long>();
|
ArrayList<Long> latestChangeList = new ArrayList<Long>();
|
||||||
for (long latestChangeID : latestChangeIDs) {
|
for (long latestChangeID : latestChangeIDs) {
|
||||||
latestChangeList.add(new Long(latestChangeID));
|
latestChangeList.add(Long.valueOf(latestChangeID));
|
||||||
}
|
}
|
||||||
|
|
||||||
mergeManager.updateProgress(50,
|
mergeManager.updateProgress(50,
|
||||||
|
@ -115,7 +115,7 @@ public abstract class AbstractDemanglerAnalyzer extends AbstractAnalyzer {
|
|||||||
// consider copying primary symbols to alt storage for iteration
|
// consider copying primary symbols to alt storage for iteration
|
||||||
SymbolIterator it = symbolTable.getPrimarySymbolIterator(set, true);
|
SymbolIterator it = symbolTable.getPrimarySymbolIterator(set, true);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (++count % 100 == 0) {
|
if (++count % 100 == 0) {
|
||||||
monitor.setMessage(baseMonitorMessage + " - " + count + " symbols");
|
monitor.setMessage(baseMonitorMessage + " - " + count + " symbols");
|
||||||
|
@ -1369,11 +1369,11 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
|
|||||||
throw new UnsupportedOperationException(
|
throw new UnsupportedOperationException(
|
||||||
"AutoAnalysisManager.scheduleWorker may not be invoked from Swing thread");
|
"AutoAnalysisManager.scheduleWorker may not be invoked from Swing thread");
|
||||||
}
|
}
|
||||||
workerMonitor.checkCanceled();
|
workerMonitor.checkCancelled();
|
||||||
|
|
||||||
AnalysisWorkerCommand cmd =
|
AnalysisWorkerCommand cmd =
|
||||||
new AnalysisWorkerCommand(worker, workerContext, analyzeChanges, workerMonitor);
|
new AnalysisWorkerCommand(worker, workerContext, analyzeChanges, workerMonitor);
|
||||||
workerMonitor.checkCanceled();
|
workerMonitor.checkCancelled();
|
||||||
|
|
||||||
// NOTE: It is very important that the worker cmd not run concurrent with analysis
|
// NOTE: It is very important that the worker cmd not run concurrent with analysis
|
||||||
if (SystemUtilities.isInHeadlessMode()) {
|
if (SystemUtilities.isInHeadlessMode()) {
|
||||||
@ -1402,7 +1402,7 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
workerMonitor.checkCanceled();
|
workerMonitor.checkCancelled();
|
||||||
Msg.debug(this, "Analysis worker completed (" + cmd.worker.getWorkerName() + "): " +
|
Msg.debug(this, "Analysis worker completed (" + cmd.worker.getWorkerName() + "): " +
|
||||||
cmd.worker.getClass());
|
cmd.worker.getClass());
|
||||||
|
|
||||||
@ -1556,11 +1556,11 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
|
|||||||
public long getMaximum() {
|
public long getMaximum() {
|
||||||
return Math.max(primaryMonitor.getMaximum(), secondaryMonitor.getMaximum());
|
return Math.max(primaryMonitor.getMaximum(), secondaryMonitor.getMaximum());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkCanceled() throws CancelledException {
|
public void checkCanceled() throws CancelledException {
|
||||||
primaryMonitor.checkCanceled();
|
primaryMonitor.checkCancelled();
|
||||||
secondaryMonitor.checkCanceled();
|
secondaryMonitor.checkCancelled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1603,8 +1603,8 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clearCanceled() {
|
public void clearCanceled() {
|
||||||
primaryMonitor.clearCanceled();
|
primaryMonitor.clearCancelled();
|
||||||
secondaryMonitor.clearCanceled();
|
secondaryMonitor.clearCancelled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1747,7 +1747,7 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
|
|||||||
analysisMonitor.removeCancelledListener(this);
|
analysisMonitor.removeCancelledListener(this);
|
||||||
analysisMonitor.setCancelEnabled(true);
|
analysisMonitor.setCancelEnabled(true);
|
||||||
// prevent cancel from affecting other queued analysis
|
// prevent cancel from affecting other queued analysis
|
||||||
analysisMonitor.clearCanceled();
|
analysisMonitor.clearCancelled();
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
@ -252,7 +252,7 @@ public class ConstantPropagationAnalyzer extends AbstractAnalyzer {
|
|||||||
AddressSet inBodySet = new AddressSet();
|
AddressSet inBodySet = new AddressSet();
|
||||||
Iterator<Function> fiter = program.getFunctionManager().getFunctionsOverlapping(set);
|
Iterator<Function> fiter = program.getFunctionManager().getFunctionsOverlapping(set);
|
||||||
while (fiter.hasNext()) {
|
while (fiter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function function = fiter.next();
|
Function function = fiter.next();
|
||||||
locations.add(function.getEntryPoint());
|
locations.add(function.getEntryPoint());
|
||||||
inBodySet.add(function.getBody());
|
inBodySet.add(function.getBody());
|
||||||
@ -268,7 +268,7 @@ public class ConstantPropagationAnalyzer extends AbstractAnalyzer {
|
|||||||
|
|
||||||
AddressSet outOfBodySet = new AddressSet();
|
AddressSet outOfBodySet = new AddressSet();
|
||||||
while (referenceDestinationIterator.hasNext()) {
|
while (referenceDestinationIterator.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address address = referenceDestinationIterator.next();
|
Address address = referenceDestinationIterator.next();
|
||||||
ReferenceIterator referencesTo = referenceManager.getReferencesTo(address);
|
ReferenceIterator referencesTo = referenceManager.getReferencesTo(address);
|
||||||
while (referencesTo.hasNext()) {
|
while (referencesTo.hasNext()) {
|
||||||
@ -290,7 +290,7 @@ public class ConstantPropagationAnalyzer extends AbstractAnalyzer {
|
|||||||
outOfBodySet = new AddressSet();
|
outOfBodySet = new AddressSet();
|
||||||
AddressRangeIterator addressRanges = set.getAddressRanges();
|
AddressRangeIterator addressRanges = set.getAddressRanges();
|
||||||
while (addressRanges.hasNext()) {
|
while (addressRanges.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
AddressRange addressRange = addressRanges.next();
|
AddressRange addressRange = addressRanges.next();
|
||||||
locations.add(addressRange.getMinAddress());
|
locations.add(addressRange.getMinAddress());
|
||||||
outOfBodySet.add(addressRange.getMinAddress());
|
outOfBodySet.add(addressRange.getMinAddress());
|
||||||
@ -315,7 +315,7 @@ public class ConstantPropagationAnalyzer extends AbstractAnalyzer {
|
|||||||
protected AddressSetView runAddressAnalysis(final Program program, final Set<Address> locations,
|
protected AddressSetView runAddressAnalysis(final Program program, final Set<Address> locations,
|
||||||
final TaskMonitor monitor) throws CancelledException, InterruptedException, Exception {
|
final TaskMonitor monitor) throws CancelledException, InterruptedException, Exception {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
final AddressSet analyzedSet = new AddressSet();
|
final AddressSet analyzedSet = new AddressSet();
|
||||||
if (locations.isEmpty()) {
|
if (locations.isEmpty()) {
|
||||||
@ -391,7 +391,7 @@ public class ConstantPropagationAnalyzer extends AbstractAnalyzer {
|
|||||||
Listing listing = program.getListing();
|
Listing listing = program.getListing();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while (!todoSet.isEmpty()) {
|
while (!todoSet.isEmpty()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if ((count++ % NOTIFICATION_INTERVAL) == 0) {
|
if ((count++ % NOTIFICATION_INTERVAL) == 0) {
|
||||||
monitor.setProgress(totalNumAddresses - todoSet.getNumAddresses());
|
monitor.setProgress(totalNumAddresses - todoSet.getNumAddresses());
|
||||||
@ -446,7 +446,7 @@ public class ConstantPropagationAnalyzer extends AbstractAnalyzer {
|
|||||||
public AddressSetView analyzeLocation(final Program program, Address start, AddressSetView set,
|
public AddressSetView analyzeLocation(final Program program, Address start, AddressSetView set,
|
||||||
final TaskMonitor monitor) throws CancelledException {
|
final TaskMonitor monitor) throws CancelledException {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
// get the function body
|
// get the function body
|
||||||
if (program.getListing().getInstructionAt(start) == null) {
|
if (program.getListing().getInstructionAt(start) == null) {
|
||||||
|
@ -120,7 +120,7 @@ public class FindNoReturnFunctionsAnalyzer extends AbstractAnalyzer {
|
|||||||
// mark all detected non-returning functions
|
// mark all detected non-returning functions
|
||||||
AddressIterator noreturns = noReturnSet.getAddresses(true);
|
AddressIterator noreturns = noReturnSet.getAddresses(true);
|
||||||
for (Address address : noreturns) {
|
for (Address address : noreturns) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
setFunctionNonReturning(program, address);
|
setFunctionNonReturning(program, address);
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ public class FindNoReturnFunctionsAnalyzer extends AbstractAnalyzer {
|
|||||||
AddressIterator refIter =
|
AddressIterator refIter =
|
||||||
cp.getReferenceManager().getReferenceSourceIterator(checkSet, true);
|
cp.getReferenceManager().getReferenceSourceIterator(checkSet, true);
|
||||||
for (Address address : refIter) {
|
for (Address address : refIter) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
// instruction may have already been checked from a non-returning call
|
// instruction may have already been checked from a non-returning call
|
||||||
if (checkedSet.contains(address)) {
|
if (checkedSet.contains(address)) {
|
||||||
|
@ -207,7 +207,7 @@ public class MachoFunctionStartsAnalyzer extends AbstractAnalyzer {
|
|||||||
monitor.initialize(mappedImages.size());
|
monitor.initialize(mappedImages.size());
|
||||||
for (DyldCacheImage mappedImage : mappedImages) {
|
for (DyldCacheImage mappedImage : mappedImages) {
|
||||||
String name = new File(mappedImage.getPath()).getName();
|
String name = new File(mappedImage.getPath()).getName();
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.setMessage("Analyzing function starts for " + name + "...");
|
monitor.setMessage("Analyzing function starts for " + name + "...");
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ public class MachoFunctionStartsAnalyzer extends AbstractAnalyzer {
|
|||||||
List<FunctionStartsCommand> commands = header.getLoadCommands(FunctionStartsCommand.class);
|
List<FunctionStartsCommand> commands = header.getLoadCommands(FunctionStartsCommand.class);
|
||||||
for (FunctionStartsCommand cmd : commands) {
|
for (FunctionStartsCommand cmd : commands) {
|
||||||
for (Address addr : cmd.findFunctionStartAddrs(provider, textSegmentAddr)) {
|
for (Address addr : cmd.findFunctionStartAddrs(provider, textSegmentAddr)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (!set.contains(textSegmentAddr)) {
|
if (!set.contains(textSegmentAddr)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ public class OperandReferenceAnalyzer extends AbstractAnalyzer {
|
|||||||
AddressSet checkedTargets = new AddressSet();
|
AddressSet checkedTargets = new AddressSet();
|
||||||
|
|
||||||
while (iter.hasNext() && !newCodeFound) {
|
while (iter.hasNext() && !newCodeFound) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Address addr = iter.next();
|
Address addr = iter.next();
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ public class PercentAnalyzedValidator extends PostAnalysisValidator {
|
|||||||
instCount += length;
|
instCount += length;
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
DataIterator dataIter = prog.getListing().getData(execMemSetInitialized, true);
|
DataIterator dataIter = prog.getListing().getData(execMemSetInitialized, true);
|
||||||
int dataCount = 0;
|
int dataCount = 0;
|
||||||
|
@ -99,7 +99,7 @@ class BookmarkTableModel extends AddressBasedTableModel<BookmarkRowObject> {
|
|||||||
monitor.initialize(getIteratorKeyCount());
|
monitor.initialize(getIteratorKeyCount());
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.setProgress(i++);
|
monitor.setProgress(i++);
|
||||||
long key = it.next();
|
long key = it.next();
|
||||||
accumulator.add(new BookmarkRowObject(key));
|
accumulator.add(new BookmarkRowObject(key));
|
||||||
|
@ -80,7 +80,7 @@ public abstract class CallNode extends GTreeSlowLoadingNode {
|
|||||||
ReferenceManager referenceManager = program.getReferenceManager();
|
ReferenceManager referenceManager = program.getReferenceManager();
|
||||||
AddressIterator addressIterator = addresses.getAddresses(true);
|
AddressIterator addressIterator = addresses.getAddresses(true);
|
||||||
while (addressIterator.hasNext()) {
|
while (addressIterator.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address address = addressIterator.next();
|
Address address = addressIterator.next();
|
||||||
Reference[] referencesFrom = referenceManager.getReferencesFrom(address);
|
Reference[] referencesFrom = referenceManager.getReferencesFrom(address);
|
||||||
if (referencesFrom != null) {
|
if (referencesFrom != null) {
|
||||||
|
@ -93,7 +93,7 @@ public class IncomingCallNode extends CallNode {
|
|||||||
LazyMap.lazyMap(new HashMap<>(), k -> new ArrayList<>());
|
LazyMap.lazyMap(new HashMap<>(), k -> new ArrayList<>());
|
||||||
FunctionManager functionManager = program.getFunctionManager();
|
FunctionManager functionManager = program.getFunctionManager();
|
||||||
for (Address fromAddress : addresses) {
|
for (Address fromAddress : addresses) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function callerFunction = functionManager.getFunctionContaining(fromAddress);
|
Function callerFunction = functionManager.getFunctionContaining(fromAddress);
|
||||||
if (callerFunction == null) {
|
if (callerFunction == null) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -82,7 +82,7 @@ public abstract class OutgoingCallNode extends CallNode {
|
|||||||
LazyMap.lazyMap(new HashMap<>(), k -> new ArrayList<>());
|
LazyMap.lazyMap(new HashMap<>(), k -> new ArrayList<>());
|
||||||
FunctionManager functionManager = program.getFunctionManager();
|
FunctionManager functionManager = program.getFunctionManager();
|
||||||
for (Reference reference : references) {
|
for (Reference reference : references) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address toAddress = reference.getToAddress();
|
Address toAddress = reference.getToAddress();
|
||||||
if (toAddress.equals(entryPoint)) {
|
if (toAddress.equals(entryPoint)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -163,7 +163,7 @@ public class ClearCmd extends BackgroundCommand {
|
|||||||
Address rangeMin = range.getMinAddress();
|
Address rangeMin = range.getMinAddress();
|
||||||
SymbolIterator symbolIter = symbolTable.getSymbolIterator(rangeMin, true);
|
SymbolIterator symbolIter = symbolTable.getSymbolIterator(rangeMin, true);
|
||||||
while (symbolIter.hasNext()) {
|
while (symbolIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Symbol s = symbolIter.next();
|
Symbol s = symbolIter.next();
|
||||||
if (s.getAddress().compareTo(range.getMaxAddress()) > 0) {
|
if (s.getAddress().compareTo(range.getMaxAddress()) > 0) {
|
||||||
break; // done with range
|
break; // done with range
|
||||||
@ -201,7 +201,7 @@ public class ClearCmd extends BackgroundCommand {
|
|||||||
int progress = 0;
|
int progress = 0;
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
AddressRange range = iter.next();
|
AddressRange range = iter.next();
|
||||||
listing.clearComments(range.getMinAddress(), range.getMaxAddress());
|
listing.clearComments(range.getMinAddress(), range.getMaxAddress());
|
||||||
progress += range.getLength();
|
progress += range.getLength();
|
||||||
@ -238,7 +238,7 @@ public class ClearCmd extends BackgroundCommand {
|
|||||||
FunctionIterator iter = manager.getFunctions(clearView, true);
|
FunctionIterator iter = manager.getFunctions(clearView, true);
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function func = iter.next();
|
Function func = iter.next();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
manager.removeFunction(func.getEntryPoint());
|
manager.removeFunction(func.getEntryPoint());
|
||||||
@ -267,7 +267,7 @@ public class ClearCmd extends BackgroundCommand {
|
|||||||
Iterator<Equate> iter = eqtbl.getEquates();
|
Iterator<Equate> iter = eqtbl.getEquates();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Equate eq = iter.next();
|
Equate eq = iter.next();
|
||||||
EquateReference[] refs = eq.getReferences();
|
EquateReference[] refs = eq.getReferences();
|
||||||
|
|
||||||
@ -354,7 +354,7 @@ public class ClearCmd extends BackgroundCommand {
|
|||||||
private void removeRegisters(ProgramContext pc, AddressRange range, TaskMonitor monitor)
|
private void removeRegisters(ProgramContext pc, AddressRange range, TaskMonitor monitor)
|
||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
for (Register reg : pc.getRegistersWithValues()) {
|
for (Register reg : pc.getRegistersWithValues()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (reg.isProcessorContext()) {
|
if (reg.isProcessorContext()) {
|
||||||
continue; // skip context register
|
continue; // skip context register
|
||||||
@ -372,7 +372,7 @@ public class ClearCmd extends BackgroundCommand {
|
|||||||
Set<SourceType> sourceTypesToClear, TaskMonitor monitor) throws CancelledException {
|
Set<SourceType> sourceTypesToClear, TaskMonitor monitor) throws CancelledException {
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Address addr = iter.next();
|
Address addr = iter.next();
|
||||||
Reference[] refs = refMgr.getReferencesFrom(addr);
|
Reference[] refs = refMgr.getReferencesFrom(addr);
|
||||||
|
@ -102,7 +102,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
clearSet = new AddressSet();
|
clearSet = new AddressSet();
|
||||||
|
|
||||||
while (cuIter.hasNext()) {
|
while (cuIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
CodeUnit cu = cuIter.next();
|
CodeUnit cu = cuIter.next();
|
||||||
if (cu instanceof Instruction) {
|
if (cu instanceof Instruction) {
|
||||||
Instruction instr = (Instruction) cu;
|
Instruction instr = (Instruction) cu;
|
||||||
@ -157,7 +157,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
HashSet<Address> ptrDestinations = new HashSet<>();
|
HashSet<Address> ptrDestinations = new HashSet<>();
|
||||||
|
|
||||||
while (!todoStarts.isEmpty()) {
|
while (!todoStarts.isEmpty()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = todoStarts.pop();
|
Address addr = todoStarts.pop();
|
||||||
if (clearSet.contains(addr)) {
|
if (clearSet.contains(addr)) {
|
||||||
continue;
|
continue;
|
||||||
@ -214,7 +214,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
SymbolTable symTable = program.getSymbolTable();
|
SymbolTable symTable = program.getSymbolTable();
|
||||||
Iterator<Address> iter = ptrDestinations.iterator();
|
Iterator<Address> iter = ptrDestinations.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = iter.next();
|
Address addr = iter.next();
|
||||||
Symbol[] syms = symTable.getSymbols(addr);
|
Symbol[] syms = symTable.getSymbols(addr);
|
||||||
for (Symbol sym : syms) {
|
for (Symbol sym : syms) {
|
||||||
@ -259,7 +259,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
|
|
||||||
ReferenceIterator refIter = refMgr.getReferencesTo(destAddr);
|
ReferenceIterator refIter = refMgr.getReferencesTo(destAddr);
|
||||||
while (refIter.hasNext()) {
|
while (refIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Reference ref = refIter.next();
|
Reference ref = refIter.next();
|
||||||
RefType refType = ref.getReferenceType();
|
RefType refType = ref.getReferenceType();
|
||||||
if (refType instanceof FlowType) {
|
if (refType instanceof FlowType) {
|
||||||
@ -290,7 +290,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
|
|
||||||
AddressIterator fromAddrIter = refMgr.getReferenceSourceIterator(refFromSet, true);
|
AddressIterator fromAddrIter = refMgr.getReferenceSourceIterator(refFromSet, true);
|
||||||
while (fromAddrIter.hasNext()) {
|
while (fromAddrIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Address fromAddr = fromAddrIter.next();
|
Address fromAddr = fromAddrIter.next();
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
boolean clearIt = true;
|
boolean clearIt = true;
|
||||||
ReferenceIterator refIter = refMgr.getReferencesTo(toAddr);
|
ReferenceIterator refIter = refMgr.getReferencesTo(toAddr);
|
||||||
while (refIter.hasNext()) {
|
while (refIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Reference ref = refIter.next();
|
Reference ref = refIter.next();
|
||||||
if (!clearSet.contains(ref.getFromAddress())) {
|
if (!clearSet.contains(ref.getFromAddress())) {
|
||||||
clearIt = false;
|
clearIt = false;
|
||||||
@ -423,13 +423,13 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
}
|
}
|
||||||
AddressIterator addrIter = refMgr.getReferenceDestinationIterator(clearSet, true);
|
AddressIterator addrIter = refMgr.getReferenceDestinationIterator(clearSet, true);
|
||||||
while (addrIter.hasNext()) {
|
while (addrIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = addrIter.next();
|
Address addr = addrIter.next();
|
||||||
ReferenceIterator refIter = refMgr.getReferencesTo(addr);
|
ReferenceIterator refIter = refMgr.getReferencesTo(addr);
|
||||||
|
|
||||||
Address dataRefAddr = null;
|
Address dataRefAddr = null;
|
||||||
while (refIter.hasNext()) {
|
while (refIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Reference ref = refIter.next();
|
Reference ref = refIter.next();
|
||||||
RefType refType = ref.getReferenceType();
|
RefType refType = ref.getReferenceType();
|
||||||
if (refType.isFlow()) {
|
if (refType.isFlow()) {
|
||||||
@ -464,7 +464,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
// get any in the clear set that were entry points
|
// get any in the clear set that were entry points
|
||||||
AddressIterator aiter = clearSet.getAddresses(true);
|
AddressIterator aiter = clearSet.getAddresses(true);
|
||||||
while (aiter.hasNext()) {
|
while (aiter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = aiter.next();
|
Address addr = aiter.next();
|
||||||
if (program.getSymbolTable().isExternalEntryPoint(addr)) {
|
if (program.getSymbolTable().isExternalEntryPoint(addr)) {
|
||||||
disassemblePoints.addRange(addr, addr);
|
disassemblePoints.addRange(addr, addr);
|
||||||
@ -478,7 +478,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
cmd.setSeedContext(seedContext);
|
cmd.setSeedContext(seedContext);
|
||||||
cmd.applyTo(program, monitor);
|
cmd.applyTo(program, monitor);
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
// Analyze new data reference points (DisassembleCommand has already analyzed code)
|
// Analyze new data reference points (DisassembleCommand has already analyzed code)
|
||||||
AutoAnalysisManager analysisMgr = AutoAnalysisManager.getAnalysisManager(program);
|
AutoAnalysisManager analysisMgr = AutoAnalysisManager.getAnalysisManager(program);
|
||||||
@ -503,7 +503,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
|
|
||||||
AddressRangeIterator rangeIter = clearSet.getAddressRanges();
|
AddressRangeIterator rangeIter = clearSet.getAddressRanges();
|
||||||
while (rangeIter.hasNext()) {
|
while (rangeIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
AddressRange range = rangeIter.next();
|
AddressRange range = rangeIter.next();
|
||||||
Address addr = range.getMinAddress();
|
Address addr = range.getMinAddress();
|
||||||
int searchCnt = 0;
|
int searchCnt = 0;
|
||||||
@ -572,7 +572,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
|
|
||||||
Iterator<Function> fnIter = fnMgr.getFunctionsOverlapping(sub);
|
Iterator<Function> fnIter = fnMgr.getFunctionsOverlapping(sub);
|
||||||
while (fnIter.hasNext()) {
|
while (fnIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function f = fnIter.next();
|
Function f = fnIter.next();
|
||||||
if (!starts.contains(f.getEntryPoint())) {
|
if (!starts.contains(f.getEntryPoint())) {
|
||||||
Msg.warn(this,
|
Msg.warn(this,
|
||||||
@ -583,7 +583,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
|
|
||||||
fnIter = fnMgr.getFunctionsOverlapping(sub);
|
fnIter = fnMgr.getFunctionsOverlapping(sub);
|
||||||
while (fnIter.hasNext()) {
|
while (fnIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function f = fnIter.next();
|
Function f = fnIter.next();
|
||||||
if (starts.remove(f.getEntryPoint())) {
|
if (starts.remove(f.getEntryPoint())) {
|
||||||
AddressSetView oldBody = f.getBody();
|
AddressSetView oldBody = f.getBody();
|
||||||
@ -606,7 +606,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
|
|
||||||
Iterator<Address> entryIter = starts.iterator();
|
Iterator<Address> entryIter = starts.iterator();
|
||||||
while (entryIter.hasNext()) {
|
while (entryIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address entry = entryIter.next();
|
Address entry = entryIter.next();
|
||||||
CreateFunctionCmd cmd = new CreateFunctionCmd(entry);
|
CreateFunctionCmd cmd = new CreateFunctionCmd(entry);
|
||||||
cmd.applyTo(program, monitor);
|
cmd.applyTo(program, monitor);
|
||||||
@ -670,7 +670,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
|
|
||||||
// Follow start block flow and build graph
|
// Follow start block flow and build graph
|
||||||
while (!todoVertices.isEmpty()) {
|
while (!todoVertices.isEmpty()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
BlockVertex fromVertex = todoVertices.pop();
|
BlockVertex fromVertex = todoVertices.pop();
|
||||||
CodeBlock fromBlock = fromVertex.block;
|
CodeBlock fromBlock = fromVertex.block;
|
||||||
if (protectedSet.contains(fromBlock.getMinAddress())) {
|
if (protectedSet.contains(fromBlock.getMinAddress())) {
|
||||||
@ -685,7 +685,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
findDestAddrs(fromBlock, destAddrs); // Needed for detecting offcut flows
|
findDestAddrs(fromBlock, destAddrs); // Needed for detecting offcut flows
|
||||||
}
|
}
|
||||||
while (blockRefIter.hasNext()) {
|
while (blockRefIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
CodeBlockReference cbRef = blockRefIter.next();
|
CodeBlockReference cbRef = blockRefIter.next();
|
||||||
|
|
||||||
Address blockAddr = cbRef.getReference();
|
Address blockAddr = cbRef.getReference();
|
||||||
@ -744,7 +744,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
FunctionManager functionManager = program.getFunctionManager();
|
FunctionManager functionManager = program.getFunctionManager();
|
||||||
Iterator<BlockVertex> vertexIter = vertexMap.values().iterator();
|
Iterator<BlockVertex> vertexIter = vertexMap.values().iterator();
|
||||||
while (vertexIter.hasNext()) {
|
while (vertexIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
BlockVertex v = vertexIter.next();
|
BlockVertex v = vertexIter.next();
|
||||||
if (v == startVertex || v.srcVertices.isEmpty()) {
|
if (v == startVertex || v.srcVertices.isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
@ -768,7 +768,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
while (refIter.hasNext()) {
|
while (refIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Reference ref = refIter.next();
|
Reference ref = refIter.next();
|
||||||
Address fromAddr = ref.getFromAddress();
|
Address fromAddr = ref.getFromAddress();
|
||||||
RefType refType = ref.getReferenceType();
|
RefType refType = ref.getReferenceType();
|
||||||
@ -819,7 +819,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
Listing listing = program.getListing();
|
Listing listing = program.getListing();
|
||||||
InstructionIterator iter = listing.getInstructions(destBlock.getMinAddress(), true);
|
InstructionIterator iter = listing.getInstructions(destBlock.getMinAddress(), true);
|
||||||
while (iter.hasNext() && offcutStart == null) {
|
while (iter.hasNext() && offcutStart == null) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Instruction nextInstr = iter.next();
|
Instruction nextInstr = iter.next();
|
||||||
Address nextInstrAddr = nextInstr.getMinAddress();
|
Address nextInstrAddr = nextInstr.getMinAddress();
|
||||||
if (nextInstrAddr.compareTo(blockEnd) > 0) {
|
if (nextInstrAddr.compareTo(blockEnd) > 0) {
|
||||||
@ -846,7 +846,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
Program program = offcutInstr.getProgram();
|
Program program = offcutInstr.getProgram();
|
||||||
Listing listing = program.getListing();
|
Listing listing = program.getListing();
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
// Record outgoing flows as new starts for clearing
|
// Record outgoing flows as new starts for clearing
|
||||||
Reference[] refs = offcutInstr.getReferencesFrom();
|
Reference[] refs = offcutInstr.getReferencesFrom();
|
||||||
@ -897,7 +897,7 @@ public class ClearFlowAndRepairCmd extends BackgroundCommand {
|
|||||||
// Check data fall-through locations for bookmarks
|
// Check data fall-through locations for bookmarks
|
||||||
Listing listing = program.getListing();
|
Listing listing = program.getListing();
|
||||||
for (AddressRange range : set.getAddressRanges()) {
|
for (AddressRange range : set.getAddressRanges()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address maxAddr = range.getMaxAddress();
|
Address maxAddr = range.getMaxAddress();
|
||||||
Instruction lastInstr = listing.getInstructionContaining(maxAddr);
|
Instruction lastInstr = listing.getInstructionContaining(maxAddr);
|
||||||
if (lastInstr == null) {
|
if (lastInstr == null) {
|
||||||
|
@ -176,7 +176,7 @@ public class CodeBrowserSelectionPlugin extends Plugin {
|
|||||||
"\".");
|
"\".");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
CodeUnit cu = iterator.next();
|
CodeUnit cu = iterator.next();
|
||||||
accumulator.add(cu.getMinAddress());
|
accumulator.add(cu.getMinAddress());
|
||||||
monitor.incrementProgress(cu.getLength());
|
monitor.incrementProgress(cu.getLength());
|
||||||
|
@ -414,7 +414,7 @@ public abstract class CompEditorModel extends CompositeEditorModel {
|
|||||||
|
|
||||||
monitor.initialize(entries);
|
monitor.initialize(entries);
|
||||||
for (int rowIndex = endRowIndex; rowIndex >= startRowIndex; rowIndex--) {
|
for (int rowIndex = endRowIndex; rowIndex >= startRowIndex; rowIndex--) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
int componentOrdinal = convertRowToOrdinal(rowIndex);
|
int componentOrdinal = convertRowToOrdinal(rowIndex);
|
||||||
ordinals.add(componentOrdinal);
|
ordinals.add(componentOrdinal);
|
||||||
if (componentOrdinal < row) {
|
if (componentOrdinal < row) {
|
||||||
|
@ -920,7 +920,7 @@ class StructureEditorModel extends CompEditorModel {
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
for (int i = 0; i < numCopies; i++) {
|
for (int i = 0; i < numCopies; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.setMessage("Inserting " + (i + 1) + " of " + numCopies);
|
monitor.setMessage("Inserting " + (i + 1) + " of " + numCopies);
|
||||||
viewComposite.insert(componentOrdinal, dataType, length);
|
viewComposite.insert(componentOrdinal, dataType, length);
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
@ -398,7 +398,7 @@ class UnionEditorModel extends CompEditorModel {
|
|||||||
|
|
||||||
monitor.initialize(numCopies);
|
monitor.initialize(numCopies);
|
||||||
for (int i = 0; i < numCopies; i++) {
|
for (int i = 0; i < numCopies; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
insert(rowIndex + i, dataType, length, null, null);
|
insert(rowIndex + i, dataType, length, null, null);
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ public class DataSettingsDialog extends AbstractSettingsDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (!defClasses.isEmpty() && definedData.hasNext()) {
|
while (!defClasses.isEmpty() && definedData.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
d = definedData.next();
|
d = definedData.next();
|
||||||
removeMissingDefinitions(defClasses, defs,
|
removeMissingDefinitions(defClasses, defs,
|
||||||
d.getDataType().getSettingsDefinitions());
|
d.getDataType().getSettingsDefinitions());
|
||||||
@ -170,7 +170,7 @@ public class DataSettingsDialog extends AbstractSettingsDialog {
|
|||||||
int fromIndex = from[from.length - 1];
|
int fromIndex = from[from.length - 1];
|
||||||
int toIndex = to[to.length - 1];
|
int toIndex = to[to.length - 1];
|
||||||
for (int i = fromIndex; i <= toIndex; i++) {
|
for (int i = fromIndex; i <= toIndex; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
dataComp = parent.getComponent(i);
|
dataComp = parent.getComponent(i);
|
||||||
if (dataComp == null) {
|
if (dataComp == null) {
|
||||||
break;
|
break;
|
||||||
@ -253,7 +253,7 @@ public class DataSettingsDialog extends AbstractSettingsDialog {
|
|||||||
if (interiorSelection == null) {
|
if (interiorSelection == null) {
|
||||||
DataIterator definedData = program.getListing().getDefinedData(selection, true);
|
DataIterator definedData = program.getListing().getDefinedData(selection, true);
|
||||||
while (definedData.hasNext()) {
|
while (definedData.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Data d = definedData.next();
|
Data d = definedData.next();
|
||||||
applySettingsToData(dlg, d);
|
applySettingsToData(dlg, d);
|
||||||
monitor.incrementProgress(d.getLength());
|
monitor.incrementProgress(d.getLength());
|
||||||
@ -274,7 +274,7 @@ public class DataSettingsDialog extends AbstractSettingsDialog {
|
|||||||
|
|
||||||
monitor.initialize(toIndex - fromIndex + 1);
|
monitor.initialize(toIndex - fromIndex + 1);
|
||||||
for (int i = fromIndex; i <= toIndex; i++) {
|
for (int i = fromIndex; i <= toIndex; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
dataComp = parent.getComponent(i);
|
dataComp = parent.getComponent(i);
|
||||||
if (dataComp == null) {
|
if (dataComp == null) {
|
||||||
break;
|
break;
|
||||||
|
@ -121,7 +121,7 @@ public class TypeGraphTask extends Task {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (DataTypeComponent inner : struct.getComponents()) {
|
for (DataTypeComponent inner : struct.getComponents()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
DataType dt = inner.getDataType();
|
DataType dt = inner.getDataType();
|
||||||
if (dt instanceof TypeDef) {
|
if (dt instanceof TypeDef) {
|
||||||
dt = ((TypeDef) dt).getBaseDataType();
|
dt = ((TypeDef) dt).getBaseDataType();
|
||||||
@ -138,7 +138,7 @@ public class TypeGraphTask extends Task {
|
|||||||
|
|
||||||
private void recursePointer(Pointer pointer, AttributedGraph graph, AttributedVertex lastVertex,
|
private void recursePointer(Pointer pointer, AttributedGraph graph, AttributedVertex lastVertex,
|
||||||
TaskMonitor monitor) throws CancelledException {
|
TaskMonitor monitor) throws CancelledException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
DataType ptrType = pointer.getDataType();
|
DataType ptrType = pointer.getDataType();
|
||||||
if (ptrType == null) {
|
if (ptrType == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -161,7 +161,7 @@ public class DisassociateAction extends DockingAction {
|
|||||||
|
|
||||||
monitor.initialize(typesToDisassociate.size());
|
monitor.initialize(typesToDisassociate.size());
|
||||||
for (DataTypeSyncInfo info : typesToDisassociate) {
|
for (DataTypeSyncInfo info : typesToDisassociate) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.setMessage("Disassociating " + info.getName());
|
monitor.setMessage("Disassociating " + info.getName());
|
||||||
info.disassociate();
|
info.disassociate();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
@ -232,7 +232,7 @@ public class DisassociateDataTypeAction extends DockingAction {
|
|||||||
synchronizer.openTransactions();
|
synchronizer.openTransactions();
|
||||||
try {
|
try {
|
||||||
for (DataType dt : types) {
|
for (DataType dt : types) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.setMessage("Disassociating " + dt.getName());
|
monitor.setMessage("Disassociating " + dt.getName());
|
||||||
dtm.disassociate(dt);
|
dtm.disassociate(dt);
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
@ -202,7 +202,7 @@ public abstract class SyncAction extends DockingAction implements Comparable<Syn
|
|||||||
synchronizer.openTransactions();
|
synchronizer.openTransactions();
|
||||||
try {
|
try {
|
||||||
for (DataTypeSyncInfo info : selectedList) {
|
for (DataTypeSyncInfo info : selectedList) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.setMessage("Syncing " + info.getName());
|
monitor.setMessage("Syncing " + info.getName());
|
||||||
applyOperation(info);
|
applyOperation(info);
|
||||||
outOfSynchDataTypes.remove(info);
|
outOfSynchDataTypes.remove(info);
|
||||||
|
@ -214,7 +214,7 @@ public class DataTypeTreeCopyMoveTask extends Task {
|
|||||||
int txId = dtm.startTransaction("Associate Data Types");
|
int txId = dtm.startTransaction("Associate Data Types");
|
||||||
try {
|
try {
|
||||||
for (GTreeNode node : copyMoveNodes) {
|
for (GTreeNode node : copyMoveNodes) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (node instanceof DataTypeNode) {
|
if (node instanceof DataTypeNode) {
|
||||||
DataType dt = ((DataTypeNode) node).getDataType();
|
DataType dt = ((DataTypeNode) node).getDataType();
|
||||||
@ -256,7 +256,7 @@ public class DataTypeTreeCopyMoveTask extends Task {
|
|||||||
monitor.setMessage("Checking for types to associate");
|
monitor.setMessage("Checking for types to associate");
|
||||||
monitor.initialize(copyMoveNodes.size());
|
monitor.initialize(copyMoveNodes.size());
|
||||||
for (GTreeNode node : copyMoveNodes) {
|
for (GTreeNode node : copyMoveNodes) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (node instanceof DataTypeNode) {
|
if (node instanceof DataTypeNode) {
|
||||||
DataType dt = ((DataTypeNode) node).getDataType();
|
DataType dt = ((DataTypeNode) node).getDataType();
|
||||||
@ -281,7 +281,7 @@ public class DataTypeTreeCopyMoveTask extends Task {
|
|||||||
|
|
||||||
DataType[] types = cat.getDataTypes();
|
DataType[] types = cat.getDataTypes();
|
||||||
for (DataType dt : types) {
|
for (DataType dt : types) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (isLocal(dt)) {
|
if (isLocal(dt)) {
|
||||||
return true; // local means it is not associated
|
return true; // local means it is not associated
|
||||||
}
|
}
|
||||||
@ -289,7 +289,7 @@ public class DataTypeTreeCopyMoveTask extends Task {
|
|||||||
|
|
||||||
Category[] categories = cat.getCategories();
|
Category[] categories = cat.getCategories();
|
||||||
for (Category child : categories) {
|
for (Category child : categories) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (containsUnassociatedTypes(child, monitor)) {
|
if (containsUnassociatedTypes(child, monitor)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user