1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 01:05:38 +02:00

FIX NPE 46313

This commit is contained in:
Alain Magloire 2003-11-20 21:46:58 +00:00
parent 1e5198e7ca
commit cefb4467c0
2 changed files with 6 additions and 11 deletions

View file

@ -25,7 +25,6 @@ import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.model.Breakpoint; import org.eclipse.cdt.debug.mi.core.cdi.model.Breakpoint;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.cdi.model.Watchpoint; import org.eclipse.cdt.debug.mi.core.cdi.model.Watchpoint;
import org.eclipse.cdt.debug.mi.core.command.Command;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory; import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIBreakAfter; import org.eclipse.cdt.debug.mi.core.command.MIBreakAfter;
import org.eclipse.cdt.debug.mi.core.command.MIBreakCondition; import org.eclipse.cdt.debug.mi.core.command.MIBreakCondition;
@ -103,23 +102,14 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
boolean suspendInferior(ICDITarget target) throws CDIException { boolean suspendInferior(ICDITarget target) throws CDIException {
boolean shouldRestart = false; boolean shouldRestart = false;
Session session = (Session)getSession();
// Stop the program // Stop the program
if (allowInterrupt) { if (allowInterrupt) {
if (target instanceof Target) { if (target instanceof Target) {
Target ctarget = (Target)target; Target ctarget = (Target)target;
// Disable events. // Disable events.
if (ctarget.isRunning()) { if (ctarget.isRunning()) {
EventManager mgr = (EventManager)session.getEventManager();
Command cmd = ctarget.getLastExecutionCommand();
int lastToken = 0;
if (cmd != null) {
lastToken = cmd.getToken();
}
mgr.disableEventToken(lastToken);
ctarget.suspend(); ctarget.suspend();
shouldRestart = true; shouldRestart = true;
mgr.enableEventToken(lastToken);
} }
} else if (!target.isSuspended()) { } else if (!target.isSuspended()) {
target.suspend(); target.suspend();

View file

@ -273,7 +273,12 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
Target cTarget = (Target)currentTarget; Target cTarget = (Target)currentTarget;
cTarget.updateState(threadId); cTarget.updateState(threadId);
try { try {
cTarget.getCurrentThread().getCurrentStackFrame(); ICDIThread cthread = cTarget.getCurrentThread();
if (cthread != null) {
cthread.getCurrentStackFrame();
} else {
return false;
}
} catch (CDIException e1) { } catch (CDIException e1) {
//e1.printStackTrace(); //e1.printStackTrace();
} }