GP-3282 Separated out the concepts of whether or not a program was analyzed from the state of if the user should be asked to analyze on open

This commit is contained in:
ghidragon 2023-04-04 15:39:17 -04:00
parent 008c299fa3
commit bbadb4aed4
21 changed files with 215 additions and 152 deletions

View file

@ -95,8 +95,8 @@ public class VariableValueHoverPluginScreenShots extends GhidraScreenShotGenerat
protected void intoProject(DomainObject obj) {
waitForDomainObject(obj);
DomainFolder rootFolder = tool.getProject()
.getProjectData()
.getRootFolder();
.getProjectData()
.getRootFolder();
waitForCondition(() -> {
try {
rootFolder.createFile(obj.getName(), obj, monitor);
@ -141,7 +141,7 @@ public class VariableValueHoverPluginScreenShots extends GhidraScreenShotGenerat
try (Transaction tx = program.openTransaction("Assemble")) {
Address entry = addr(program, 0x00400000);
program.getMemory()
.createInitializedBlock(".text", entry, 0x1000, (byte) 0, monitor, false);
.createInitializedBlock(".text", entry, 0x1000, (byte) 0, monitor, false);
Assembler asm =
Assemblers.getAssembler(program.getLanguage(), StackUnwinderTest.NO_16BIT_CALLS);
AssemblyBuffer buf = new AssemblyBuffer(asm, entry);
@ -193,9 +193,9 @@ public class VariableValueHoverPluginScreenShots extends GhidraScreenShotGenerat
dis.disassemble(entry, null);
Function function = program.getFunctionManager()
.createFunction("fib", entry,
new AddressSet(entry, entry.add(bytes.length - 1)),
SourceType.USER_DEFINED);
.createFunction("fib", entry,
new AddressSet(entry, entry.add(bytes.length - 1)),
SourceType.USER_DEFINED);
function.updateFunction("__cdecl",
new ReturnParameterImpl(UnsignedIntegerDataType.dataType, program),
@ -231,7 +231,7 @@ public class VariableValueHoverPluginScreenShots extends GhidraScreenShotGenerat
DebuggerEmulationService emuService = addPlugin(tool, DebuggerEmulationServicePlugin.class);
Function function = createFibonacciProgramX86_32();
GhidraProgramUtilities.setAnalyzedFlag(program, true);
GhidraProgramUtilities.markProgramAnalyzed(program);
Address entry = function.getEntryPoint();
programManager.openProgram(program);
@ -271,9 +271,9 @@ public class VariableValueHoverPluginScreenShots extends GhidraScreenShotGenerat
try (Transaction tx = tb.startTransaction()) {
tb.trace.getBreakpointManager()
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), retInstr,
Set.of(),
Set.of(TraceBreakpointKind.SW_EXECUTE), true, "unwind stack");
.addBreakpoint("Breakpoints[0]", Lifespan.nowOn(0), retInstr,
Set.of(),
Set.of(TraceBreakpointKind.SW_EXECUTE), true, "unwind stack");
}
EmulationResult result = emuService.run(atSetup.getPlatform(), atSetup.getTime(), monitor,