[LLVMbugs] [Bug 3665] New: debuginfo: static variables declared inside functions are missing original name

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Feb 25 02:44:06 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=3665

           Summary: debuginfo: static variables declared inside functions
                    are missing original name
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Example, this works with gcc and not with llvm-gcc:

int main()
{
 static int a=4;
 return a;
}

$ llvm-gcc -O0 -g foo.c

$ gdb ./a.out

(gdb) b main
(gdb) run
(gdb) print a
No symbol "a" in current context.

The reason is that 'a' is actually called a.1441:
        %1 = load i32* @a.1441, align 4 

and the debug info descriptor doesn't contain the original name:

@.str5 = internal constant [7 x i8] c"a.1441\00", section "llvm.metadata"      
        ; <[7 x i8]*> [#uses=1]
@llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type {
i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to
{ }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to {
}*), i8* getelementptr ([7 x i8]* @.str5, i32 0, i32 0), i8* getelementptr ([7
x i8]* @.str5, i32 0, i32 0), i8* null, { }* bitcast
(%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 2, { }*
bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i1 true, i1
true, { }* bitcast (i32* @a.1441 to { }*) }, section "llvm.metadata"           
; <%llvm.dbg.global_variable.type*> [#uses=0]


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list