<br><br><div class="gmail_quote">On Mon Jan 19 2015 at 10:42:52 AM Frédéric Riss <<a href="mailto:friss@apple.com">friss@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Jan 19, 2015, at 10:34 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 19, 2015 at 10:29 AM, Adrian Prantl <span dir="ltr"><<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span><blockquote type="cite"><div>On Jan 19, 2015, at 10:26 AM, Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>> wrote:</div><br><div><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Jan 19, 2015, at 10:08 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Hey guys,<br><br>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></div></div></blockquote></div></div></div></blockquote><div><br></div></span><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></div></blockquote><div><br>Well all I was suggesting was dropping the prefixes - this wouldn't result in any information loss, but possibly readability loss.<br></div></div></div></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><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></div></div><div style="word-wrap:break-word"><div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>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></div></div></div></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><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></div></div></div></blockquote><div><br></div><div>Like if you're looking for the actual enum constant ;)</div><div><br></div><div>That said, I like the ideas. I'm good with it.</div><div><br></div><div>Thanks!</div><div><br></div><div>-eric</div><div> </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"><div><div></div><div>Fred</div></div></div><div style="word-wrap:break-word"><div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </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"><div><span><font color="#888888"><div><br></div><div>-- adrian</div></font></span><div><div><br><blockquote type="cite"><div><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div dir="ltr"><br>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><div>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>Here is Darwin's dwarfdump output with the default settings</div><div><br></div><div><div style="margin:0px;font-size:14px;font-family:Menlo">----------------------------------------------------------------------</div><div style="margin:0px;font-size:14px;font-family:Menlo"> File: out.o (x86_64)</div><div style="margin:0px;font-size:14px;font-family:Menlo">----------------------------------------------------------------------</div><div style="margin:0px;font-size:14px;font-family:Menlo">.debug_info contents:</div><div style="margin:0px;font-size:14px;font-family:Menlo;min-height:16px"><br></div><div style="margin:0px;font-size:14px;font-family:Menlo"><span style="color:#afad24">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"><br></div><div style="margin:0px;font-size:14px;font-family:Menlo;color:rgb(83,48,225)"><span style="color:#afad24">0x0000000b</span><span>: </span>TAG_compile_unit<span> [1] *</span></div><div style="margin:0px;font-size:14px;font-family:Menlo;color:rgb(52,189,38)"><span>             </span><span style="color:#34bbc7">AT_producer</span><span>( </span>"clang version 3.5.0 (209308)"<span> )</span></div><div style="margin:0px;font-size:14px;font-family:Menlo;color:rgb(213,59,211)"><span>             </span><span style="color:#34bbc7">AT_language</span><span>( </span>DW_LANG_C_plus_plus<span> )</span></div><div style="margin:0px;font-size:14px;font-family:Menlo">             <span style="color:#34bbc7">AT_name</span>( <span style="color:#34bd26">"<a href="http://test.cc/" target="_blank">test.cc</a>"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo">             <span style="color:#34bbc7">AT_stmt_list</span>( 0x00000000 )</div><div style="margin:0px;font-size:14px;font-family:Menlo">             <span style="color:#34bbc7">AT_comp_dir</span>( <span style="color:#34bd26">"/llvm_cmake"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo">             <span style="color:#34bbc7">AT_low_pc</span>( 0x0000000000000000 )</div><div style="margin:0px;font-size:14px;font-family:Menlo">             <span style="color:#34bbc7">AT_high_pc</span>( 0x00000184 )</div><div style="margin:0px;font-size:14px;font-family:Menlo;min-height:16px"><br></div><div style="margin:0px;font-size:14px;font-family:Menlo;color:rgb(83,48,225)"><span style="color:#afad24">0x0000002a</span><span>:     </span>TAG_subprogram<span> [2] *</span></div><div style="margin:0px;font-size:14px;font-family:Menlo">                 <span style="color:#34bbc7">AT_low_pc</span>( 0x0000000000000000 )</div><div style="margin:0px;font-size:14px;font-family:Menlo">                 <span style="color:#34bbc7">AT_high_pc</span>( 0x00000184 )</div><div style="margin:0px;font-size:14px;font-family:Menlo">                 <span style="color:#34bbc7">AT_frame_base</span>( rbp )</div><div style="margin:0px;font-size:14px;font-family:Menlo">                 <span style="color:#34bbc7">AT_MIPS_linkage_name</span>( <span style="color:#34bd26">"_Z3bari"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo">                 <span style="color:#34bbc7">AT_name</span>( <span style="color:#34bd26">"bar"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo;color:rgb(52,189,38)"><span>                 </span><span style="color:#34bbc7">AT_decl_file</span><span>( </span>"/llvm_cmake/<a href="http://test.cc/" target="_blank">test.cc</a>"<span> )</span></div><div style="margin:0px;font-size:14px;font-family:Menlo">                 <span style="color:#34bbc7">AT_decl_line</span>( 1 )</div><div style="margin:0px;font-size:14px;font-family:Menlo">                 <span style="color:#34bbc7">AT_type</span>( <span style="color:#afad24">{0x00000057}</span> ( int ) )</div><div style="margin:0px;font-size:14px;font-family:Menlo">                 <span style="color:#34bbc7">AT_external</span>( true )</div><div style="margin:0px;font-size:14px;font-family:Menlo;min-height:16px"><br></div><div style="margin:0px;font-size:14px;font-family:Menlo;color:rgb(83,48,225)"><span style="color:#afad24">0x00000047</span><span>:         </span>TAG_formal_parameter<span> [3]  </span></div><div style="margin:0px;font-size:14px;font-family:Menlo">                     <span style="color:#34bbc7">AT_location</span>( 0x00000000</div><div style="margin:0px;font-size:14px;font-family:Menlo">                        0x0000000000000000 - 0x00000000000000b9: rdi+0</div><div style="margin:0px;font-size:14px;font-family:Menlo">                        0x00000000000000b9 - 0x0000000000000184: rsp+16, deref )</div><div style="margin:0px;font-size:14px;font-family:Menlo">                     <span style="color:#34bbc7">AT_name</span>( <span style="color:#34bd26">"y"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo">                     <span style="color:#34bbc7">AT_decl_file</span>( <span style="color:#34bd26">"/llvm_cmake/<a href="http://test.cc/" target="_blank">test.cc</a>"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo">                     <span style="color:#34bbc7">AT_decl_line</span>( 1 )</div><div style="margin:0px;font-size:14px;font-family:Menlo">                     <span style="color:#34bbc7">AT_type</span>( <span style="color:#afad24">{0x00000057}</span> ( int ) )</div><div style="margin:0px;font-size:14px;font-family:Menlo;min-height:16px"><br></div><div style="margin:0px;font-size:14px;font-family:Menlo"><span style="color:#afad24">0x00000056</span>:         NULL</div><div style="margin:0px;font-size:14px;font-family:Menlo;min-height:16px"><br></div><div style="margin:0px;font-size:14px;font-family:Menlo;color:rgb(83,48,225)"><span style="color:#afad24">0x00000057</span><span>:     </span>TAG_base_type<span> [4]  </span></div><div style="margin:0px;font-size:14px;font-family:Menlo">                 <span style="color:#34bbc7">AT_name</span>( <span style="color:#34bd26">"int"</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo">                 <span style="color:#34bbc7">AT_encoding</span>( <span style="color:#d53bd3">DW_ATE_signed</span> )</div><div style="margin:0px;font-size:14px;font-family:Menlo">                 <span style="color:#34bbc7">AT_byte_size</span>( 0x04 )</div><div style="margin:0px;font-size:14px;font-family:Menlo;min-height:16px"><br></div><div style="margin:0px;font-size:14px;font-family:Menlo"><span style="color:#afad24">0x0000005e</span>:     NULL</div><div style="margin:0px;font-size:14px;font-family:Menlo;min-height:16px"><br></div></div><div style="margin:0px;font-size:14px;font-family:Menlo;min-height:16px"><br></div><div style="margin:0px;font-size:14px;font-family:Menlo;min-height:16px"><div style="font-family:Helvetica;font-size:12px">and here is the same file with -v:</div><div><br></div></div><div style="margin:0px;font-size:14px;font-family:Menlo;min-height:16px"><div style="margin:0px">----------------------------------------------------------------------</div><div style="margin:0px"> File: out.o {mach64-x86_64-MH_OBJECT} (x86_64)</div><div style="margin:0px">----------------------------------------------------------------------</div><div style="margin:0px">.debug_info contents:</div><div style="margin:0px;min-height:16px"><br></div><div style="margin:0px"><span style="color:#afad24">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"><br></div><div style="margin:0px;color:rgb(83,48,225)"><span style="color:#afad24">0x0000000b</span><span>: </span>TAG_compile_unit<span> [1] *</span></div><div style="margin:0px"><span style="color:#afad24">0x0000000c</span>:  <span style="color:#34bbc7">AT_producer</span>( .debug_str[0x00000000] = <span style="color:#34bd26">"clang version 3.5.0 (209308)"</span> )</div><div style="margin:0px;color:rgb(213,59,211)"><span style="color:#afad24">0x00000010</span><span>:  </span><span style="color:#34bbc7">AT_language</span><span>( 0x0004 ( </span>DW_LANG_C_plus_plus<span> ) )</span></div><div style="margin:0px"><span style="color:#afad24">0x00000012</span>:  <span style="color:#34bbc7">AT_name</span>( .debug_str[0x0000001d] = <span style="color:#34bd26">"<a href="http://test.cc/" target="_blank">test.cc</a>"</span> )</div><div style="margin:0px"><span style="color:#afad24">0x00000016</span>:  <span style="color:#34bbc7">AT_stmt_list</span>( 0x00000000 ( 0x00000000 ) )</div><div style="margin:0px"><span style="color:#afad24">0x0000001a</span>:  <span style="color:#34bbc7">AT_comp_dir</span>( .debug_str[0x00000025] = <span style="color:#34bd26">"/llvm_cmake"</span> )</div><div style="margin:0px"><span style="color:#afad24">0x0000001e</span>:  <span style="color:#34bbc7">AT_low_pc</span>( 0x0000000000000000 )</div><div style="margin:0px"><span style="color:#afad24">0x00000026</span>:  <span style="color:#34bbc7">AT_high_pc</span>( 0x00000184 )</div><div style="margin:0px;min-height:16px"><br></div><div style="margin:0px;color:rgb(83,48,225)"><span style="color:#afad24">0x0000002a</span><span>:     </span>TAG_subprogram<span> [2] *</span></div><div style="margin:0px"><span style="color:#afad24">0x0000002b</span>:      <span style="color:#34bbc7">AT_low_pc</span>( 0x0000000000000000 )</div><div style="margin:0px"><span style="color:#afad24">0x00000033</span>:      <span style="color:#34bbc7">AT_high_pc</span>( 0x00000184 )</div><div style="margin:0px"><span style="color:#afad24">0x00000037</span>:      <span style="color:#34bbc7">AT_frame_base</span>( <0x0000000000000001> 56  ( reg6 ) )</div><div style="margin:0px"><span style="color:#afad24">0x00000039</span>:      <span style="color:#34bbc7">AT_MIPS_linkage_name</span>( .debug_str[0x00000039] = <span style="color:#34bd26">"_Z3bari"</span> )</div><div style="margin:0px"><span style="color:#afad24">0x0000003d</span>:      <span style="color:#34bbc7">AT_name</span>( .debug_str[0x00000035] = <span style="color:#34bd26">"bar"</span> )</div><div style="margin:0px;color:rgb(52,189,38)"><span style="color:#afad24">0x00000041</span><span>:      </span><span style="color:#34bbc7">AT_decl_file</span><span>( 0x01 ( </span>"/llvm_cmake/<a href="http://test.cc/" target="_blank">test.cc</a>"<span> ) )</span></div><div style="margin:0px"><span style="color:#afad24">0x00000042</span>:      <span style="color:#34bbc7">AT_decl_line</span>( 0x01 ( 1 ) )</div><div style="margin:0px"><span style="color:#afad24">0x00000043</span>:      <span style="color:#34bbc7">AT_type</span>( cu + 0x00000057 => <span style="color:#afad24">{0x00000057}</span> ( int ) )</div><div style="margin:0px"><span style="color:#afad24">0x00000047</span>:      <span style="color:#34bbc7">AT_external</span>( true )</div><div style="margin:0px;min-height:16px"><br></div><div style="margin:0px;color:rgb(83,48,225)"><span style="color:#afad24">0x00000047</span><span>:         </span>TAG_formal_parameter<span> [3]  </span></div><div style="margin:0px"><span style="color:#afad24">0x00000048</span>:          <span style="color:#34bbc7">AT_location</span>( 0x00000000</div><div style="margin:0px">                        0x0000000000000000 - 0x00000000000000b9: breg5 +0</div><div style="margin:0px">                        0x00000000000000b9 - 0x0000000000000184: breg7 +16, deref )</div><div style="margin:0px"><span style="color:#afad24">0x0000004c</span>:          <span style="color:#34bbc7">AT_name</span>( .debug_str[0x00000045] = <span style="color:#34bd26">"y"</span> )</div><div style="margin:0px;color:rgb(52,189,38)"><span style="color:#afad24">0x00000050</span><span>:          </span><span style="color:#34bbc7">AT_decl_file</span><span>( 0x01 ( </span>"/llvm_cmake/<a href="http://test.cc/" target="_blank">test.cc</a>"<span> ) )</span></div><div style="margin:0px"><span style="color:#afad24">0x00000051</span>:          <span style="color:#34bbc7">AT_decl_line</span>( 0x01 ( 1 ) )</div><div style="margin:0px"><span style="color:#afad24">0x00000052</span>:          <span style="color:#34bbc7">AT_type</span>( cu + 0x00000057 => <span style="color:#afad24">{0x00000057}</span> ( int ) )</div><div style="margin:0px;min-height:16px"><br></div><div style="margin:0px"><span style="color:#afad24">0x00000056</span>:         NULL</div><div style="margin:0px;min-height:16px"><br></div><div style="margin:0px;color:rgb(83,48,225)"><span style="color:#afad24">0x00000057</span><span>:     </span>TAG_base_type<span> [4]  </span></div><div style="margin:0px"><span style="color:#afad24">0x00000058</span>:      <span style="color:#34bbc7">AT_name</span>( .debug_str[0x00000041] = <span style="color:#34bd26">"int"</span> )</div><div style="margin:0px"><span style="color:#afad24">0x0000005c</span>:      <span style="color:#34bbc7">AT_encoding</span>( 0x05 ( <span style="color:#d53bd3">DW_ATE_signed</span> ) )</div><div style="margin:0px"><span style="color:#afad24">0x0000005d</span>:      <span style="color:#34bbc7">AT_byte_size</span>( 0x04 )</div><div style="margin:0px;min-height:16px"><br></div><div style="margin:0px;color:rgb(175,173,36)">0x0000005e<span>:     NULL</span></div><div style="margin:0px;color:rgb(175,173,36)"><span><br></span></div><div style="margin:0px;color:rgb(175,173,36)"><div style="font-family:Helvetica;font-size:12px">I particularly like the inline location expressions.</div><div style="font-family:Helvetica;font-size:12px"><br></div><div style="font-family:Helvetica;font-size:12px">-- adrian</div><div><br></div></div></div></div></div></blockquote></div></div></div><br></div></blockquote></div><br></div></div>
</div></blockquote></div></div></blockquote></div>