<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 31, 2014 at 2:08 PM, Robinson, Paul <span dir="ltr"><<a href="mailto:Paul_Robinson@playstation.sony.com" target="_blank">Paul_Robinson@playstation.sony.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This just seems wrong. </blockquote><div><br></div><div>How so? (yeah, I'd sort of like it if the debugger assumed that a DW_TAG_class/structure with a DW_AT_signature was assumed to be a declaration (of sorts)) I can think of a few ways it seems wrong, but curious what you've got in mind.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> What prompted it?<br></blockquote><div><br></div><div>Several failures in gdb.cp/m-static.exp in the GDB 7.5 test suite. (there's still one more failure I'm investigating most likely due to missing DW_AT_stmt_list on type units)<br>
<br>The story goes something like this:<br><br>* Type goes in a type unit.<br>* 'skeletal' type (DW_TAG_class with a DW_AT_signature) goes in the compile unit.<br>* but now you want to reference one of the members of the type from within the compile unit (in m-static's case, it's because you have an out-of-line definition of a static member variable), so insert a declaration of that particular member into the 'skeletal' type.<br>
<br>This freaks out GDB because it assumes the type with members (even though it has DW_AT_signature) is a definition, it seems.<br><br>I can roll back the patch locally to show/demonstrate more specifically what the failure mode is.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
--paulr<br>
<div class="HOEnZb"><div class="h5"><br>
> -----Original Message-----<br>
> From: <a href="mailto:llvm-commits-bounces@cs.uiuc.edu">llvm-commits-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvm-commits-">llvm-commits-</a><br>
> <a href="mailto:bounces@cs.uiuc.edu">bounces@cs.uiuc.edu</a>] On Behalf Of David Blaikie<br>
> Sent: Friday, January 31, 2014 11:52 AM<br>
> To: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> Subject: [llvm] r200569 - DebugInfo: Flag type unit references as<br>
> declarations<br>
><br>
> Author: dblaikie<br>
> Date: Fri Jan 31 13:52:26 2014<br>
> New Revision: 200569<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=200569&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=200569&view=rev</a><br>
> Log:<br>
> DebugInfo: Flag type unit references as declarations<br>
><br>
> This ensures DWARF consumers don't confuse these references for<br>
> definitions. I'd argue it might be nice to improve debuggers so we don't<br>
> need this, but it's just one field in an abbreviation anyway - so it<br>
> doesn't seem worth the fight.<br>
><br>
> Modified:<br>
>     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
>     llvm/trunk/test/DebugInfo/X86/generate-odr-hash.ll<br>
><br>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=200569&r1=2<br>
> 00568&r2=200569&view=diff<br>
> ========================================================================<br>
> ======<br>
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Jan 31 13:52:26<br>
> 2014<br>
> @@ -3016,6 +3016,11 @@ void DwarfDebug::emitDebugStrDWO() {<br>
>  void DwarfDebug::addDwarfTypeUnitType(DICompileUnit CUNode,<br>
>                                        StringRef Identifier, DIE<br>
> *RefDie,<br>
>                                        DICompositeType CTy) {<br>
> +  // Flag the type unit reference as a declaration so that if it<br>
> contains<br>
> +  // members (implicit special members, static data member definitions,<br>
> member<br>
> +  // declarations for definitions in this CU, etc) consumers don't get<br>
> confused<br>
> +  // and think this is a full definition.<br>
> +  CUMap.begin()->second->addFlag(RefDie, dwarf::DW_AT_declaration);<br>
><br>
>    const DwarfTypeUnit *&TU = DwarfTypeUnits[CTy];<br>
>    if (TU) {<br>
><br>
> Modified: llvm/trunk/test/DebugInfo/X86/generate-odr-hash.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/test/DebugInfo/X86/generate-odr-<br>
> hash.ll?rev=200569&r1=200568&r2=200569&view=diff<br>
> ========================================================================<br>
> ======<br>
> --- llvm/trunk/test/DebugInfo/X86/generate-odr-hash.ll (original)<br>
> +++ llvm/trunk/test/DebugInfo/X86/generate-odr-hash.ll Fri Jan 31<br>
> 13:52:26 2014<br>
> @@ -51,8 +51,10 @@<br>
>  ; CHECK: Compile Unit: length = [[CU_SIZE:[0-9a-f]+]]<br>
><br>
>  ; CHECK: DW_TAG_structure_type<br>
> +; CHECK-NEXT: DW_AT_declaration<br>
>  ; CHECK-NEXT: DW_AT_signature<br>
>  ; CHECK: DW_TAG_class_type<br>
> +; CHECK-NEXT: DW_AT_declaration<br>
>  ; CHECK-NEXT: DW_AT_signature<br>
><br>
>  ; Ensure the CU-local type 'walrus' is not placed in a type unit.<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br>
<br>
</div></div></blockquote></div><br></div></div>