mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-16 12:45:41 +02:00
Allow the backend to return null list of globals.
This commit is contained in:
parent
fbb25215d4
commit
de268f3094
1 changed files with 8 additions and 3 deletions
|
@ -1363,16 +1363,21 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
|
||||||
ICDITarget cdiTarget = getCDITarget();
|
ICDITarget cdiTarget = getCDITarget();
|
||||||
IGlobalVariableDescriptor[] globals = new IGlobalVariableDescriptor[0];
|
IGlobalVariableDescriptor[] globals = new IGlobalVariableDescriptor[0];
|
||||||
// If the backend can give us the globals...
|
// If the backend can give us the globals...
|
||||||
|
boolean hasCDIGlobals = false;
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
if (cdiTarget instanceof ICDITarget2)
|
if (cdiTarget instanceof ICDITarget2)
|
||||||
{
|
{
|
||||||
ICDIGlobalVariableDescriptor[] cdiGlobals = ((ICDITarget2) cdiTarget).getGlobalVariables();
|
ICDIGlobalVariableDescriptor[] cdiGlobals = ((ICDITarget2) cdiTarget).getGlobalVariables();
|
||||||
for (int i = 0; i < cdiGlobals.length; i++) {
|
hasCDIGlobals = cdiGlobals != null;
|
||||||
list.add(CVariableFactory.createGlobalVariableDescriptor(cdiGlobals[i].getName(), null));
|
if (hasCDIGlobals)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < cdiGlobals.length; i++) {
|
||||||
|
list.add(CVariableFactory.createGlobalVariableDescriptor(cdiGlobals[i].getName(), null));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// otherwise ask the binary
|
// otherwise ask the binary
|
||||||
if (list.size() == 0)
|
if (!hasCDIGlobals)
|
||||||
{
|
{
|
||||||
IBinaryObject file = getBinaryFile();
|
IBinaryObject file = getBinaryFile();
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue