mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +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:
parent
4a76aaf29f
commit
2122e4681c
2 changed files with 12 additions and 0 deletions
|
@ -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.core.cdi.model.ICDIWatchpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.CoreProcess;
|
import org.eclipse.cdt.debug.mi.core.CoreProcess;
|
||||||
import org.eclipse.cdt.debug.mi.core.MIException;
|
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.MISession;
|
||||||
import org.eclipse.cdt.debug.mi.core.RxThread;
|
import org.eclipse.cdt.debug.mi.core.RxThread;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager;
|
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()
|
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#restart()
|
||||||
*/
|
*/
|
||||||
public void restart() throws CDIException {
|
public void restart() throws CDIException {
|
||||||
|
// Reset the inferior pid
|
||||||
|
MIInferior inferior = getMISession().getMIInferior();
|
||||||
|
int pid = inferior.resetInferiorPID();
|
||||||
CommandFactory factory = miSession.getCommandFactory();
|
CommandFactory factory = miSession.getCommandFactory();
|
||||||
MIExecRun run = factory.createMIExecRun(new String[0]);
|
MIExecRun run = factory.createMIExecRun(new String[0]);
|
||||||
try {
|
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$
|
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
} catch (MIException e) {
|
} catch (MIException e) {
|
||||||
|
// Replace pid since we probably didn't actually restart
|
||||||
|
inferior.setInferiorPID(pid);
|
||||||
throw new MI2CDIException(e);
|
throw new MI2CDIException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -349,6 +349,12 @@ public class MIInferior extends Process {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int resetInferiorPID() {
|
||||||
|
int pid = inferiorPID;
|
||||||
|
inferiorPID = 0;
|
||||||
|
return pid;
|
||||||
|
}
|
||||||
|
|
||||||
public void setInferiorPID(int pid) {
|
public void setInferiorPID(int pid) {
|
||||||
inferiorPID = pid;
|
inferiorPID = pid;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue