Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-12-06 00:51:29 +0000
committerPawel Piech2012-12-12 20:54:01 +0000
commit85ec037443202958513f688d7f08e9a8b125b60b (patch)
treec3b3f18e1d5b4cb44e1208f32517844e23be75c7
parentcd3b06ba93ed54c6682273cd1d811ed070007a3e (diff)
downloadorg.eclipse.tcf-85ec037443202958513f688d7f08e9a8b125b60b.tar.gz
org.eclipse.tcf-85ec037443202958513f688d7f08e9a8b125b60b.tar.xz
org.eclipse.tcf-85ec037443202958513f688d7f08e9a8b125b60b.zip
TCF Debugger: Bug 395876 - [breakpoints] watchpoints read/write settings not editable after watchpoint is created
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/plugin.xml22
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFBreakpointStatusListener.java44
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/CWatchpointFieldEditorFactory.java35
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java4
4 files changed, 96 insertions, 9 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/plugin.xml b/plugins/org.eclipse.tcf.cdt.ui/plugin.xml
index 724df438e..7b3e3dea0 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/plugin.xml
+++ b/plugins/org.eclipse.tcf.cdt.ui/plugin.xml
@@ -481,6 +481,28 @@
type="string">
</attribute>
</breakpointEditors>
+ <breakpointEditors
+ debugModelId="org.eclipse.tcf.debug" markerType="org.eclipse.cdt.debug.core.cWatchpointMarker">>
+ <attribute
+ fieldEditorFactory="org.eclipse.tcf.internal.cdt.ui.breakpoints.CWatchpointFieldEditorFactory"
+ label=""
+ name="org.eclipse.tcf.debug.tcfStamp">
+ <value
+ label=""
+ value="true">
+ <attribute
+ fieldEditorFactory="org.eclipse.tcf.internal.cdt.ui.breakpoints.CWatchpointFieldEditorFactory"
+ label="Read"
+ name="org.eclipse.cdt.debug.core.read">
+ </attribute>
+ <attribute
+ fieldEditorFactory="org.eclipse.tcf.internal.cdt.ui.breakpoints.CWatchpointFieldEditorFactory"
+ label="Write"
+ name="org.eclipse.cdt.debug.core.write">
+ </attribute>
+ </value>
+ </attribute>
+ </breakpointEditors>
</extension>
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFBreakpointStatusListener.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFBreakpointStatusListener.java
index 5367ba7e8..061c17b16 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFBreakpointStatusListener.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFBreakpointStatusListener.java
@@ -126,10 +126,12 @@ class TCFBreakpointStatusListener {
if (ok && installed.get(id) == null) {
installed.put(id, cbp);
incrementInstallCount(cbp);
- }
- if (!ok && installed.get(id) == cbp) {
+ }
+ else if (!ok && installed.get(id) == cbp) {
installed.remove(id);
decrementInstallCount(cbp);
+ } else {
+ updateTCFStamp(cbp);
}
}
else if (bp instanceof TCFBreakpoint) {
@@ -165,14 +167,14 @@ class TCFBreakpointStatusListener {
private void incrementInstallCount(final ICBreakpoint cbp) {
Job job = new WorkspaceJob("Increment Breakpoint Install Count") {
+ { setSystem(true); }
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
try {
cbp.incrementInstallCount();
+ doUpdateTCFStamp(cbp);
}
- catch (CoreException e) {
- // ignore expected race condition with marker deletion
- }
+ catch (CoreException e) {} // ignore expected race condition with marker deletion
return Status.OK_STATUS;
}
};
@@ -181,17 +183,18 @@ class TCFBreakpointStatusListener {
job.setSystem(true);
job.schedule();
}
+
private void decrementInstallCount(final ICBreakpoint cbp) {
Job job = new WorkspaceJob("Decrement Breakpoint Install Count") {
+ { setSystem(true); }
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
try {
cbp.decrementInstallCount();
+ doUpdateTCFStamp(cbp);
}
- catch (CoreException e) {
- // ignore expected race condition with marker deletion
- }
+ catch (CoreException e) {} // ignore expected race condition with marker deletion
return Status.OK_STATUS;
}
};
@@ -201,6 +204,31 @@ class TCFBreakpointStatusListener {
job.schedule();
}
+ private void updateTCFStamp(final ICBreakpoint cbp) {
+ Job job = new WorkspaceJob("Update C Breakpoint") {
+ { setSystem(true); }
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ try {
+ doUpdateTCFStamp(cbp);
+ }
+ catch (CoreException e) {} // ignore expected race condition with marker deletion
+ return Status.OK_STATUS;
+ }
+ };
+ job.setRule(cbp.getMarker().getResource());
+ job.setPriority(Job.SHORT);
+ job.setSystem(true);
+ job.schedule();
+ }
+
+ private void doUpdateTCFStamp(ICBreakpoint cbp) throws CoreException {
+ IMarker marker = cbp.getMarker();
+ if (marker != null && marker.exists()) {
+ marker.setAttribute(TCFBreakpointsModel.ATTR_TCF_STAMP, "true");
+ }
+ }
+
private void updateStatus(final TCFBreakpoint tbp) {
Job job = new WorkspaceJob("Update Breakpoint Status") {
@Override
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/CWatchpointFieldEditorFactory.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/CWatchpointFieldEditorFactory.java
new file mode 100644
index 000000000..cf4d6238d
--- /dev/null
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/CWatchpointFieldEditorFactory.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Wind River Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.internal.cdt.ui.breakpoints;
+
+import org.eclipse.cdt.debug.ui.breakpoints.IFieldEditorFactory;
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.swt.widgets.Composite;
+
+
+/**
+ * Create field editors to edit the read/write properties of a watchpoint.
+ */
+public class CWatchpointFieldEditorFactory implements IFieldEditorFactory {
+
+ private static final String READ_ID = "org.eclipse.cdt.debug.core.read";
+ private static final String WRITE_ID = "org.eclipse.cdt.debug.core.write";
+
+ public FieldEditor createFieldEditor(String name, String labelText, Composite parent) {
+ if (READ_ID.equals(name) || WRITE_ID.equals(name)) {
+ return new BooleanFieldEditor(name, labelText, parent);
+ }
+ return null;
+ }
+
+
+}
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java
index 4d9c7a331..5f88520bd 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFBreakpointsModel.java
@@ -79,7 +79,8 @@ public class TCFBreakpointsModel {
ATTR_CONTEXT_QUERY = ITCFConstants.ID_TCF_DEBUG_MODEL + '.' + IBreakpoints.PROP_CONTEXT_QUERY,
ATTR_EVENT_TYPE = "org.eclipse.cdt.debug.core.eventbreakpoint_event_id",
ATTR_EVENT_ARGS = "org.eclipse.cdt.debug.core.eventbreakpoint_event_arg",
- ATTR_TYPE = "org.eclipse.cdt.debug.core.breakpointType";
+ ATTR_TYPE = "org.eclipse.cdt.debug.core.breakpointType",
+ ATTR_TCF_STAMP = "org.eclipse.tcf.debug.tcfStamp";
public static final int
ATTR_TYPE_TEMPORARY = 0x1,
@@ -579,6 +580,7 @@ public class TCFBreakpointsModel {
}
m.put(ATTR_TYPE, cdt_type);
}
+ m.put(ATTR_TCF_STAMP, Boolean.TRUE.toString());
return m;
}

Back to the top