Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Cortell2010-02-22 19:23:59 -0500
committerJohn Cortell2010-02-22 19:23:59 -0500
commit1e9d430245b7f55370ddc6bd6ed44f74794f1e62 (patch)
treebd4cb84d5f6e1ae972811f6640432ed5fe9610d1 /debug/org.eclipse.cdt.debug.mi.core
parent1d80af0b9662748a43101d54488e9c4a3d98b2d0 (diff)
downloadorg.eclipse.cdt-1e9d430245b7f55370ddc6bd6ed44f74794f1e62.tar.gz
org.eclipse.cdt-1e9d430245b7f55370ddc6bd6ed44f74794f1e62.tar.xz
org.eclipse.cdt-1e9d430245b7f55370ddc6bd6ed44f74794f1e62.zip
[303569] Debug view does not reveal reason when thread is stopped by event breakpoint
Diffstat (limited to 'debug/org.eclipse.cdt.debug.mi.core')
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/EventBreakpointHit.java31
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/event/SuspendedEvent.java4
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java26
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MICatchpointHitEvent.java31
4 files changed, 86 insertions, 6 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/EventBreakpointHit.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/EventBreakpointHit.java
new file mode 100644
index 0000000000..584aea7b47
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/EventBreakpointHit.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Freescale Semiconductor 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:
+ * Freescale Semiconductor - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.mi.core.cdi;
+
+import org.eclipse.cdt.debug.core.cdi.ICDIEventBreakpointHit;
+import org.eclipse.cdt.debug.mi.core.event.MICatchpointHitEvent;
+
+/**
+ * @since 6.1
+ */
+public class EventBreakpointHit extends SessionObject implements ICDIEventBreakpointHit {
+
+ MICatchpointHitEvent fMiEvent;
+
+ public EventBreakpointHit(Session session, MICatchpointHitEvent miEvent) {
+ super(session);
+ fMiEvent = miEvent;
+ }
+
+ public String getEventBreakpointType() {
+ return fMiEvent.getCatchpointType();
+ }
+}
diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/event/SuspendedEvent.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/event/SuspendedEvent.java
index 9deb409de1..1476be4ece 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/event/SuspendedEvent.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/event/SuspendedEvent.java
@@ -16,6 +16,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointHit;
import org.eclipse.cdt.debug.mi.core.cdi.EndSteppingRange;
import org.eclipse.cdt.debug.mi.core.cdi.ErrorInfo;
+import org.eclipse.cdt.debug.mi.core.cdi.EventBreakpointHit;
import org.eclipse.cdt.debug.mi.core.cdi.FunctionFinished;
import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryEvent;
@@ -24,6 +25,7 @@ import org.eclipse.cdt.debug.mi.core.cdi.WatchpointScope;
import org.eclipse.cdt.debug.mi.core.cdi.WatchpointTrigger;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointHitEvent;
+import org.eclipse.cdt.debug.mi.core.event.MICatchpointHitEvent;
import org.eclipse.cdt.debug.mi.core.event.MIErrorEvent;
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
import org.eclipse.cdt.debug.mi.core.event.MIFunctionFinishedEvent;
@@ -66,6 +68,8 @@ public class SuspendedEvent implements ICDISuspendedEvent {
return new ErrorInfo(session, (MIErrorEvent)event);
} else if (event instanceof MISharedLibEvent) {
return new SharedLibraryEvent(session);
+ } else if (event instanceof MICatchpointHitEvent) {
+ return new EventBreakpointHit(session, (MICatchpointHitEvent)event);
}
return session;
}
diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java
index 8edffa637b..11385ce9b6 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/RxThread.java
@@ -32,6 +32,7 @@ import org.eclipse.cdt.debug.mi.core.command.MIExecStepInstruction;
import org.eclipse.cdt.debug.mi.core.command.MIExecUntil;
import org.eclipse.cdt.debug.mi.core.command.MIInterpreterExecConsole;
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointHitEvent;
+import org.eclipse.cdt.debug.mi.core.event.MICatchpointHitEvent;
import org.eclipse.cdt.debug.mi.core.event.MIErrorEvent;
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
import org.eclipse.cdt.debug.mi.core.event.MIFunctionFinishedEvent;
@@ -304,13 +305,13 @@ public class RxThread extends Thread {
}
}
- // GDB does not have reason when stopping on shared, hopefully
- // this will be fix in newer version meanwhile, we will use a hack
- // to cope. On most platform we can detect by looking at the
- // console stream for phrase:
- // ~"Stopped due to shared library event\n"
+ // GDB does not provide reason when stopping on a shared library
+ // event or because of a catchpoint. Hopefully this will be
+ // fixed in a future version. Meanwhile, we will use a hack to
+ // cope. On most platform we can detect by looking at the
+ // console stream for phrase.
//
- // Althought it is a _real_ bad idea to do this, we do not have
+ // Although it is a _real_ bad idea to do this, we do not have
// any other alternatives.
if (list.isEmpty()) {
String[] logs = getStreamRecords();
@@ -320,6 +321,19 @@ public class RxThread extends Thread {
MIEvent e = new MISharedLibEvent(session, exec);
list.add(e);
}
+ else if (logs[i].startsWith("Catchpoint ")) { //$NON-NLS-1$
+ // Example: "Catchpoint 1 (exception caught)"
+ session.getMIInferior().setSuspended();
+ String log = logs[i];
+ String catchpointType = "???"; //$NON-NLS-1$
+ int startIndex = log.lastIndexOf('(');
+ int stopIndex = log.lastIndexOf(')');
+ if ((startIndex >= 0) && (stopIndex >= 0) && (stopIndex > startIndex)) {
+ catchpointType = log.substring(startIndex+1, stopIndex);
+ }
+ MIEvent e = new MICatchpointHitEvent(session, exec, catchpointType);
+ list.add(e);
+ }
}
}
diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MICatchpointHitEvent.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MICatchpointHitEvent.java
new file mode 100644
index 0000000000..c63d2dafa3
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/event/MICatchpointHitEvent.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Freescale Semiconductor 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:
+ * Freescale Semiconductor - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.mi.core.event;
+
+import org.eclipse.cdt.debug.mi.core.MISession;
+import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput;
+
+/**
+ * @since 6.1
+ */
+public class MICatchpointHitEvent extends MIStoppedEvent {
+
+ private String fCatchpointType;
+
+ public MICatchpointHitEvent(MISession source, MIExecAsyncOutput async, String catchpointType) {
+ super(source, async);
+ fCatchpointType = catchpointType;
+ }
+
+ public String getCatchpointType() {
+ return fCatchpointType;
+ }
+}

Back to the top