1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 08:45:44 +02:00

Bug 185956, now returns CDI interface.

This commit is contained in:
Ken Ryall 2007-05-11 02:21:57 +00:00
parent 548f63a12a
commit 04f8a1f32f
2 changed files with 10 additions and 5 deletions

View file

@ -11,7 +11,6 @@
package org.eclipse.cdt.debug.core.cdi.model; package org.eclipse.cdt.debug.core.cdi.model;
import org.eclipse.cdt.debug.core.model.IGlobalVariableDescriptor;
public interface ICDITarget2 extends ICDITarget { public interface ICDITarget2 extends ICDITarget {
@ -19,6 +18,6 @@ public interface ICDITarget2 extends ICDITarget {
/** Returns a list of global variables for the targeted process /** Returns a list of global variables for the targeted process
* @return list of globals for the targeted process * @return list of globals for the targeted process
*/ */
IGlobalVariableDescriptor[] getGlobalVariables(); ICDIGlobalVariableDescriptor[] getGlobalVariables();
} }

View file

@ -56,6 +56,7 @@ import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent;
import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent;
import org.eclipse.cdt.debug.core.cdi.model.ICDIAddressFactoryManagement; import org.eclipse.cdt.debug.core.cdi.model.ICDIAddressFactoryManagement;
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDIGlobalVariableDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; import org.eclipse.cdt.debug.core.cdi.model.ICDISignal;
@ -1362,18 +1363,23 @@ 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...
ArrayList list = new ArrayList();
if (cdiTarget instanceof ICDITarget2) if (cdiTarget instanceof ICDITarget2)
globals = ((ICDITarget2) cdiTarget).getGlobalVariables(); {
ICDIGlobalVariableDescriptor[] cdiGlobals = ((ICDITarget2) cdiTarget).getGlobalVariables();
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 (globals.length == 0) if (globals.length == 0)
{ {
ArrayList list = new ArrayList();
IBinaryObject file = getBinaryFile(); IBinaryObject file = getBinaryFile();
if (file != null) { if (file != null) {
list.addAll( getCFileGlobals( file ) ); list.addAll( getCFileGlobals( file ) );
} }
globals = (IGlobalVariableDescriptor[])list.toArray( new IGlobalVariableDescriptor[list.size()] );
} }
globals = (IGlobalVariableDescriptor[])list.toArray( new IGlobalVariableDescriptor[list.size()] );
return globals; return globals;
} }