Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2015-03-10 19:20:25 +0000
committerEugene Tarassov2015-03-10 19:20:25 +0000
commit872f9220e07e37b6ca615fca561becbf24ed3222 (patch)
tree4bfd3f028a584707cda9d691dd8d3bb25a0cbf0d /plugins
parentbb309f0c6ef8ac75a68ad01b64603e629517f721 (diff)
downloadorg.eclipse.tcf-872f9220e07e37b6ca615fca561becbf24ed3222.tar.gz
org.eclipse.tcf-872f9220e07e37b6ca615fca561becbf24ed3222.tar.xz
org.eclipse.tcf-872f9220e07e37b6ca615fca561becbf24ed3222.zip
TCF Debugger: don't show temporary stepping breakpoints in the Breakpoints view
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFBreakpointStatusListener.java4
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFSuspendResumeAdapter.java112
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFAction.java4
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFActionStepOut.java4
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFActionStepOver.java4
5 files changed, 57 insertions, 71 deletions
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 a1af6a7c7..29da7030c 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Wind River Systems, Inc. and others.
+ * Copyright (c) 2010, 2015 Wind River Systems, Inc. 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
@@ -39,6 +39,7 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IBreakpointListener;
import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.tcf.internal.debug.actions.TCFAction;
import org.eclipse.tcf.internal.debug.model.ITCFBreakpointListener;
import org.eclipse.tcf.internal.debug.model.TCFBreakpoint;
import org.eclipse.tcf.internal.debug.model.TCFBreakpointsModel;
@@ -253,6 +254,7 @@ class TCFBreakpointStatusListener {
}
private void createOrUpdateBreakpoint(final String id) {
+ if (id.startsWith(TCFAction.STEP_BREAKPOINT_PREFIX)) return;
Map<String,Object> properties = status.getProperties(id);
if (properties == null) return;
if (TCFBreakpointsModel.isLocal(properties)) return;
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFSuspendResumeAdapter.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFSuspendResumeAdapter.java
index 749a2ca82..d58c583b5 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFSuspendResumeAdapter.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/TCFSuspendResumeAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Wind River Systems, Inc. and others.
+ * Copyright (c) 2010, 2015 Wind River Systems, Inc. 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
@@ -31,6 +31,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.ISourceLocator;
import org.eclipse.debug.core.model.ISuspendResume;
+import org.eclipse.tcf.internal.debug.actions.TCFAction;
import org.eclipse.tcf.internal.debug.model.TCFContextState;
import org.eclipse.tcf.internal.debug.ui.model.TCFChildren;
import org.eclipse.tcf.internal.debug.ui.model.TCFDebugTask;
@@ -136,17 +137,16 @@ public class TCFSuspendResumeAdapter implements ISuspendResume, IRunToLine,
return;
}
IRunControl.RunControlContext runCtx = cache.getData();
- if (runCtx.canResume(IRunControl.RM_RESUME)) {
- runCtx.resume(IRunControl.RM_RESUME, 1, new IRunControl.DoneCommand() {
- public void doneCommand(IToken token, Exception error) {
- if (error != null) {
- error(error);
- } else {
- done(null);
- }
+ runCtx.resume(IRunControl.RM_RESUME, 1, new IRunControl.DoneCommand() {
+ public void doneCommand(IToken token, Exception error) {
+ if (error != null) {
+ error(error);
}
- });
- }
+ else {
+ done(null);
+ }
+ }
+ });
}
}.getD();
}
@@ -169,7 +169,8 @@ public class TCFSuspendResumeAdapter implements ISuspendResume, IRunToLine,
public void doneCommand(IToken token, Exception error) {
if (error != null) {
error(error);
- } else {
+ }
+ else {
done(null);
}
}
@@ -274,10 +275,6 @@ public class TCFSuspendResumeAdapter implements ISuspendResume, IRunToLine,
done(null);
return;
}
- final TCFDataCache<IRunControl.RunControlContext> cache = fExecCtx.getRunContext();
- if (!cache.validate(this)) {
- return;
- }
final IChannel channel = fExecCtx.getChannel();
final IBreakpoints breakpoints = channel.getRemoteService(IBreakpoints.class);
if (breakpoints == null) {
@@ -289,13 +286,14 @@ public class TCFSuspendResumeAdapter implements ISuspendResume, IRunToLine,
if (location.fFile != null) {
properties.put(IBreakpoints.PROP_FILE, location.fFile);
properties.put(IBreakpoints.PROP_LINE, location.fLine);
- } else {
+ }
+ else {
properties.put(IBreakpoints.PROP_LOCATION, location.fAddress.toString());
}
// properties.put(IBreakpoints.PROP_CONTEXTIDS, new String[] { contextId });
properties.put(IBreakpoints.PROP_ENABLED, Boolean.TRUE);
// properties.put(IBreakpoints.PROP_TEMPORARY, Boolean.TRUE);
- final String breakpointId = "runtoline"+location.hashCode();
+ final String breakpointId = TCFAction.STEP_BREAKPOINT_PREFIX + contextId;
properties.put(IBreakpoints.PROP_ID, breakpointId);
breakpoints.add(properties, new IBreakpoints.DoneCommand() {
public void doneCommand(IToken token, Exception error) {
@@ -320,8 +318,8 @@ public class TCFSuspendResumeAdapter implements ISuspendResume, IRunToLine,
removeBreakpoint.run();
return;
}
+ final TCFDataCache<IRunControl.RunControlContext> cache = fExecCtx.getRunContext();
if (!cache.validate(this)) {
- removeBreakpoint.run();
return;
}
if (cache.getError() != null) {
@@ -330,21 +328,17 @@ public class TCFSuspendResumeAdapter implements ISuspendResume, IRunToLine,
return;
}
runControl.addListener(new RunControlListener() {
- boolean fRunning;
+ private void finished() {
+ runControl.removeListener(this);
+ removeBreakpoint.run();
+ }
public void contextSuspended(String context, String pc, String reason,
Map<String, Object> params) {
- if (contextId.equals(context) && fRunning) {
+ if (contextId.equals(context)) {
finished();
}
}
- private void finished() {
- runControl.removeListener(this);
- removeBreakpoint.run();
- }
public void contextResumed(String context) {
- if (contextId.equals(context) && !fRunning) {
- fRunning = true;
- }
}
public void contextRemoved(String[] context_ids) {
for (String context : context_ids) {
@@ -362,42 +356,30 @@ public class TCFSuspendResumeAdapter implements ISuspendResume, IRunToLine,
}
public void containerSuspended(String context, String pc, String reason,
Map<String, Object> params, String[] suspended_ids) {
- if (fRunning) {
- for (String context2 : suspended_ids) {
- if (contextId.equals(context2)) {
- finished();
- }
+ for (String context2 : suspended_ids) {
+ if (contextId.equals(context2)) {
+ finished();
+ return;
}
}
}
public void containerResumed(String[] context_ids) {
- if (!fRunning) {
- for (String context2 : context_ids) {
- if (contextId.equals(context2)) {
- fRunning = true;
- return;
- }
- }
- }
}
});
IRunControl.RunControlContext runCtx = cache.getData();
- if (runCtx.canResume(IRunControl.RM_RESUME)) {
- runCtx.resume(IRunControl.RM_RESUME, 1, new IRunControl.DoneCommand() {
- public void doneCommand(IToken token, Exception error) {
- if (error != null) {
- error(error);
- } else {
- done(null);
- }
+ runCtx.resume(IRunControl.RM_RESUME, 1, new IRunControl.DoneCommand() {
+ public void doneCommand(IToken token, Exception error) {
+ if (error != null) {
+ error(error);
}
- });
- }
+ else {
+ done(null);
+ }
+ }
+ });
}
};
- if (cache.validate(resume)) {
- resume.run();
- }
+ resume.run();
}
});
}
@@ -516,23 +498,23 @@ public class TCFSuspendResumeAdapter implements ISuspendResume, IRunToLine,
return;
}
IRunControl.RunControlContext runCtx = cache.getData();
- if (runCtx.canResume(IRunControl.RM_RESUME)) {
- runCtx.resume(IRunControl.RM_RESUME, 1, new IRunControl.DoneCommand() {
- public void doneCommand(IToken token, Exception error) {
- if (error != null) {
- error(error);
- } else {
- done(null);
- }
+ runCtx.resume(IRunControl.RM_RESUME, 1, new IRunControl.DoneCommand() {
+ public void doneCommand(IToken token, Exception error) {
+ if (error != null) {
+ error(error);
}
- });
- }
+ else {
+ done(null);
+ }
+ }
+ });
}
};
if (cache.validate(resume)) {
resume.run();
}
- } else {
+ }
+ else {
done(null);
}
}
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFAction.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFAction.java
index 7fedaf98a..ab15ec1e2 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFAction.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 Wind River Systems, Inc. and others.
+ * Copyright (c) 2008, 2015 Wind River Systems, Inc. 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
@@ -27,6 +27,8 @@ import org.eclipse.tcf.protocol.Protocol;
*/
public abstract class TCFAction implements Runnable {
+ public static final String STEP_BREAKPOINT_PREFIX = "Step.";
+
protected final TCFLaunch launch;
protected final String ctx_id;
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFActionStepOut.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFActionStepOut.java
index fa0c613f1..c24c86c0a 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFActionStepOut.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFActionStepOut.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Wind River Systems, Inc. and others.
+ * Copyright (c) 2010, 2015 Wind River Systems, Inc. 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
@@ -118,7 +118,7 @@ public abstract class TCFActionStepOut extends TCFAction implements IRunControl.
BigInteger n = JSON.toBigInteger(addr);
addr = n.subtract(BigInteger.valueOf(1));
}
- String id = "Step." + ctx.getID();
+ String id = STEP_BREAKPOINT_PREFIX + ctx.getID();
bp = new HashMap<String,Object>();
bp.put(IBreakpoints.PROP_ID, id);
bp.put(IBreakpoints.PROP_LOCATION, addr.toString());
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFActionStepOver.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFActionStepOver.java
index 235cf5826..52a738ffb 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFActionStepOver.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/actions/TCFActionStepOver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Wind River Systems, Inc. and others.
+ * Copyright (c) 2010, 2015 Wind River Systems, Inc. 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
@@ -177,7 +177,7 @@ public abstract class TCFActionStepOver extends TCFAction implements IRunControl
BigInteger n = JSON.toBigInteger(addr);
addr = n.subtract(BigInteger.valueOf(1));
}
- String id = "Step." + ctx.getID();
+ String id = STEP_BREAKPOINT_PREFIX + ctx.getID();
bp = new HashMap<String,Object>();
bp.put(IBreakpoints.PROP_ID, id);
bp.put(IBreakpoints.PROP_LOCATION, addr.toString());

Back to the top