diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java index 0254ff79350..9dea7f35d90 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIInferior.java @@ -23,7 +23,6 @@ public class MIInferior extends Process { public final static int SUSPENDED = 1; public final static int RUNNING = 2; - public final static int STEPPING = 3; public final static int TERMINATED = 4; int state = 0; @@ -133,10 +132,6 @@ public class MIInferior extends Process { return state == RUNNING; } - public synchronized boolean isStepping() { - return state == STEPPING; - } - public synchronized boolean isTerminated() { return state == TERMINATED; } @@ -149,10 +144,6 @@ public class MIInferior extends Process { state = RUNNING; } - public synchronized void setStepping() { - state = STEPPING; - } - public synchronized void setTerminated() { state = TERMINATED; notifyAll(); diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CTarget.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CTarget.java index 60754ad2e3c..0745b8f305b 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CTarget.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CTarget.java @@ -128,14 +128,14 @@ public class CTarget implements ICDITarget { * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getGlobalVariables() */ public ICDIGlobalVariable[] getGlobalVariables() throws CDIException { - return null; + return new ICDIGlobalVariable[0]; } /** * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getRegisterGroups() */ public ICDIRegisterGroup[] getRegisterGroups() throws CDIException { - return null; + return new ICDIRegisterGroup[0]; } /** @@ -146,7 +146,7 @@ public class CTarget implements ICDITarget { } /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getThread(String) + * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getCurrentThread() */ public ICDIThread getCurrentThread() throws CDIException { return null; @@ -188,13 +188,6 @@ public class CTarget implements ICDITarget { return false; } - /** - * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#isStepping() - */ - public boolean isStepping() { - return session.getMISession().getMIInferior().isRunning(); - } - /** * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#isSuspended() */ @@ -232,7 +225,7 @@ public class CTarget implements ICDITarget { */ public void resume() throws CDIException { MISession mi = session.getMISession(); - if (mi.getMIInferior().isRunning() || mi.getMIInferior().isStepping()) { + if (mi.getMIInferior().isRunning()) { throw new CDIException("Inferior already running"); } else if (mi.getMIInferior().isSuspended()) { CommandFactory factory = mi.getCommandFactory(); diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CThread.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CThread.java index 05a1af12d69..623ef255021 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CThread.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/CThread.java @@ -6,9 +6,9 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.command.CommandFactory; -import org.eclipse.cdt.debug.mi.core.command.MIStackListArguments; +import org.eclipse.cdt.debug.mi.core.command.MIStackListFrames; import org.eclipse.cdt.debug.mi.core.output.MIFrame; -import org.eclipse.cdt.debug.mi.core.output.MIStackListArgumentsInfo; +import org.eclipse.cdt.debug.mi.core.output.MIStackListFramesInfo; /** * @author alain @@ -48,12 +48,10 @@ public class CThread extends CObject implements ICDIThread { public ICDIStackFrame[] getStackFrames() throws CDIException { MISession mi = getCTarget().getCSession().getMISession(); CommandFactory factory = mi.getCommandFactory(); - //MIStackListFrames frames = factory.createMIStackListFrames(); - MIStackListArguments frames = factory.createMIStackListArguments(true); + MIStackListFrames frames = factory.createMIStackListFrames(); try { mi.postCommand(frames); - //MIStackListFramesInfo info = frames.getMIStackListFramesInfo(); - MIStackListArgumentsInfo info = frames.getMIStackListArgumentsInfo(); + MIStackListFramesInfo info = frames.getMIStackListFramesInfo(); if (info == null) { throw new CDIException("Timedout"); } @@ -68,14 +66,6 @@ public class CThread extends CObject implements ICDIThread { } } - /* - * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#isStepping() - * - public boolean isStepping() { - return getTarget().isStepping(); - } - */ - /** * @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#isSuspended() */ diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/StackFrame.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/StackFrame.java index 8262818ce0d..68a8737926d 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/StackFrame.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/StackFrame.java @@ -3,25 +3,19 @@ package org.eclipse.cdt.debug.mi.core.cdi; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDILocation; import org.eclipse.cdt.debug.core.cdi.model.ICDIArgument; -import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.command.CommandFactory; +import org.eclipse.cdt.debug.mi.core.command.MIStackListArguments; import org.eclipse.cdt.debug.mi.core.command.MIStackListLocals; import org.eclipse.cdt.debug.mi.core.output.MIArg; import org.eclipse.cdt.debug.mi.core.output.MIFrame; +import org.eclipse.cdt.debug.mi.core.output.MIStackListArgumentsInfo; import org.eclipse.cdt.debug.mi.core.output.MIStackListLocalsInfo; /** - * @author alain - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. - * To enable and disable the creation of type comments go to - * Window>Preferences>Java>Code Generation. */ public class StackFrame extends CObject implements ICDIStackFrame { @@ -36,15 +30,34 @@ public class StackFrame extends CObject implements ICDIStackFrame { * @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#getArguments() */ public ICDIArgument[] getArguments() throws CDIException { + MIArg[] args = null; + ICDIArgument[] cdiArgs = null; if (frame != null) { - MIArg[] args = frame.getArgs(); - ICDIArgument[] cargs = new ICDIArgument[args.length]; - for (int i = 0; i < cargs.length; i++) { - cargs[i] = new Argument(getCTarget(), args[i]); + MISession mi = getCTarget().getCSession().getMISession(); + CommandFactory factory = mi.getCommandFactory(); + int level = frame.getLevel(); + MIStackListArguments listArgs = + factory.createMIStackListArguments(true, level, level); + try { + mi.postCommand(listArgs); + MIStackListArgumentsInfo info = listArgs.getMIStackListArgumentsInfo(); + MIFrame[] miFrames = info.getMIFrames(); + if (miFrames != null && miFrames.length == 1) { + args = miFrames[0].getArgs(); + } + } catch (MIException e) { + //throw new CDIException(e); } - return cargs; } - return new ICDIArgument[0]; + if (args != null) { + cdiArgs = new ICDIArgument[args.length]; + for (int i = 0; i < cdiArgs.length; i++) { + cdiArgs[i] = new Argument(getCTarget(), args[i]); + } + } else { + cdiArgs = new ICDIArgument[0]; + } + return cdiArgs; } /** @@ -89,4 +102,13 @@ public class StackFrame extends CObject implements ICDIStackFrame { return new Location("", "", 0, 0); } + /** + * @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#getLevel() + */ + public int getLevel() { + if (frame != null) { + return frame.getLevel(); + } + return 0; + } } diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIParser.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIParser.java index 17761014a96..8a1a767a89e 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIParser.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/output/MIParser.java @@ -203,6 +203,9 @@ public class MIParser { async.setAsyncClass(asyncClass); // Consume the async-class and the comma buffer.delete(0, i + 1); + } else { + async.setAsyncClass(buffer.toString().trim()); + buffer.setLength(0); } MIResult[] res = processMIResults(buffer); async.setMIResults(res);