Skip to content

Commit 7c75e44

Browse files
committed
Workaround LLDB-MI =breakpoint-modified quirk
We ignore modified breakpoint/watchpoint conditions received via a =breakpoint-modified async event record from LLDB-MI. The "cond" field of these records is not reliable at present.
1 parent fc9f3ac commit 7c75e44

File tree

4 files changed

+50
-4
lines changed

4 files changed

+50
-4
lines changed

dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsSynchronizer.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2012, 2018 Mentor Graphics and others.
2+
* Copyright (c) 2012, 2025 Mentor Graphics and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,6 +16,7 @@
1616
* Jonah Graham (Kichwa Coders) - Bug 317173 - cleanup warnings
1717
* Jonah Graham (Kichwa Coders) - Bug 530377 - Corruption of state due to fast events from GDB
1818
* Umair Sair (Siemens) - Bug 571161 - MIBreakpointsSynchronizer is broken in certain scenarios
19+
* John Dallaway - Allow override of breakpoint condition modified check (#1319)
1920
*******************************************************************************/
2021

2122
package org.eclipse.cdt.dsf.mi.service;
@@ -222,7 +223,7 @@ private void doInitialize(final RequestMonitor rm) {
222223
getSession().addServiceEventListener(this, null);
223224

224225
// Register this service
225-
register(new String[] { MIBreakpointsSynchronizer.class.getName() }, new Hashtable<String, String>());
226+
register(new String[] { MIBreakpointsSynchronizer.class.getName() }, new Hashtable<>());
226227

227228
rm.done();
228229
}
@@ -746,6 +747,11 @@ protected void handleSuccess() {
746747
});
747748
}
748749

750+
/** @since 7.3 */
751+
protected boolean isTargetBreakpointConditionModified(MIBreakpoint miBpt, String condition) {
752+
return !condition.equals(miBpt.getCondition());
753+
}
754+
749755
private void targetBreakpointModified(IBreakpointsTargetDMContext bpTargetDMC, ICBreakpoint plBpt,
750756
MIBreakpoint miBpt) {
751757
Map<String, MIBreakpointDMData> contextBreakpoints = getBreakpointsService().getBreakpointMap(bpTargetDMC);
@@ -755,7 +761,7 @@ private void targetBreakpointModified(IBreakpointsTargetDMContext bpTargetDMC, I
755761
if (plBpt.isEnabled() != miBpt.isEnabled()) {
756762
plBpt.setEnabled(miBpt.isEnabled());
757763
}
758-
if (!plBpt.getCondition().equals(miBpt.getCondition())) {
764+
if (isTargetBreakpointConditionModified(miBpt, plBpt.getCondition())) {
759765
plBpt.setCondition(miBpt.getCondition());
760766
}
761767
// oldData can be null for notifications of breakpoints that are inserted using DSF but

llvm/org.eclipse.cdt.llvm.dsf.lldb.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-Vendor: %providerName
55
Bundle-SymbolicName: org.eclipse.cdt.llvm.dsf.lldb.core;singleton:=true
6-
Bundle-Version: 1.102.400.qualifier
6+
Bundle-Version: 1.102.500.qualifier
77
Bundle-RequiredExecutionEnvironment: JavaSE-17
88
Bundle-Localization: plugin
99
Require-Bundle: org.eclipse.debug.core;bundle-version="[3.23.0,4)",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 John Dallaway and others.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
* Contributors:
11+
* John Dallaway - Initial implementation (#1319)
12+
*******************************************************************************/
13+
14+
package org.eclipse.cdt.llvm.dsf.lldb.core.internal.service;
15+
16+
import org.eclipse.cdt.dsf.mi.service.MIBreakpointsSynchronizer;
17+
import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakpoint;
18+
import org.eclipse.cdt.dsf.service.DsfSession;
19+
20+
public class LLDBBreakpointsSynchronizer extends MIBreakpointsSynchronizer {
21+
22+
public LLDBBreakpointsSynchronizer(DsfSession session) {
23+
super(session);
24+
}
25+
26+
@Override
27+
protected boolean isTargetBreakpointConditionModified(MIBreakpoint miBpt, String condition) {
28+
// assume not modified due to =breakpoint-modified async record issue:
29+
// https://github.com/lldb-tools/lldb-mi/issues/125
30+
return false;
31+
}
32+
33+
}

llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/service/LLDBServiceFactory.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* Contributors:
1212
* Ericsson - Initial implementation
1313
* John Dallaway - Use LLDB memory service (#1191)
14+
* John Dallaway - Use LLDB breakpoints synchronizer service (#1319)
1415
*******************************************************************************/
1516

1617
package org.eclipse.cdt.llvm.dsf.lldb.core.internal.service;
@@ -21,6 +22,7 @@
2122
import org.eclipse.cdt.dsf.debug.service.IRunControl;
2223
import org.eclipse.cdt.dsf.debug.service.command.ICommandControl;
2324
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
25+
import org.eclipse.cdt.dsf.mi.service.MIBreakpointsSynchronizer;
2426
import org.eclipse.cdt.dsf.service.DsfSession;
2527
import org.eclipse.cdt.llvm.dsf.lldb.core.internal.service.commands.LLDBCommandFactory;
2628
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -67,4 +69,9 @@ protected IMemory createMemoryService(DsfSession session) {
6769
return new LLDBMemory(session);
6870
}
6971

72+
@Override
73+
protected MIBreakpointsSynchronizer createBreakpointsSynchronizerService(DsfSession session) {
74+
return new LLDBBreakpointsSynchronizer(session);
75+
}
76+
7077
}

0 commit comments

Comments
 (0)