mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
Test debug
This commit is contained in:
parent
ca6bed02ee
commit
1a097da011
2 changed files with 16 additions and 0 deletions
|
@ -27,6 +27,7 @@ import ghidra.framework.options.*;
|
||||||
import ghidra.program.model.listing.Data;
|
import ghidra.program.model.listing.Data;
|
||||||
import ghidra.program.model.listing.Function;
|
import ghidra.program.model.listing.Function;
|
||||||
import ghidra.program.util.*;
|
import ghidra.program.util.*;
|
||||||
|
import ghidra.util.Msg;
|
||||||
import ghidra.util.classfinder.ClassSearcher;
|
import ghidra.util.classfinder.ClassSearcher;
|
||||||
|
|
||||||
public class AddressCorrelatorManager {
|
public class AddressCorrelatorManager {
|
||||||
|
@ -82,6 +83,16 @@ public class AddressCorrelatorManager {
|
||||||
correlatorList.addAll(initializeAddressCorrelators());
|
correlatorList.addAll(initializeAddressCorrelators());
|
||||||
|
|
||||||
correlatorList.sort(CORRELATOR_COMPARATOR);
|
correlatorList.sort(CORRELATOR_COMPARATOR);
|
||||||
|
|
||||||
|
StringBuilder buffy = new StringBuilder();
|
||||||
|
for (AddressCorrelator ac : correlatorList) {
|
||||||
|
buffy.append(ac.getClass().getSimpleName())
|
||||||
|
.append("; priority: ")
|
||||||
|
.append(ac.getPriority())
|
||||||
|
.append('\n');
|
||||||
|
}
|
||||||
|
|
||||||
|
Msg.trace(this, "Finished assembling correlators. Sorted list:\n" + buffy);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<AddressCorrelator> initializeAddressCorrelators() {
|
private List<AddressCorrelator> initializeAddressCorrelators() {
|
||||||
|
@ -101,9 +112,13 @@ public class AddressCorrelatorManager {
|
||||||
|
|
||||||
private AddressCorrelation getFunctionCorrelator(Function source, Function destination) {
|
private AddressCorrelation getFunctionCorrelator(Function source, Function destination) {
|
||||||
|
|
||||||
|
Msg.trace(this, "Source / Destination functions: " + source + "; " + destination);
|
||||||
|
|
||||||
for (AddressCorrelator correlator : correlatorList) {
|
for (AddressCorrelator correlator : correlatorList) {
|
||||||
|
Msg.trace(this, "\tchecking correlator: " + correlator.getClass().getSimpleName());
|
||||||
AddressCorrelation correlation = correlator.correlate(source, destination);
|
AddressCorrelation correlation = correlator.correlate(source, destination);
|
||||||
if (correlation != null) {
|
if (correlation != null) {
|
||||||
|
Msg.trace(this, "\t\tusing correlator: " + correlator);
|
||||||
return correlation;
|
return correlation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,6 +375,7 @@ public class AddressCorrelationTest extends AbstractGhidraHeadedIntegrationTest
|
||||||
boolean canBeNoAddress) {
|
boolean canBeNoAddress) {
|
||||||
Collection<VTMarkupItem> appliableMarkupItems =
|
Collection<VTMarkupItem> appliableMarkupItems =
|
||||||
controller.getMatchInfo(testMatch).getAppliableMarkupItems(TaskMonitor.DUMMY); // Initialize the cache.
|
controller.getMatchInfo(testMatch).getAppliableMarkupItems(TaskMonitor.DUMMY); // Initialize the cache.
|
||||||
|
|
||||||
for (VTMarkupItem vtMarkupItem : appliableMarkupItems) {
|
for (VTMarkupItem vtMarkupItem : appliableMarkupItems) {
|
||||||
Address markupDestAddress = vtMarkupItem.getDestinationAddress();
|
Address markupDestAddress = vtMarkupItem.getDestinationAddress();
|
||||||
boolean isNoAddress =
|
boolean isNoAddress =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue