https://llvm.org/bugs/show_bug.cgi?id=24994

            Bug ID: 24994
           Summary: Wrong value when evaluating a shadowed global inside
                    the namespace
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev@lists.llvm.org
          Reporter: dawn+bugzi...@burble.org
                CC: llvm-b...@lists.llvm.org
    Classification: Unclassified

If a global identifier is over shadowed in a namespace, evaluating the global
inside the namespace returns the value of the identifier in the namespace, not
the global. See comments in the following test case.  This started with lldb
r247746.  (Note: test case was tested with clang based on svn 3.4, 3.6 and
trunk on OSX).

    #include <stdio.h>
    int make_used;
    static int ScNSpacGl = 2100;
    namespace NS2 {
        static int ScNSpacGl = 2111;
        static void NS2Func(void) {
            // Set BP here, eval ::ScNSpacGl, Exp: 2100 Act: 2111
            printf("eval @BP line=%d: ::ScNSpacGl = %d\n", __LINE__,
::ScNSpacGl);
            make_used += ScNSpacGl;
        }
    }
    int main(int argc, char **argv) {
        NS2::NS2Func();
        return make_used == 0;
    }

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to