mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-29 06:06:30 +08:00
GP-3026: Add Expression column to Breakpoints. Update/fix docs.
This commit is contained in:
+22
-8
@@ -44,7 +44,7 @@ import ghidra.test.ToyProgramBuilder;
|
||||
import ghidra.trace.database.ToyDBTraceBuilder;
|
||||
import ghidra.trace.database.breakpoint.DBTraceBreakpointManager;
|
||||
import ghidra.trace.model.*;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpointKind;
|
||||
import ghidra.trace.model.breakpoint.*;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
import help.screenshot.GhidraScreenShotGenerator;
|
||||
@@ -151,11 +151,20 @@ public class DebuggerBreakpointsPluginScreenShots extends GhidraScreenShotGenera
|
||||
long snap = tb1.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
|
||||
DBTraceBreakpointManager bm = tb1.trace.getBreakpointManager();
|
||||
bm.placeBreakpoint("Breakpoints[1]", snap, tb1.addr(0x00401234), List.of(),
|
||||
Set.of(TraceBreakpointKind.SW_EXECUTE), true, "ram:00401234");
|
||||
bm.placeBreakpoint("Breakpoints[2]", snap, tb1.range(0x00604321, 0x00604324),
|
||||
List.of(),
|
||||
Set.of(TraceBreakpointKind.WRITE), true, "ram:00604321");
|
||||
TraceBreakpointLocation locCx =
|
||||
bm.placeBreakpoint("Breakpoints[1]", snap, tb1.addr(0x00401234), List.of(),
|
||||
Set.of(TraceBreakpointKind.SW_EXECUTE), true, "");
|
||||
locCx.getSpecification()
|
||||
.getObject()
|
||||
.setAttribute(Lifespan.nowOn(snap), TraceBreakpointSpec.KEY_EXPRESSION,
|
||||
"*0x00401234");
|
||||
TraceBreakpointLocation locWr =
|
||||
bm.placeBreakpoint("Breakpoints[2]", snap, tb1.range(0x00604321, 0x00604324),
|
||||
List.of(), Set.of(TraceBreakpointKind.WRITE), true, "");
|
||||
locWr.getSpecification()
|
||||
.getObject()
|
||||
.setAttribute(Lifespan.nowOn(snap), TraceBreakpointSpec.KEY_EXPRESSION,
|
||||
"version");
|
||||
}
|
||||
|
||||
try (Transaction tx = tb2.startTransaction()) {
|
||||
@@ -164,8 +173,13 @@ public class DebuggerBreakpointsPluginScreenShots extends GhidraScreenShotGenera
|
||||
long snap = tb2.trace.getTimeManager().createSnapshot("First").getKey();
|
||||
|
||||
DBTraceBreakpointManager bm = tb2.trace.getBreakpointManager();
|
||||
bm.placeBreakpoint("Breakpoints[1]", snap, tb2.addr(0x7fac1234), List.of(),
|
||||
Set.of(TraceBreakpointKind.SW_EXECUTE), false, "ram:7fac1234");
|
||||
TraceBreakpointLocation locCx =
|
||||
bm.placeBreakpoint("Breakpoints[1]", snap, tb2.addr(0x7fac1234), List.of(),
|
||||
Set.of(TraceBreakpointKind.SW_EXECUTE), false, "");
|
||||
locCx.getSpecification()
|
||||
.getObject()
|
||||
.setAttribute(Lifespan.nowOn(snap), TraceBreakpointSpec.KEY_EXPRESSION,
|
||||
"*0x7fac1234");
|
||||
}
|
||||
|
||||
programManager.openProgram(program);
|
||||
|
||||
+6
-4
@@ -260,6 +260,7 @@ public class TutorialDebuggerScreenShots extends GhidraScreenShotGenerator
|
||||
|
||||
@Test
|
||||
public void testGettingStarted_ToolWSpecimen() {
|
||||
tool.getActiveWindow().requestFocus();
|
||||
captureToolWindow(1920, 1080);
|
||||
}
|
||||
|
||||
@@ -309,7 +310,7 @@ public class TutorialDebuggerScreenShots extends GhidraScreenShotGenerator
|
||||
public void testGettingStarted_DisassemblyAfterLaunch() throws Throwable {
|
||||
launchProgramInGdb();
|
||||
|
||||
Thread.sleep(7000);
|
||||
tool.getActiveWindow().requestFocus();
|
||||
captureToolWindow(1920, 1080);
|
||||
}
|
||||
|
||||
@@ -382,9 +383,9 @@ public class TutorialDebuggerScreenShots extends GhidraScreenShotGenerator
|
||||
Program prog = null;
|
||||
long snap = flatDbg.getCurrentSnap();
|
||||
try (LoadResults<Program> result = ProgramLoader.builder()
|
||||
.source(new File(module.getName(snap)))
|
||||
.project(env.getProject())
|
||||
.monitor(monitor)
|
||||
.source(new File(module.getName(snap)))
|
||||
.project(env.getProject())
|
||||
.monitor(monitor)
|
||||
.load()) {
|
||||
|
||||
result.save(monitor);
|
||||
@@ -442,6 +443,7 @@ public class TutorialDebuggerScreenShots extends GhidraScreenShotGenerator
|
||||
// Just to be sure.
|
||||
goTo(tool, progLibC, flatDbg.translateDynamicToStatic(dynAddr));
|
||||
|
||||
tool.getActiveWindow().requestFocus();
|
||||
captureToolWindow(1920, 1080);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user