From 3c71860d4a39080308db215d7fb4929c29231ba7 Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Tue, 27 Apr 2021 16:19:30 -0400 Subject: [PATCH 1/2] GP-0: Fixed LogicalBreakpointSerivceTest for new icons. --- .../breakpoint/LogicalBreakpointInternal.java | 5 +---- .../DebuggerLogicalBreakpointServiceTest.java | 22 +++++++++---------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/LogicalBreakpointInternal.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/LogicalBreakpointInternal.java index e224bc01b5..1b371cb91b 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/LogicalBreakpointInternal.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/LogicalBreakpointInternal.java @@ -117,7 +117,7 @@ interface LogicalBreakpointInternal extends LogicalBreakpoint { return ProgramEnablement.DISABLED; } else { - return ProgramEnablement.NONE; + return ProgramEnablement.MISSING; } } @@ -306,9 +306,6 @@ interface LogicalBreakpointInternal extends LogicalBreakpoint { public TraceEnablement computeEnablement() { TraceEnablement en = TraceEnablement.MISSING; - if (breakpoints.isEmpty()) { - return TraceEnablement.MISSING; - } for (IDHashed bpt : breakpoints) { en = en.combine(TraceEnablement.fromBool(bpt.obj.isEnabled())); if (en == TraceEnablement.MIXED) { diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/breakpoint/DebuggerLogicalBreakpointServiceTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/breakpoint/DebuggerLogicalBreakpointServiceTest.java index 7171d96801..4fe60d08f4 100644 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/breakpoint/DebuggerLogicalBreakpointServiceTest.java +++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/breakpoint/DebuggerLogicalBreakpointServiceTest.java @@ -413,7 +413,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe assertEquals(addr(program, 0x00400123), enLb.getProgramLocation().getAddress()); assertEquals(enBm, enLb.getProgramBookmark()); assertTrue(enLb.getMappedTraces().isEmpty()); - assertEquals(Enablement.ENABLED, enLb.computeEnablementForProgram(program)); + assertEquals(Enablement.INEFFECTIVE_ENABLED, enLb.computeEnablementForProgram(program)); assertEquals(Set.of(TraceBreakpointKind.SW_EXECUTE), enLb.getKinds()); LogicalBreakpoint disLb = Unique @@ -422,7 +422,7 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe assertEquals(addr(program, 0x00400321), disLb.getProgramLocation().getAddress()); assertEquals(disBm, disLb.getProgramBookmark()); assertTrue(disLb.getMappedTraces().isEmpty()); - assertEquals(Enablement.DISABLED, disLb.computeEnablementForProgram(program)); + assertEquals(Enablement.INEFFECTIVE_DISABLED, disLb.computeEnablementForProgram(program)); assertEquals(Set.of(TraceBreakpointKind.SW_EXECUTE), disLb.getKinds()); } @@ -438,8 +438,8 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe assertEquals(addr(trace, 0x55550123), enLb.getTraceAddress(trace)); assertEquals(Set.of(), enLb.getTraceBreakpoints(trace)); assertEquals(Set.of(), enLb.getTraceBreakpoints()); - assertEquals(Enablement.ENABLED_DISABLED, enLb.computeEnablementForProgram(program)); - assertEquals(Enablement.DISABLED_ENABLED, enLb.computeEnablementForTrace(trace)); + assertEquals(Enablement.INEFFECTIVE_ENABLED, enLb.computeEnablementForProgram(program)); + assertEquals(Enablement.INEFFECTIVE_ENABLED, enLb.computeEnablementForTrace(trace)); LogicalBreakpoint disLb = Unique .assertOne(breakpointService.getBreakpointsAt(program, addr(program, 0x00400321))); @@ -450,8 +450,8 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe assertEquals(addr(trace, 0x55550321), disLb.getTraceAddress(trace)); assertEquals(Set.of(), disLb.getTraceBreakpoints(trace)); assertEquals(Set.of(), disLb.getTraceBreakpoints()); - assertEquals(Enablement.DISABLED, disLb.computeEnablementForProgram(program)); - assertEquals(Enablement.DISABLED, disLb.computeEnablementForTrace(trace)); + assertEquals(Enablement.INEFFECTIVE_DISABLED, disLb.computeEnablementForProgram(program)); + assertEquals(Enablement.INEFFECTIVE_DISABLED, disLb.computeEnablementForTrace(trace)); } protected void assertLogicalBreakpointForMappedBookmarkAnd2TraceBreakpoints(Trace trace1, @@ -490,9 +490,9 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe assertEquals(Set.of(), disLb.getTraceBreakpoints(trace1)); assertEquals(Set.of(), disLb.getTraceBreakpoints(trace2)); assertEquals(Set.of(), disLb.getTraceBreakpoints()); - assertEquals(Enablement.DISABLED, disLb.computeEnablementForProgram(program)); - assertEquals(Enablement.DISABLED, disLb.computeEnablementForTrace(trace1)); - assertEquals(Enablement.DISABLED, disLb.computeEnablementForTrace(trace2)); + assertEquals(Enablement.INEFFECTIVE_DISABLED, disLb.computeEnablementForProgram(program)); + assertEquals(Enablement.INEFFECTIVE_DISABLED, disLb.computeEnablementForTrace(trace1)); + assertEquals(Enablement.INEFFECTIVE_DISABLED, disLb.computeEnablementForTrace(trace2)); } protected void assertLogicalBreakpointForMappedBookmarkAnd1TraceBreakpoint(Trace trace) { @@ -522,8 +522,8 @@ public class DebuggerLogicalBreakpointServiceTest extends AbstractGhidraHeadedDe assertEquals(addr(trace, 0x55550321), disLb.getTraceAddress(trace)); assertEquals(Set.of(), disLb.getTraceBreakpoints(trace)); assertEquals(Set.of(), disLb.getTraceBreakpoints()); - assertEquals(Enablement.DISABLED, disLb.computeEnablementForProgram(program)); - assertEquals(Enablement.DISABLED, disLb.computeEnablementForTrace(trace)); + assertEquals(Enablement.INEFFECTIVE_DISABLED, disLb.computeEnablementForProgram(program)); + assertEquals(Enablement.INEFFECTIVE_DISABLED, disLb.computeEnablementForTrace(trace)); } @Test From a61baf58c450b37dfb7fd548bc757fb18ce855c9 Mon Sep 17 00:00:00 2001 From: d-millar <33498836+d-millar@users.noreply.github.com> Date: Wed, 28 Apr 2021 15:00:21 -0400 Subject: [PATCH 2/2] GP-889: fix for C&P error --- .../core/debug/platform/GdbM68kDebuggerMappingOpinion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/GdbM68kDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/GdbM68kDebuggerMappingOpinion.java index c6976a805c..e7e64755fe 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/GdbM68kDebuggerMappingOpinion.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/GdbM68kDebuggerMappingOpinion.java @@ -49,7 +49,7 @@ public class GdbM68kDebuggerMappingOpinion implements DebuggerMappingOpinion { return Set.of(); } String arch = env.getArchitecture(); - if (arch.startsWith("mips:32")) { + if (arch.startsWith("m68k")) { return Set.of(new GdbM68kBELinux32DefOffer(process)); } return Set.of();