From de268f3094154a79e06e347a79bd39c6c7255592 Mon Sep 17 00:00:00 2001 From: Ken Ryall Date: Thu, 7 Jun 2007 03:24:01 +0000 Subject: [PATCH] Allow the backend to return null list of globals. --- .../cdt/debug/internal/core/model/CDebugTarget.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java index f80194f5bd5..81ad1d14d6a 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java @@ -1363,16 +1363,21 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv ICDITarget cdiTarget = getCDITarget(); IGlobalVariableDescriptor[] globals = new IGlobalVariableDescriptor[0]; // If the backend can give us the globals... + boolean hasCDIGlobals = false; ArrayList list = new ArrayList(); if (cdiTarget instanceof ICDITarget2) { ICDIGlobalVariableDescriptor[] cdiGlobals = ((ICDITarget2) cdiTarget).getGlobalVariables(); - for (int i = 0; i < cdiGlobals.length; i++) { - list.add(CVariableFactory.createGlobalVariableDescriptor(cdiGlobals[i].getName(), null)); + hasCDIGlobals = cdiGlobals != null; + if (hasCDIGlobals) + { + for (int i = 0; i < cdiGlobals.length; i++) { + list.add(CVariableFactory.createGlobalVariableDescriptor(cdiGlobals[i].getName(), null)); + } } } // otherwise ask the binary - if (list.size() == 0) + if (!hasCDIGlobals) { IBinaryObject file = getBinaryFile(); if (file != null) {