<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> David Blaikie [mailto:dblaikie@gmail.com]
<br>
<b>Sent:</b> Thursday, April 27, 2017 4:11 PM<br>
<b>To:</b> reviews+D32618+public+c75911a8bdafd5f2@reviews.llvm.org; Pieb, Wolfgang; aprantl@apple.com; echristo@gmail.com; dexonsmith@apple.com; Robinson, Paul<br>
<b>Cc:</b> llvm-commits@lists.llvm.org<br>
<b>Subject:</b> Re: [PATCH] D32618: DWARF: Implementation of v5 string offsets table (.debug_str_offsets[.dwo] section)<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Looks like you've got test coverage for the parsing code directly (with the asm file) - so I'd probably split it anyway, since it's pretty much "free" to do - committing the parsing/dumping code first, then
 committing the LLVM generation code.<br>
<br>
Does this change modify the behavior of the existing str_off.dwo support? (I don't know if it ended up being standardized any differently from what was initially implemented in LLVM)<span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">No, the goal was to leave the existing behavior as is. The difference is that the standardized version uses the segmented string
 offsets table (with contributions from each unit), whereas the current implementation uses a monolithic string offsets table for the entire file. I had to adapt the implementation a bit to deal with this (let me know if you want the details) but the behavior
 is unchanged.</span><br>
<br>
If so, it may need to be conditionalized on the requested dwarf version (ie: emit the current in-tree format under DWARF4, the new format when the user asks for DWARF5)?<span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Yes, that’s what’s happening.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-- wolfgang<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
- Dave<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal">On Thu, Apr 27, 2017 at 3:01 PM Wolfgang Pieb via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-bottom:12.0pt">wolfgangp created this revision.<br>
<br>
This is a proposed implementation of the DWARF v5 string offsets table for both producer and consumer side. This includes handling of the DW_AT_str_offsets_base attribute in the unit headers and the usage of DW_FORM_strx for string references.<br>
<br>
I'd like to leave the emission of DW_FORM_strx{1,2,3,4} for a follow-on patch. Also, apologies for not handling Mach-O. I'm not familiar with it just yet, though I would like to handle it in another follow-on unless someone else wants to.<br>
<br>
This could be easily broken into 2 patches (1 producer, 1 consumer) it that's more manageable.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D32618" target="_blank">https://reviews.llvm.org/D32618</a><br>
<br>
Files:<br>
  include/llvm/CodeGen/DIE.h<br>
  include/llvm/CodeGen/DIEValue.def<br>
  include/llvm/CodeGen/DwarfStringPoolEntry.h<br>
  include/llvm/DebugInfo/DIContext.h<br>
  include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h<br>
  include/llvm/DebugInfo/DWARF/DWARFContext.h<br>
  include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h<br>
  include/llvm/DebugInfo/DWARF/DWARFUnit.h<br>
  include/llvm/MC/MCObjectFileInfo.h<br>
  lib/CodeGen/AsmPrinter/DIE.cpp<br>
  lib/CodeGen/AsmPrinter/DIEHash.cpp<br>
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br>
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.h<br>
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
  lib/CodeGen/AsmPrinter/DwarfDebug.h<br>
  lib/CodeGen/AsmPrinter/DwarfFile.cpp<br>
  lib/CodeGen/AsmPrinter/DwarfUnit.cpp<br>
  lib/CodeGen/AsmPrinter/DwarfUnit.h<br>
  lib/DebugInfo/DWARF/DWARFContext.cpp<br>
  lib/DebugInfo/DWARF/DWARFFormValue.cpp<br>
  lib/DebugInfo/DWARF/DWARFTypeUnit.cpp<br>
  lib/DebugInfo/DWARF/DWARFUnit.cpp<br>
  lib/MC/MCObjectFileInfo.cpp<br>
  test/DebugInfo/Generic/string-offsets-multiple-cus.ll<br>
  test/DebugInfo/Generic/string-offsets-table.ll<br>
  test/DebugInfo/Inputs/dwarfdump-str-offsets.elf-x86-64<br>
  test/DebugInfo/Inputs/dwarfdump-str-offsets.s<br>
  test/DebugInfo/dwarfdump-str-offsets.test<br>
  tools/llvm-dwarfdump/llvm-dwarfdump.cpp<br>
  tools/obj2yaml/dwarf2yaml.cpp<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>