Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322051 - nested scoped variables visible on line after end of scope
Summary: nested scoped variables visible on line after end of scope
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-edc (show other bugs)
Version: 7.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Ken Ryall CLA
QA Contact: Ken Ryall CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 322052
  Show dependency tree
 
Reported: 2010-08-07 12:21 EDT by Kirk Beitz CLA
Modified: 2012-05-22 14:43 EDT (History)
1 user (show)

See Also:


Attachments
fix that changes upper-bound test to be exclusive all but the end-of-function case (2.24 KB, patch)
2010-08-07 12:21 EDT, Kirk Beitz CLA
cdtdoug: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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