diff options
author | Alain Magloire | 2002-11-06 21:04:57 +0000 |
---|---|---|
committer | Alain Magloire | 2002-11-06 21:04:57 +0000 |
commit | f1009943f66572536fb063768b90dff00368a744 (patch) | |
tree | 61d2757ec4f9edad9c766f2cd5c3fcb2dc4ce853 /debug | |
parent | 6c34b97f047fb5eea4f98299cd7fcba92ca61b5a (diff) | |
download | org.eclipse.cdt-f1009943f66572536fb063768b90dff00368a744.tar.gz org.eclipse.cdt-f1009943f66572536fb063768b90dff00368a744.tar.xz org.eclipse.cdt-f1009943f66572536fb063768b90dff00368a744.zip |
Catch the exception and use a list.
Diffstat (limited to 'debug')
-rw-r--r-- | debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/StackFrame.java | 17 |
1 files changed, 7 insertions, 10 deletions
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 e6813f54b51..d0001fbb9f1 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 @@ -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]); } /** |