<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 04 Sep 2014, at 17:19, 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=""><br class=""><div class="gmail_quote">On Thu, Sep 4, 2014 at 6:55 AM, Frederic Riss <span dir="ltr" class=""><<a href="mailto:friss@apple.com" target="_blank" class="">friss@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">Hi dblaikie, echristo, aprantl,<br class="">
<br class="">
This is the merge of 2 patches:<br class="">
<br class="">
Pass the DWARFUnit to DWARFDebugLine::getFileNameByIndex().<br class="">
<br class="">
This way it can query the compilation dir when it is referenced (when a file references directory index 0, it refers to the compilation dir).<br class=""></blockquote><div class=""><br class=""></div><div class="">Alternatively (Though not necessarily better - open to opinions/preferences) DWARFUnit could have a wrapper for getFileNameByIndex and could be returned a zero/default/something that the DWARFUnit could detect and return the CU.<br class="">
<br class="">Or the DWARFDebugLine could be constructed with its unit, or just with the comp_dir of its unit so it didn't have to be passed in/queried for on every lookup?</div><div class=""><br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div>I’m currently working on an alternative where I turn DWARFContext.cpp::getFileNameForUnit() and getFileLineInfoForCompileUnit() into LineTable methods. This way I reduce code duplication with what I’ve added to DWARFDebugInfoEntry::dump. I’ll see how that turns out.</div><br class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br class="">
and:<br class="">
<br class="">
[dwarfdump] Implement extraction of file information referenced in .debug_info.<br class="">
<br class="">
This patch pretty prints the contents of the DW_AT_decl_file, DW_AT_call_file, DW_AT_decl_line and DW_AT_call line attributes.<br class="">
Drop the const on the passed DWARFUnit to be able to call getLineTableForUnit (the line table construction is lazy, thus the getter might modify the Unit).<br class=""></blockquote><div class=""><br class=""></div><div class="">What pretty printing occurs for lines? (obviously for files this would allow you to print the file name rather than the file number - but DW_AT_decl/call_line already contain the line number, right?)</div></div></div></div></blockquote><div><br class=""></div><div>It’s just that they’re printed as decimal numbers. Which is indisputably more pretty for line numbers :-)</div><div><br class=""></div><div>Fred</div><br class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="">
<a href="http://reviews.llvm.org/D5192" target="_blank" class="">http://reviews.llvm.org/D5192</a><br class="">
<br class="">
Files:<br class="">
  lib/DebugInfo/DWARFContext.cpp<br class="">
  lib/DebugInfo/DWARFDebugInfoEntry.cpp<br class="">
  lib/DebugInfo/DWARFDebugInfoEntry.h<br class="">
  lib/DebugInfo/DWARFDebugLine.cpp<br class="">
  lib/DebugInfo/DWARFDebugLine.h<br class="">
  test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll<br class="">
  test/DebugInfo/X86/fission-cu.ll<br class="">
  test/DebugInfo/namespace.ll<br class="">
  test/MC/MachO/gen-dwarf.s<br class="">
</blockquote></div><br class=""></div></div>
</blockquote></div><br class=""></body></html>