Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 358262

Summary: DwarfDebugInfoProvider#filterOutLocalVariables filters global rather than local variables
Product: [Tools] CDT Reporter: Daniel Thomas <daniel.thomas>
Component: cdt-debug-edcAssignee: Ken Ryall <ken.ryall>
Status: RESOLVED WONTFIX QA Contact: Ken Ryall <ken.ryall>
Severity: normal    
Priority: P3 CC: cdtdoug, kirk.beitz
Version: 8.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
One line fix to fix this -> use IModuleScope instead none

Description Daniel Thomas CLA 2011-09-20 11:27:46 EDT
Build Identifier: 

In f7c4790c134d0cdc30cdbe8d2a016bf27cd25528 changes to DwarfDebugInfoProvider: the adding of the filterOutLocalVariables(List<IVariable> variables) method and the using of it to remove variables from the result of getVariablesByName(String name, boolean globalsOnly) causes a regression in that it removes all global variables and leaves most local ones - it has the opposite behaviour to that which was intended.
Global variables have their scope as a IModuleScope and the test removes all variables which do not have their scope a ICompileUnit scope.
Changing this to IModuleScope fixes this.

Reproducible: Always
Comment 1 Daniel Thomas CLA 2011-09-20 11:28:19 EDT
Created attachment 203693 [details]
One line fix to fix this -> use IModuleScope instead
Comment 2 Kirk Beitz CLA 2011-09-21 16:36:25 EDT
daniel, i hate to tell you discovered something we already have locally.

we actually filter for both ICompileUnitScope & IModuleScope now, and i think we have the list of variables we want.

the change will be in our next merge … though we have some other priorities at the moment.
Comment 3 Jonah Graham CLA 2019-12-30 18:39:30 EST
(this is part of a batch change)

The Eclipse CDT EDC (https://wiki.eclipse.org/CDT/cdt-debug-edc) is now obsolete and has not had any active development since 2011. Therefore the still open bugs are being marked as wontfix.

The git repo for the project still exists for posterity at https://git.eclipse.org/c/cdt/org.eclipse.cdt.edc.git/