mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 01:35:39 +02:00
FIX NPE 46313
This commit is contained in:
parent
1e5198e7ca
commit
cefb4467c0
2 changed files with 6 additions and 11 deletions
|
@ -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.Target;
|
||||
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.MIBreakAfter;
|
||||
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 shouldRestart = false;
|
||||
Session session = (Session)getSession();
|
||||
// Stop the program
|
||||
if (allowInterrupt) {
|
||||
if (target instanceof Target) {
|
||||
Target ctarget = (Target)target;
|
||||
// Disable events.
|
||||
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();
|
||||
shouldRestart = true;
|
||||
mgr.enableEventToken(lastToken);
|
||||
}
|
||||
} else if (!target.isSuspended()) {
|
||||
target.suspend();
|
||||
|
|
|
@ -273,7 +273,12 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
|
|||
Target cTarget = (Target)currentTarget;
|
||||
cTarget.updateState(threadId);
|
||||
try {
|
||||
cTarget.getCurrentThread().getCurrentStackFrame();
|
||||
ICDIThread cthread = cTarget.getCurrentThread();
|
||||
if (cthread != null) {
|
||||
cthread.getCurrentStackFrame();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (CDIException e1) {
|
||||
//e1.printStackTrace();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue