mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
When selecting threads gdb can reset the current
stack frame on us. We should be aware of it and reset. * cdi/org/eclipse/cdt/debug/mi/core/cdi/mode/Target.java
This commit is contained in:
parent
abfe932836
commit
1b5eec7318
2 changed files with 17 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
2004-06-29 Alain Magloire
|
||||
|
||||
When selecting threads gdb can reset the current
|
||||
stack frame on us. We should be aware of it and reset.
|
||||
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/mode/Target.java
|
||||
|
||||
2004-06-24 Alain Magloire
|
||||
|
||||
Fix 68226
|
||||
|
|
|
@ -46,6 +46,7 @@ import org.eclipse.cdt.debug.mi.core.event.MIDetachedEvent;
|
|||
import org.eclipse.cdt.debug.mi.core.event.MIThreadCreatedEvent;
|
||||
import org.eclipse.cdt.debug.mi.core.event.MIThreadExitEvent;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIDataEvaluateExpressionInfo;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIFrame;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfoThreadsInfo;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo;
|
||||
|
@ -130,6 +131,15 @@ public class Target implements ICDITarget {
|
|||
throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
|
||||
}
|
||||
currentThreadId = info.getNewThreadId();
|
||||
|
||||
// @^&#@^$*^$
|
||||
// GDB reset the currentFrame to some other level 0 when switching thread.
|
||||
// we need to reposition the current stack level.
|
||||
MIFrame miFrame = info.getFrame();
|
||||
if (miFrame != null) {
|
||||
int depth = cthread.getStackFrameCount();
|
||||
cthread.currentFrame = new StackFrame(cthread, miFrame, depth - miFrame.getLevel());
|
||||
}
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue