[PATCH] D32618: DWARF: Implementation of v5 string offsets table (.debug_str_offsets[.dwo] section)

Pieb, Wolfgang via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 16:28:41 PDT 2017



From: David Blaikie [mailto:dblaikie at gmail.com]
Sent: Thursday, April 27, 2017 4:11 PM
To: reviews+D32618+public+c75911a8bdafd5f2 at reviews.llvm.org; Pieb, Wolfgang; aprantl at apple.com; echristo at gmail.com; dexonsmith at apple.com; Robinson, Paul
Cc: llvm-commits at lists.llvm.org
Subject: Re: [PATCH] D32618: DWARF: Implementation of v5 string offsets table (.debug_str_offsets[.dwo] section)

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.

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)
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.

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)?
Yes, that’s what’s happening.

-- wolfgang


- Dave
On Thu, Apr 27, 2017 at 3:01 PM Wolfgang Pieb via Phabricator <reviews at reviews.llvm.org<mailto:reviews at reviews.llvm.org>> wrote:
wolfgangp created this revision.

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.

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.

This could be easily broken into 2 patches (1 producer, 1 consumer) it that's more manageable.


https://reviews.llvm.org/D32618

Files:
  include/llvm/CodeGen/DIE.h
  include/llvm/CodeGen/DIEValue.def
  include/llvm/CodeGen/DwarfStringPoolEntry.h
  include/llvm/DebugInfo/DIContext.h
  include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h
  include/llvm/DebugInfo/DWARF/DWARFContext.h
  include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h
  include/llvm/DebugInfo/DWARF/DWARFUnit.h
  include/llvm/MC/MCObjectFileInfo.h
  lib/CodeGen/AsmPrinter/DIE.cpp
  lib/CodeGen/AsmPrinter/DIEHash.cpp
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  lib/CodeGen/AsmPrinter/DwarfDebug.h
  lib/CodeGen/AsmPrinter/DwarfFile.cpp
  lib/CodeGen/AsmPrinter/DwarfUnit.cpp
  lib/CodeGen/AsmPrinter/DwarfUnit.h
  lib/DebugInfo/DWARF/DWARFContext.cpp
  lib/DebugInfo/DWARF/DWARFFormValue.cpp
  lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
  lib/DebugInfo/DWARF/DWARFUnit.cpp
  lib/MC/MCObjectFileInfo.cpp
  test/DebugInfo/Generic/string-offsets-multiple-cus.ll
  test/DebugInfo/Generic/string-offsets-table.ll
  test/DebugInfo/Inputs/dwarfdump-str-offsets.elf-x86-64
  test/DebugInfo/Inputs/dwarfdump-str-offsets.s
  test/DebugInfo/dwarfdump-str-offsets.test
  tools/llvm-dwarfdump/llvm-dwarfdump.cpp
  tools/obj2yaml/dwarf2yaml.cpp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170427/183ea719/attachment.html>


More information about the llvm-commits mailing list