mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 06:32:10 +02:00
Fix bug 91771.
This commit is contained in:
parent
c24e249051
commit
eec83cfb66
2 changed files with 41 additions and 6 deletions
|
@ -0,0 +1,24 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Nokia and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Nokia - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.debug.core.cdi.model;
|
||||
|
||||
import org.eclipse.cdt.debug.core.model.IGlobalVariableDescriptor;
|
||||
|
||||
public interface ICDITarget2 extends ICDITarget {
|
||||
|
||||
|
||||
/** Returns a list of global variables for the targeted process
|
||||
* @return list of globals for the targeted process
|
||||
*/
|
||||
IGlobalVariableDescriptor[] getGlobalVariables();
|
||||
|
||||
}
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
* Ken Ryall (Nokia) - bugs 118894, 170027
|
||||
* Ken Ryall (Nokia) - bugs 118894, 170027, 91771
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.internal.core.model;
|
||||
|
||||
|
@ -59,6 +59,7 @@ 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.ICDISignal;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget2;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration2;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
|
||||
|
@ -1343,12 +1344,22 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
|
|||
* @see org.eclipse.cdt.debug.core.model.IExecFileInfo#getGlobals()
|
||||
*/
|
||||
public IGlobalVariableDescriptor[] getGlobals() throws DebugException {
|
||||
ArrayList list = new ArrayList();
|
||||
IBinaryObject file = getBinaryFile();
|
||||
if (file != null) {
|
||||
list.addAll( getCFileGlobals( file ) );
|
||||
ICDITarget cdiTarget = getCDITarget();
|
||||
IGlobalVariableDescriptor[] globals = new IGlobalVariableDescriptor[0];
|
||||
// If the backend can give us the globals...
|
||||
if (cdiTarget instanceof ICDITarget2)
|
||||
globals = ((ICDITarget2) cdiTarget).getGlobalVariables();
|
||||
// otherwise ask the binary
|
||||
if (globals.length == 0)
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
IBinaryObject file = getBinaryFile();
|
||||
if (file != null) {
|
||||
list.addAll( getCFileGlobals( file ) );
|
||||
}
|
||||
globals = (IGlobalVariableDescriptor[])list.toArray( new IGlobalVariableDescriptor[list.size()] );
|
||||
}
|
||||
return (IGlobalVariableDescriptor[])list.toArray( new IGlobalVariableDescriptor[list.size()] );
|
||||
return globals;
|
||||
}
|
||||
|
||||
private List getCFileGlobals( IBinaryObject file ) throws DebugException {
|
||||
|
|
Loading…
Add table
Reference in a new issue