Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Cortell2010-04-26 22:58:22 +0000
committerJohn Cortell2010-04-26 22:58:22 +0000
commit9e8cd5b29b7ef3d1694e82034c1590109f7bcd57 (patch)
tree16985e74e901178655e54a14582904ce5d4dfcad /debug/org.eclipse.cdt.debug.mi.core
parente82f7e13130c789c0c72217bd90947947e9d7ff5 (diff)
downloadorg.eclipse.cdt-9e8cd5b29b7ef3d1694e82034c1590109f7bcd57.tar.gz
org.eclipse.cdt-9e8cd5b29b7ef3d1694e82034c1590109f7bcd57.tar.xz
org.eclipse.cdt-9e8cd5b29b7ef3d1694e82034c1590109f7bcd57.zip
Bug 304096: restore interrupt behavior for remote debugging case.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.mi.core')
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIInferior.java23
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerCDIDebugger2.java1
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIProcessAdapter.java14
3 files changed, 37 insertions, 1 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIInferior.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIInferior.java
index 952967874d9..4bb845afa7a 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIInferior.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/MIInferior.java
@@ -55,6 +55,10 @@ public class MIInferior extends Process {
IMITTY tty;
int inferiorPID;
+
+
+ /** See {@link #getIsRemoteInferior()} */
+ private boolean fIsRemoteInferior;
public MIInferior(MISession mi, IMITTY p) {
session = mi;
@@ -378,4 +382,23 @@ public class MIInferior extends Process {
public int getInferiorPID() {
return inferiorPID;
}
+
+ /**
+ * Called early on in the debug session to mark the inferior process as being
+ * under the control of a gdbserver.
+ *
+ * @since 7.0
+ */
+ public void setIsRemoteInferior(boolean value) {
+ fIsRemoteInferior = value;
+ }
+
+ /**
+ * Is the inferior process being debugged remotely through gdbserver?
+ *
+ * @since 7.0
+ */
+ public boolean getIsRemoteInferior() {
+ return fIsRemoteInferior;
+ }
}
diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerCDIDebugger2.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerCDIDebugger2.java
index 766c8dec293..da14c80e0e8 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerCDIDebugger2.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/GDBServerCDIDebugger2.java
@@ -109,6 +109,7 @@ public class GDBServerCDIDebugger2 extends GDBCDIDebugger2 {
// @@@ We have to set the suspended state manually
miSession.getMIInferior().setSuspended();
miSession.getMIInferior().update();
+ miSession.getMIInferior().setIsRemoteInferior(true);
}
}
diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIProcessAdapter.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIProcessAdapter.java
index 9eca771b652..7c146c4f832 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIProcessAdapter.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIProcessAdapter.java
@@ -123,7 +123,19 @@ public class MIProcessAdapter implements MIProcess {
if (fGDBProcess instanceof Spawner) {
if (inferior.isRunning()) {
Spawner gdbSpawner = (Spawner) fGDBProcess;
- gdbSpawner.interruptCTRLC();
+
+ // Cygwin gdb 6.8 is capricious when it comes to interrupting the
+ // target. The same logic here will work with MinGW, though. And on
+ // linux it's irrelevant since interruptCTRLC()==interrupt(). So,
+ // one odd size fits all.
+ // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=304096#c54
+ if (inferior.getIsRemoteInferior()) {
+ gdbSpawner.interrupt();
+ }
+ else {
+ gdbSpawner.interruptCTRLC();
+ }
+
waitForInterrupt(inferior);
}
// If we are still running try to drop the sig to the PID

Back to the top