[LLVMbugs] [Bug 16967] New: Debug info for non-type template parameters lacks DW_AT_location depending on layout

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 22 02:44:39 PDT 2013


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

            Bug ID: 16967
           Summary: Debug info for non-type template parameters lacks
                    DW_AT_location depending on layout
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider:
struct Type {
  unsigned int Data1;
  unsigned short Data2, Data3;
  unsigned char Data4;
};

template<const Type *G>
const Type *func() {
  return G;
}

extern const Type Y;
const Type Y = {};
int main() {
  func<&Y>();
}

compile with:
~/llvm/build/bin/clang /var/tmp/dlb.cpp -o /var/tmp/dlb -g

dwarfdump shows:
0x000000df:     DW_TAG_template_value_parameter [9]  
                  DW_AT_type [DW_FORM_ref4]     (cu + 0x00e9 => {0x000000e9})
                  DW_AT_name [DW_FORM_strp]     ( .debug_str[0x000000a7] = "G")

We are missing DW_AT_location

in the following gdb session:
Temporary breakpoint 1, main () at /var/tmp/dlb.cpp:15
15        func<&Y>();
(gdb) step
func<&Y> () at /var/tmp/dlb.cpp:9
9         return G;
(gdb) p G
$1 = <optimized out>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130822/a29f5cf6/attachment.html>


More information about the llvm-bugs mailing list