mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Set the current thread and stack and do not throw unecessary exception.
This commit is contained in:
parent
eaf8bdf762
commit
9cf3fc83e9
1 changed files with 25 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
package org.eclipse.cdt.debug.mi.core.cdi;
|
||||
|
||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
|
@ -44,13 +49,13 @@ public class StackFrame extends CObject implements ICDIStackFrame {
|
|||
if (frame != null) {
|
||||
CSession session = getCTarget().getCSession();
|
||||
VariableManager mgr = (VariableManager)session.getVariableManager();
|
||||
mgr.update();
|
||||
MISession mi = session.getMISession();
|
||||
CommandFactory factory = mi.getCommandFactory();
|
||||
int level = frame.getLevel();
|
||||
MIStackListArguments listArgs =
|
||||
factory.createMIStackListArguments(false, level, level);
|
||||
try {
|
||||
cthread.setCurrentStackFrame(this);
|
||||
MIArg[] args = null;
|
||||
mi.postCommand(listArgs);
|
||||
MIStackListArgumentsInfo info =
|
||||
|
@ -72,9 +77,16 @@ public class StackFrame extends CObject implements ICDIStackFrame {
|
|||
cdiArgs = new ICDIArgument[0];
|
||||
}
|
||||
} catch (MIException e) {
|
||||
throw new CDIException(e.toString());
|
||||
//throw new CDIException(e.toString());
|
||||
System.err.println(e);
|
||||
} catch (CDIException e) {
|
||||
//throw e;
|
||||
System.err.println(e);
|
||||
}
|
||||
}
|
||||
if (cdiArgs == null) {
|
||||
cdiArgs = new ICDIArgument[0];
|
||||
}
|
||||
return cdiArgs;
|
||||
}
|
||||
|
||||
|
@ -82,15 +94,15 @@ public class StackFrame extends CObject implements ICDIStackFrame {
|
|||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#getLocalVariables()
|
||||
*/
|
||||
public ICDIVariable[] getLocalVariables() throws CDIException {
|
||||
ICDIVariable[] variables = null;
|
||||
CSession session = getCTarget().getCSession();
|
||||
VariableManager mgr = (VariableManager)session.getVariableManager();
|
||||
mgr.update();
|
||||
MISession mi = session.getMISession();
|
||||
CommandFactory factory = mi.getCommandFactory();
|
||||
MIStackListLocals locals = factory.createMIStackListLocals(false);
|
||||
try {
|
||||
cthread.setCurrentStackFrame(this);
|
||||
MIArg[] args = null;
|
||||
ICDIVariable[] variables = null;
|
||||
mi.postCommand(locals);
|
||||
MIStackListLocalsInfo info = locals.getMIStackListLocalsInfo();
|
||||
if (info == null) {
|
||||
|
@ -105,10 +117,17 @@ public class StackFrame extends CObject implements ICDIStackFrame {
|
|||
} else {
|
||||
variables = new ICDIVariable[0];
|
||||
}
|
||||
return variables;
|
||||
} catch (MIException e) {
|
||||
throw new CDIException(e.toString());
|
||||
//throw new CDIException(e.toString());
|
||||
System.err.println(e);
|
||||
} catch (CDIException e) {
|
||||
//throw e;
|
||||
System.err.println(e);
|
||||
}
|
||||
if (variables == null) {
|
||||
variables = new ICDIVariable[0];
|
||||
}
|
||||
return variables;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue