1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 187787 - Fixed restart. The inferior PID wasn't getting reset on a restart so the interrupt was being sent to the wrong pid.

This commit is contained in:
Doug Schaefer 2007-05-18 15:58:48 +00:00
parent 4a76aaf29f
commit 2122e4681c
2 changed files with 12 additions and 0 deletions

View file

@ -48,6 +48,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
import org.eclipse.cdt.debug.mi.core.CoreProcess;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MIInferior;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.RxThread;
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager;
@ -441,6 +442,9 @@ public class Target extends SessionObject implements ICDITarget, ICDIBreakpointM
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#restart()
*/
public void restart() throws CDIException {
// Reset the inferior pid
MIInferior inferior = getMISession().getMIInferior();
int pid = inferior.resetInferiorPID();
CommandFactory factory = miSession.getCommandFactory();
MIExecRun run = factory.createMIExecRun(new String[0]);
try {
@ -450,6 +454,8 @@ public class Target extends SessionObject implements ICDITarget, ICDIBreakpointM
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
}
} catch (MIException e) {
// Replace pid since we probably didn't actually restart
inferior.setInferiorPID(pid);
throw new MI2CDIException(e);
}
}

View file

@ -349,6 +349,12 @@ public class MIInferior extends Process {
}
}
public int resetInferiorPID() {
int pid = inferiorPID;
inferiorPID = 0;
return pid;
}
public void setInferiorPID(int pid) {
inferiorPID = pid;
}