Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2003-11-20 21:46:58 +0000
committerAlain Magloire2003-11-20 21:46:58 +0000
commitcefb4467c0abc31b19bd82339768fb2fc6f84201 (patch)
treeffff3d5f9e8f6be888b5aaac404be37562272857
parent1e5198e7ca97ce00fb027d0229616d13a238ac79 (diff)
downloadorg.eclipse.cdt-cefb4467c0abc31b19bd82339768fb2fc6f84201.tar.gz
org.eclipse.cdt-cefb4467c0abc31b19bd82339768fb2fc6f84201.tar.xz
org.eclipse.cdt-cefb4467c0abc31b19bd82339768fb2fc6f84201.zip
FIX NPE 46313
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java10
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java7
2 files changed, 6 insertions, 11 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java
index a641d53793..b54c7be120 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java
@@ -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();
diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java
index 3d9eb00ccd..1dd56a26f5 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java
@@ -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();
}

Back to the top