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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to