<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:34 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=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Jan 19, 2015 at 10:29 AM, Adrian Prantl <span dir="ltr" class=""><<a href="mailto:aprantl@apple.com" target="_blank" class="">aprantl@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Jan 19, 2015, at 10:26 AM, Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank" class="">aprantl@apple.com</a>> wrote:</div><br class=""><div class=""><div style="word-wrap:break-word" 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" target="_blank" class="">dblaikie@gmail.com</a>> wrote:</div><br class=""><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 class=""><br class=""></div></span><div class="">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></div></blockquote><div class=""><br class="">Well all I was suggesting was dropping the prefixes - this wouldn't result in any information loss, but possibly readability loss.<br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div>As I said in the review thread, I dropped the DW_ prefix for expressions as they can be multiple of them on the same line. I have no strong feeling one way or another for Attributes or Tags.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">apart from that, I think we could drop some verbosity too - just like we now print constants, file/directory names, without their form, etc, etc - we could probably do the same for strings (printing out the offset in the string table all the time is mostly excessive) and probably other types. That would actually be a loss of information that would certainly need a flag. <br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div>One of the next things I wanted to do was to drop the FORM display by default. This would actually save a lot more horizontal space than the DW_ prefixes and in my experience you nearly never need it. Of course there needs to be a flag to get it back, because ‘nearly never’ ain’t ‘never :-).</div><div><br class=""></div><div>Fred</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">-- adrian</div></font></span><div class=""><div class="h5"><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap:break-word" 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="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="color:#afad24" class="">0x0000000b</span><span class="">: </span>TAG_compile_unit<span class=""> [1] *</span></div><div style="margin:0px;font-size:14px;font-family:Menlo;color:rgb(52,189,38)" class=""><span class=""> </span><span style="color:#34bbc7" class="">AT_producer</span><span class="">( </span>"clang version 3.5.0 (209308)"<span class=""> )</span></div><div style="margin:0px;font-size:14px;font-family:Menlo;color:rgb(213,59,211)" class=""><span class=""> </span><span style="color:#34bbc7" class="">AT_language</span><span class="">( </span>DW_LANG_C_plus_plus<span class=""> )</span></div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_name</span>( <span style="color:#34bd26" class="">"<a href="http://test.cc/" target="_blank" class="">test.cc</a>"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_stmt_list</span>( 0x00000000 )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_comp_dir</span>( <span style="color:#34bd26" class="">"/llvm_cmake"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_low_pc</span>( 0x0000000000000000 )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="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="color:#afad24" class="">0x0000002a</span><span class="">: </span>TAG_subprogram<span class=""> [2] *</span></div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_low_pc</span>( 0x0000000000000000 )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_high_pc</span>( 0x00000184 )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_frame_base</span>( rbp )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_MIPS_linkage_name</span>( <span style="color:#34bd26" class="">"_Z3bari"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_name</span>( <span style="color:#34bd26" class="">"bar"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo;color:rgb(52,189,38)" class=""><span class=""> </span><span style="color:#34bbc7" class="">AT_decl_file</span><span class="">( </span>"/llvm_cmake/<a href="http://test.cc/" target="_blank" class="">test.cc</a>"<span class=""> )</span></div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_decl_line</span>( 1 )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_type</span>( <span style="color:#afad24" class="">{0x00000057}</span> ( int ) )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="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="color:#afad24" class="">0x00000047</span><span class="">: </span>TAG_formal_parameter<span class=""> [3] </span></div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="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="color:#34bbc7" class="">AT_name</span>( <span style="color:#34bd26" class="">"y"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_decl_file</span>( <span style="color:#34bd26" class="">"/llvm_cmake/<a href="http://test.cc/" target="_blank" class="">test.cc</a>"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_decl_line</span>( 1 )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_type</span>( <span style="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="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="color:#afad24" class="">0x00000057</span><span class="">: </span>TAG_base_type<span class=""> [4] </span></div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_name</span>( <span style="color:#34bd26" class="">"int"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="color:#34bbc7" class="">AT_encoding</span>( <span style="color:#d53bd3" class="">DW_ATE_signed</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo" class=""> <span style="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="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="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="color:#afad24" class="">0x0000000b</span><span class="">: </span>TAG_compile_unit<span class=""> [1] *</span></div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x0000000c</span>: <span style="color:#34bbc7" class="">AT_producer</span>( .debug_str[0x00000000] = <span style="color:#34bd26" class="">"clang version 3.5.0 (209308)"</span> )</div><div style="margin:0px;color:rgb(213,59,211)" class=""><span style="color:#afad24" class="">0x00000010</span><span class="">: </span><span style="color:#34bbc7" class="">AT_language</span><span class="">( 0x0004 ( </span>DW_LANG_C_plus_plus<span class=""> ) )</span></div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000012</span>: <span style="color:#34bbc7" class="">AT_name</span>( .debug_str[0x0000001d] = <span style="color:#34bd26" class="">"<a href="http://test.cc/" target="_blank" class="">test.cc</a>"</span> )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000016</span>: <span style="color:#34bbc7" class="">AT_stmt_list</span>( 0x00000000 ( 0x00000000 ) )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x0000001a</span>: <span style="color:#34bbc7" class="">AT_comp_dir</span>( .debug_str[0x00000025] = <span style="color:#34bd26" class="">"/llvm_cmake"</span> )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x0000001e</span>: <span style="color:#34bbc7" class="">AT_low_pc</span>( 0x0000000000000000 )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000026</span>: <span style="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="color:#afad24" class="">0x0000002a</span><span class="">: </span>TAG_subprogram<span class=""> [2] *</span></div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x0000002b</span>: <span style="color:#34bbc7" class="">AT_low_pc</span>( 0x0000000000000000 )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000033</span>: <span style="color:#34bbc7" class="">AT_high_pc</span>( 0x00000184 )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000037</span>: <span style="color:#34bbc7" class="">AT_frame_base</span>( <0x0000000000000001> 56 ( reg6 ) )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000039</span>: <span style="color:#34bbc7" class="">AT_MIPS_linkage_name</span>( .debug_str[0x00000039] = <span style="color:#34bd26" class="">"_Z3bari"</span> )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x0000003d</span>: <span style="color:#34bbc7" class="">AT_name</span>( .debug_str[0x00000035] = <span style="color:#34bd26" class="">"bar"</span> )</div><div style="margin:0px;color:rgb(52,189,38)" class=""><span style="color:#afad24" class="">0x00000041</span><span class="">: </span><span style="color:#34bbc7" class="">AT_decl_file</span><span class="">( 0x01 ( </span>"/llvm_cmake/<a href="http://test.cc/" target="_blank" class="">test.cc</a>"<span class=""> ) )</span></div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000042</span>: <span style="color:#34bbc7" class="">AT_decl_line</span>( 0x01 ( 1 ) )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000043</span>: <span style="color:#34bbc7" class="">AT_type</span>( cu + 0x00000057 => <span style="color:#afad24" class="">{0x00000057}</span> ( int ) )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000047</span>: <span style="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="color:#afad24" class="">0x00000047</span><span class="">: </span>TAG_formal_parameter<span class=""> [3] </span></div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000048</span>: <span style="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="color:#afad24" class="">0x0000004c</span>: <span style="color:#34bbc7" class="">AT_name</span>( .debug_str[0x00000045] = <span style="color:#34bd26" class="">"y"</span> )</div><div style="margin:0px;color:rgb(52,189,38)" class=""><span style="color:#afad24" class="">0x00000050</span><span class="">: </span><span style="color:#34bbc7" class="">AT_decl_file</span><span class="">( 0x01 ( </span>"/llvm_cmake/<a href="http://test.cc/" target="_blank" class="">test.cc</a>"<span class=""> ) )</span></div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000051</span>: <span style="color:#34bbc7" class="">AT_decl_line</span>( 0x01 ( 1 ) )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000052</span>: <span style="color:#34bbc7" class="">AT_type</span>( cu + 0x00000057 => <span style="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="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="color:#afad24" class="">0x00000057</span><span class="">: </span>TAG_base_type<span class=""> [4] </span></div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x00000058</span>: <span style="color:#34bbc7" class="">AT_name</span>( .debug_str[0x00000041] = <span style="color:#34bd26" class="">"int"</span> )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x0000005c</span>: <span style="color:#34bbc7" class="">AT_encoding</span>( 0x05 ( <span style="color:#d53bd3" class="">DW_ATE_signed</span> ) )</div><div style="margin:0px" class=""><span style="color:#afad24" class="">0x0000005d</span>: <span style="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 class="">: NULL</span></div><div style="margin:0px;color:rgb(175,173,36)" class=""><span 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></div></div><br class=""></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>