Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] MI plugin StackFrame.getLocals()

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/ChangeLog,v
retrieving revision 1.29
diff -u -r1.29 ChangeLog
--- ChangeLog	6 Nov 2002 20:14:37 -0000	1.29
+++ ChangeLog	6 Nov 2002 21:03:47 -0000
@@ -1,7 +1,13 @@
 2002-11-06 Alain Magloire
 
-	* src/.../mi/core/cdti/StackFrame.java (getArguments):
-	If an exception was throw, the array may contain null
+	* src/.../mi/core/StackFrame.java (getLocals):
+	If an exception was thrown, the array may contain null
+	entries.  Use a list and catch the exception.
+
+2002-11-06 Alain Magloire
+
+	* src/.../mi/core/cdi/StackFrame.java (getArguments):
+	If an exception was thrown, the array may contain null
 	entries.  Use and a List and catch the exception.
 
 2002-11-05 Alain Magloire
Index: src/org/eclipse/cdt/debug/mi/core/cdi/StackFrame.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/StackFrame.java,v
retrieving revision 1.12
diff -u -r1.12 StackFrame.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/StackFrame.java	6 Nov 2002 20:14:25 -0000	1.12
+++ src/org/eclipse/cdt/debug/mi/core/cdi/StackFrame.java	6 Nov 2002 21:03:47 -0000
@@ -93,7 +93,7 @@
 	 * @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 @@
 			}
 			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 @@
 			//throw e;
 			//System.err.println(e);
 		}
-		if (variables == null) {
-			variables = new ICDIVariable[0];
-		}
-		return variables;
+		return (ICDIVariable[])cdiList.toArray(new ICDIVariable[0]);
 	}
 
 	/**




Back to the top