<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 19, 2015, at 10:26 AM, Adrian Prantl <<a href="mailto:aprantl@apple.com" class="">aprantl@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 19, 2015, at 10:08 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hey guys,<br class=""><br class="">Frederic is introducing the expression dumping support and in the interests of tersity is skipping the "DW_" in every "DW_OP" (heck, we could even skip the "OP" given the context - nothing else textual can appear there, right?)<br class=""></div></div></blockquote></div></div></div></blockquote><div><br class=""></div><div>I think it always depends on what you are debugging. When I’m interested whether the encoding is correct, I think I’d prefer to have all these details in there, even if they are redundant. When I’m debugging, e.g., the source location associated with a function argument, I wouldn’t care about which Form is used to encode the information.</div><div><br class=""></div><div>-- adrian</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><br class="">Any thoughts on skipping the "DW_" (maybe even the AT/TAG/FORM too) in the rest of dwarfdump? (skipping the AT/TAG (FORM would be relatively easy I think) would be a bit trickier, but still identifiable/solvable) I haven't tried it to see how it looks/reads.</div>
</div></blockquote></div><br class=""><div class="">I think we should have a switchable level of verbosity. I think that the Darwin dwarfdump utility could serve as an example (at least to fuel the discussion):</div><div class="">Here is Darwin's dwarfdump output with the default settings</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class="">----------------------------------------------------------------------</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> File: out.o (x86_64)</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class="">----------------------------------------------------------------------</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class="">.debug_info contents:</div><div style="margin: 0px; font-size: 14px; font-family: Menlo; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000000</span>: Compile Unit: length = 0x0000005b version = 0x0004 abbr_offset = 0x00000000 addr_size = 0x08 (next CU at 0x0000005f)</div><div style="margin: 0px; font-size: 14px; font-family: Menlo; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; font-family: Menlo; color: rgb(83, 48, 225);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000000b</span><span style="" class="">: </span>TAG_compile_unit<span style="" class=""> [1] *</span></div><div style="margin: 0px; font-size: 14px; font-family: Menlo; color: rgb(52, 189, 38);" class=""><span style="" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_producer</span><span style="" class="">( </span>"clang version 3.5.0 (209308)"<span style="" class=""> )</span></div><div style="margin: 0px; font-size: 14px; font-family: Menlo; color: rgb(213, 59, 211);" class=""><span style="" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_language</span><span style="" class="">( </span>DW_LANG_C_plus_plus<span style="" class=""> )</span></div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_name</span>( <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"<a href="http://test.cc/" class="">test.cc</a>"</span> )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_stmt_list</span>( 0x00000000 )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_comp_dir</span>( <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"/llvm_cmake"</span> )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_low_pc</span>( 0x0000000000000000 )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_high_pc</span>( 0x00000184 )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; font-family: Menlo; color: rgb(83, 48, 225);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000002a</span><span style="" class="">: </span>TAG_subprogram<span style="" class=""> [2] *</span></div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_low_pc</span>( 0x0000000000000000 )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_high_pc</span>( 0x00000184 )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_frame_base</span>( rbp )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_MIPS_linkage_name</span>( <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"_Z3bari"</span> )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_name</span>( <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"bar"</span> )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo; color: rgb(52, 189, 38);" class=""><span style="" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_decl_file</span><span style="" class="">( </span>"/llvm_cmake/<a href="http://test.cc/" class="">test.cc</a>"<span style="" class=""> )</span></div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_decl_line</span>( 1 )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_type</span>( <span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">{0x00000057}</span> ( int ) )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_external</span>( true )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; font-family: Menlo; color: rgb(83, 48, 225);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000047</span><span style="" class="">: </span>TAG_formal_parameter<span style="" class=""> [3] </span></div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_location</span>( 0x00000000</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> 0x0000000000000000 - 0x00000000000000b9: rdi+0</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> 0x00000000000000b9 - 0x0000000000000184: rsp+16, deref )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_name</span>( <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"y"</span> )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_decl_file</span>( <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"/llvm_cmake/<a href="http://test.cc/" class="">test.cc</a>"</span> )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_decl_line</span>( 1 )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_type</span>( <span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">{0x00000057}</span> ( int ) )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000056</span>: NULL</div><div style="margin: 0px; font-size: 14px; font-family: Menlo; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; font-family: Menlo; color: rgb(83, 48, 225);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000057</span><span style="" class="">: </span>TAG_base_type<span style="" class=""> [4] </span></div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_name</span>( <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"int"</span> )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_encoding</span>( <span style="font-variant-ligatures: no-common-ligatures; color: #d53bd3" class="">DW_ATE_signed</span> )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_byte_size</span>( 0x04 )</div><div style="margin: 0px; font-size: 14px; font-family: Menlo; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000005e</span>: NULL</div><div style="margin: 0px; font-size: 14px; font-family: Menlo; min-height: 16px;" class=""><br class=""></div></div><div style="margin: 0px; font-size: 14px; font-family: Menlo; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; font-family: Menlo; min-height: 16px;" class=""><div style="font-family: Helvetica; font-size: 12px;" class="">and here is the same file with -v:</div><div class=""><br class=""></div></div><div style="margin: 0px; font-size: 14px; font-family: Menlo; min-height: 16px;" class=""><div style="margin: 0px;" class="">----------------------------------------------------------------------</div><div style="margin: 0px;" class=""> File: out.o {mach64-x86_64-MH_OBJECT} (x86_64)</div><div style="margin: 0px;" class="">----------------------------------------------------------------------</div><div style="margin: 0px;" class="">.debug_info contents:</div><div style="margin: 0px; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000000</span>: Compile Unit: length = 0x0000005b version = 0x0004 abbr_offset = 0x00000000 addr_size = 0x08 (next CU at 0x0000005f)</div><div style="margin: 0px; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; color: rgb(83, 48, 225);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000000b</span><span style="" class="">: </span>TAG_compile_unit<span style="" class=""> [1] *</span></div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000000c</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_producer</span>( .debug_str[0x00000000] = <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"clang version 3.5.0 (209308)"</span> )</div><div style="margin: 0px; color: rgb(213, 59, 211);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000010</span><span style="" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_language</span><span style="" class="">( 0x0004 ( </span>DW_LANG_C_plus_plus<span style="" class=""> ) )</span></div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000012</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_name</span>( .debug_str[0x0000001d] = <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"<a href="http://test.cc/" class="">test.cc</a>"</span> )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000016</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_stmt_list</span>( 0x00000000 ( 0x00000000 ) )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000001a</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_comp_dir</span>( .debug_str[0x00000025] = <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"/llvm_cmake"</span> )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000001e</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_low_pc</span>( 0x0000000000000000 )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000026</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_high_pc</span>( 0x00000184 )</div><div style="margin: 0px; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; color: rgb(83, 48, 225);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000002a</span><span style="" class="">: </span>TAG_subprogram<span style="" class=""> [2] *</span></div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000002b</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_low_pc</span>( 0x0000000000000000 )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000033</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_high_pc</span>( 0x00000184 )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000037</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_frame_base</span>( <0x0000000000000001> 56 ( reg6 ) )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000039</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_MIPS_linkage_name</span>( .debug_str[0x00000039] = <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"_Z3bari"</span> )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000003d</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_name</span>( .debug_str[0x00000035] = <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"bar"</span> )</div><div style="margin: 0px; color: rgb(52, 189, 38);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000041</span><span style="" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_decl_file</span><span style="" class="">( 0x01 ( </span>"/llvm_cmake/<a href="http://test.cc/" class="">test.cc</a>"<span style="" class=""> ) )</span></div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000042</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_decl_line</span>( 0x01 ( 1 ) )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000043</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_type</span>( cu + 0x00000057 => <span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">{0x00000057}</span> ( int ) )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000047</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_external</span>( true )</div><div style="margin: 0px; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; color: rgb(83, 48, 225);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000047</span><span style="" class="">: </span>TAG_formal_parameter<span style="" class=""> [3] </span></div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000048</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_location</span>( 0x00000000</div><div style="margin: 0px;" class=""> 0x0000000000000000 - 0x00000000000000b9: breg5 +0</div><div style="margin: 0px;" class=""> 0x00000000000000b9 - 0x0000000000000184: breg7 +16, deref )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000004c</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_name</span>( .debug_str[0x00000045] = <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"y"</span> )</div><div style="margin: 0px; color: rgb(52, 189, 38);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000050</span><span style="" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_decl_file</span><span style="" class="">( 0x01 ( </span>"/llvm_cmake/<a href="http://test.cc/" class="">test.cc</a>"<span style="" class=""> ) )</span></div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000051</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_decl_line</span>( 0x01 ( 1 ) )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000052</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_type</span>( cu + 0x00000057 => <span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">{0x00000057}</span> ( int ) )</div><div style="margin: 0px; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000056</span>: NULL</div><div style="margin: 0px; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; color: rgb(83, 48, 225);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000057</span><span style="" class="">: </span>TAG_base_type<span style="" class=""> [4] </span></div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x00000058</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_name</span>( .debug_str[0x00000041] = <span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">"int"</span> )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000005c</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_encoding</span>( 0x05 ( <span style="font-variant-ligatures: no-common-ligatures; color: #d53bd3" class="">DW_ATE_signed</span> ) )</div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #afad24" class="">0x0000005d</span>: <span style="font-variant-ligatures: no-common-ligatures; color: #34bbc7" class="">AT_byte_size</span>( 0x04 )</div><div style="margin: 0px; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; color: rgb(175, 173, 36);" class="">0x0000005e<span style="" class="">: NULL</span></div><div style="margin: 0px; color: rgb(175, 173, 36);" class=""><span style="" class=""><br class=""></span></div><div style="margin: 0px; color: rgb(175, 173, 36);" class=""><div style="font-family: Helvetica; font-size: 12px;" class="">I particularly like the inline location expressions.</div><div style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px;" class="">-- adrian</div><div class=""><br class=""></div></div></div></div></div></blockquote></div><br class=""></body></html>