[LLVMbugs] [Bug 5508] New: debug info for local static variables doesn't say they' re local

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Nov 16 03:16:50 PST 2009


           Summary: debug info for local static variables doesn't say
                    they're local
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-gcc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jay.foad at antixlabs.com
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=3823)
 --> (http://llvm.org/bugs/attachment.cgi?id=3823)
source file

If I compile the attached source with "llvm-gcc -g -S -emit-llvm f.c", I get
the following debug info for the local static variable "i":

!0 = metadata !{i32 458804, i32 0, metadata !1, metadata !"i", metadata !"i",
metadata !"i.1080", metadata !1, i32 3, metadata !2, i1 true, i1 true, i32*
@i.1080}; [DW_TAG_variable ]
!1 = metadata !{i32 458769, i32 0, i32 1, metadata !"f.c", metadata
!"/home/foad/", metadata !"4.2.1 (Based on Apple Inc. build 5653) (LLVM
build)", i1 true, i1 false, metadata !"", i32 0}; [DW_TAG_compile_unit ]
!2 = metadata !{i32 458788, metadata !1, metadata !"int", metadata !1, i32 0,
i64 32, i64 32, i64 0, i32 0, i32 5}; [DW_TAG_base_type ]

There's nothing in here that encodes the fact that "i" is local to the function
"f" -- it looks just like a global variable.

I guess the obvious way to encode this information would be to set the global
variable descriptor's "context" to the descriptor for the subprogram "f",
instead of the compile unit.

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