GP-1706: Fixed mixed breakpoint cannot be toggled in dynamic listing

This commit is contained in:
Dan 2022-02-28 10:19:00 -05:00
parent c3c20d9e0f
commit 8870e58792
2 changed files with 15 additions and 1 deletions

View File

@ -965,7 +965,7 @@ public class DebuggerBreakpointMarkerPlugin extends Plugin
*/
Trace trace = getTraceFromContext(context);
boolean mapped = breakpointService.anyMapped(bs, trace);
Enablement toggled = en.getToggled(mapped);
Enablement toggled = en.getToggled(mapped && trace == null);
if (toggled.enabled) {
breakpointService.enableAll(bs, trace).exceptionally(ex -> {
breakpointError(title, "Could not enable breakpoints", ex);

View File

@ -498,6 +498,20 @@ public class DebuggerBreakpointMarkerPluginTest extends AbstractGhidraHeadedDebu
dynamicCtx(trace, addr(trace, 0x55550123)), true);
waitForPass(() -> assertEquals(Enablement.ENABLED, lb.computeEnablementForTrace(trace)));
lb.disable();
waitForPass(() -> assertEquals(Enablement.DISABLED, lb.computeEnablementForTrace(trace)));
performAction(breakpointMarkerPlugin.actionToggleBreakpoint,
dynamicCtx(trace, addr(trace, 0x55550123)), true);
waitForPass(
() -> assertEquals(Enablement.ENABLED_DISABLED, lb.computeEnablementForTrace(trace)));
performAction(breakpointMarkerPlugin.actionToggleBreakpoint,
dynamicCtx(trace, addr(trace, 0x55550123)), true);
waitForPass(() -> assertEquals(Enablement.DISABLED, lb.computeEnablementForTrace(trace)));
}
protected void testActionSetBreakpointProgram(DockingAction action,