1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

Catch the exception and use a list.

This commit is contained in:
Alain Magloire 2002-11-06 21:04:57 +00:00
parent 6c34b97f04
commit f1009943f6

View file

@ -93,7 +93,7 @@ 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;
List cdiList = new ArrayList();
CSession session = getCTarget().getCSession();
VariableManager mgr = (VariableManager)session.getVariableManager();
MISession mi = session.getMISession();
@ -109,12 +109,12 @@ public class StackFrame extends CObject implements ICDIStackFrame {
}
args = info.getLocals();
if (args != null) {
variables = new ICDIVariable[args.length];
for (int i = 0; i < variables.length; i++) {
variables[i] = mgr.createVariable(this, args[i].getName());
for (int i = 0; i < args.length; i++) {
try {
cdiList.add(mgr.createVariable(this, args[i].getName()));
} catch (CDIException e) {
}
}
} else {
variables = new ICDIVariable[0];
}
} catch (MIException e) {
//throw new CDIException(e.getMessage());
@ -123,10 +123,7 @@ public class StackFrame extends CObject implements ICDIStackFrame {
//throw e;
//System.err.println(e);
}
if (variables == null) {
variables = new ICDIVariable[0];
}
return variables;
return (ICDIVariable[])cdiList.toArray(new ICDIVariable[0]);
}
/**