mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-06-01 03:17:08 +08:00
GP-6312: Z3 persistence
This commit is contained in:
+5
-13
@@ -64,11 +64,9 @@ public class Z3SummaryProvider extends ComponentProviderAdapter {
|
|||||||
private final EmulatorStateListener emuListener = new EmulatorStateListener() {
|
private final EmulatorStateListener emuListener = new EmulatorStateListener() {
|
||||||
@Override
|
@Override
|
||||||
public void stopped(CachedEmulator emu) {
|
public void stopped(CachedEmulator emu) {
|
||||||
if (!(emu.emulator() instanceof SymZ3PcodeEmulator z3emu)) {
|
if (emu.emulator() instanceof SymZ3PcodeEmulator z3emu) {
|
||||||
setFactoryToZ3();
|
populateSummaryFromEmulator(z3emu);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
populateSummaryFromEmulator(z3emu);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -130,6 +128,7 @@ public class Z3SummaryProvider extends ComponentProviderAdapter {
|
|||||||
submainPanel.setRightComponent(summaryPanel);
|
submainPanel.setRightComponent(summaryPanel);
|
||||||
submainPanel.setLeftComponent(codePanel);
|
submainPanel.setLeftComponent(codePanel);
|
||||||
mainPanel.add(submainPanel);
|
mainPanel.add(submainPanel);
|
||||||
|
setFactoryToZ3();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateSummary() {
|
public void updateSummary() {
|
||||||
@@ -147,24 +146,17 @@ public class Z3SummaryProvider extends ComponentProviderAdapter {
|
|||||||
|
|
||||||
TraceSchedule time = current.getTime();
|
TraceSchedule time = current.getTime();
|
||||||
PcodeMachine<?> emu = emulationService.getCachedEmulator(trace, time);
|
PcodeMachine<?> emu = emulationService.getCachedEmulator(trace, time);
|
||||||
if (!(emu instanceof SymZ3PcodeEmulator z3Emu)) {
|
if (emu instanceof SymZ3PcodeEmulator z3Emu) {
|
||||||
/** LATER: It'd be nice if the summary were written down somewhere */
|
populateSummaryFromEmulator(z3Emu);
|
||||||
setFactoryToZ3();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
populateSummaryFromEmulator(z3Emu);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setFactoryToZ3() {
|
private void setFactoryToZ3() {
|
||||||
if (!this.isVisible()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Msg.info(this, "Resetting emulator to Z3 (summary open)");
|
Msg.info(this, "Resetting emulator to Z3 (summary open)");
|
||||||
for (EmulatorFactory factory : emulationService.getEmulatorFactories()) {
|
for (EmulatorFactory factory : emulationService.getEmulatorFactories()) {
|
||||||
if (factory instanceof SymZ3EmulatorFactory z3factory) {
|
if (factory instanceof SymZ3EmulatorFactory z3factory) {
|
||||||
emulationService.setEmulatorFactory(z3factory);
|
emulationService.setEmulatorFactory(z3factory);
|
||||||
emulationService.invalidateCache();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user