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

Bug 322051

Summary: nested scoped variables visible on line after end of scope
Product: [Tools] CDT Reporter: Kirk Beitz <kirk.beitz>
Component: cdt-debug-edcAssignee: Ken Ryall <ken.ryall>
Status: RESOLVED FIXED QA Contact: Ken Ryall <ken.ryall>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 7.0   
Target Milestone: 8.0   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 322052    
Attachments:
Description Flags
fix that changes upper-bound test to be exclusive all but the end-of-function case cdtdoug: iplog+

Description Kirk Beitz CLA 2010-08-07 12:21:25 EDT
Created attachment 176090 [details]
fix that changes upper-bound test to be exclusive all but the end-of-function case

context: typically, DWARF function scope will contain no variables (and only function parameters/arguments), and this is properly reflected in edc's FunctionScope#recurseGetScopedVariables().

the DWARF function scope will then typically contain a single child which is a LexicalScope encompassing the entire function (minus prolog/epilog), and which will contain any nested LexicalScope children in the function.


fix in attached patch FunctionScope.11351.patch :
[1] change to FunctionScope.cpp to compare only against " < 0 " instead of
    " <= 0 " so upper-bound check is non-inclusive
[2] first change requires additional check to compare using " == 0 " when
    address at which to get scoped-variables is equal to the last address
    of the child scope when that child-scope's parent is the function-scope.
Comment 1 Ken Ryall CLA 2010-08-08 09:43:47 EDT
Committed to HEAD.
Comment 2 CDT Genie CLA 2010-08-08 10:23:02 EDT
*** cdt cvs genie on behalf of kryall ***
Bug 322051 -  nested scoped variables visible on line after end of scope

[*] FunctionScope.java 1.7 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/edc/org.eclipse.cdt.debug.edc/src/org/eclipse/cdt/debug/edc/internal/symbols/FunctionScope.java?root=Tools_Project&r1=1.6&r2=1.7