diff -r 36bb0f394df1 cnd.debugger.gdb2/src/org/netbeans/modules/cnd/debugger/gdb2/Gdb.java --- a/cnd.debugger.gdb2/src/org/netbeans/modules/cnd/debugger/gdb2/Gdb.java Thu Jun 14 01:04:16 2012 +0000 +++ b/cnd.debugger.gdb2/src/org/netbeans/modules/cnd/debugger/gdb2/Gdb.java Sun Dec 09 16:19:00 2012 +0000 @@ -486,6 +486,7 @@ return; } tentativeGdb.setExecutor(executor); + tentativeGdb.setPid(pid); } tentativeGdb.myMIProxy.logInfo(); @@ -688,7 +689,19 @@ * Interrupt the program (note that unlike almost every other debugging * action, we're NOT asking dbx to do it - this we're actually doing * ourselves!! + * + * On embedded targets SIGINT must be sent to GDB, not the target process */ + private int gdbpid; + + void setPid(int pid) { + gdbpid = pid; + } + + int getPid() { + return gdbpid; + } + boolean pause(int pid, boolean silentStop, boolean interruptGdb) { // The following predicate is _not_ the same as isReceptive() if (debugger.state().isRunning && debugger.state().isProcess) { diff -r 36bb0f394df1 cnd.debugger.gdb2/src/org/netbeans/modules/cnd/debugger/gdb2/GdbDebuggerImpl.java --- a/cnd.debugger.gdb2/src/org/netbeans/modules/cnd/debugger/gdb2/GdbDebuggerImpl.java Thu Jun 14 01:04:16 2012 +0000 +++ b/cnd.debugger.gdb2/src/org/netbeans/modules/cnd/debugger/gdb2/GdbDebuggerImpl.java Sun Dec 09 16:19:00 2012 +0000 @@ -765,7 +765,9 @@ String remoteTarget = gdi.getTargetCommand(); if (remoteTarget != null) { cmdString = "target " + remoteTarget; //NOI18N - targetAttach = true; + // Leave this as false because to interrupt a gdbserver session + // you must send a SIGINT to the host side gdb session + //targetAttach = true; } else { pid = gdi.getPid(); // MI command "-target-attach pid | file" does not available in @@ -792,7 +794,7 @@ state().isProcess = true; stateChanged(); session().setSessionState(state()); - long pid = getNDI().getPid(); + long pid = gdb.getPid(); if (pid != -1) { session().setPid(pid); }