aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/DWARFUnit.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-12-19[DebugInfo] Move all DWARF headers to the public include directory.Frederic Riss1-2/+2
dsymutil needs access to DWARF specific inforamtion, the small DIContext wrapper isn't sufficient. Other DWARF consumers might want to use it too (I'm looking at you lldb). Differential Revision: http://reviews.llvm.org/D6694 llvm-svn: 224594
2014-10-08[DebugInfo] Pass DWARFSection down to DWARFUnit constructor (NFC).Alexey Samsonov1-7/+7
Keep the actual section contents and the relocation map together. llvm-svn: 219261
2014-10-08[DebugInfo] Pass DWARFSection into DWARFUnitSection constructor (NFC).Alexey Samsonov1-9/+7
llvm-svn: 219259
2014-10-06Factor the Unit section parsing into the DWARFUnitSection class.Frederic Riss1-0/+15
Summary: No functional change. Reviewers: dblaikie, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5522 llvm-svn: 219098
2014-09-15Introduce the DWARFUnitSection abstraction.Frederic Riss1-2/+3
A DWARFUnitSection is the collection of Units that have been extracted from the same debug section. By embeding a reference to their DWARFUnitSection in each unit, the DIEs will be able to resolve inter-unit references by interrogating their Unit's DWARFUnitSection. This is a minimal patch where the DWARFUnitSection is-a SmallVector of Units, thus exposing exactly the same interface as before. Followup-up patches might change from inheritance to composition in order to expose only the wanted DWARFUnitSection abstraction. Differential Revision: http://reviews.llvm.org/D5310 llvm-svn: 217747
2014-09-05[DWARF parser] Fix nasty memory corruption in .dwo files handling.Alexey Samsonov1-11/+9
Forge a test case where llvm-symbolizer has to use external .dwo file to produce the inlining information. llvm-svn: 217270
2014-09-04Add a DWARFContext& member in DWARFUnit.Frederic Riss1-6/+6
The DWARFContext will be used to pass global 'context' down, like pointers to related debug info sections or command line options. The first use will be for the debug_info dumper to be able to access other debug info section to dump eg. Location Expression inline in the debug_info dump. llvm-svn: 217128
2014-08-19Don't own the buffer in object::Binary.Rafael Espindola1-2/+2
Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a bad fit for IRObjectFile where the Module wants to own the buffer too. Keeping this ownership would make supporting IR inside native objects particularly painful. This patch focuses in lib/Object. If something elsewhere used to own an Binary, now it also owns a MemoryBuffer. This patch introduces a few new types. * MemoryBufferRef. This is just a pair of StringRefs for the data and name. This is to MemoryBuffer as StringRef is to std::string. * OwningBinary. A combination of Binary and a MemoryBuffer. This is needed for convenience functions that take a filename and return both the buffer and the Binary using that buffer. The C api now uses OwningBinary to avoid any change in semantics. I will start a new thread to see if we want to change it and how. llvm-svn: 216002
2014-07-31DWOHolder takes ownership of the argument constructor, use std::unique_ptr.Rafael Espindola1-4/+5
Thanks to David Blaikie for noticing it. llvm-svn: 214434
2014-07-31Use a reference instead of a pointer.Rafael Espindola1-1/+1
This makes using a std::unique_ptr in the caller more convenient. llvm-svn: 214433
2014-07-31Use std::unique_ptr to make the ownership explicit.Rafael Espindola1-2/+2
llvm-svn: 214377
2014-06-13[DWARF parser] Use distinction between DW_AT_ranges_base and ↵Alexey Samsonov1-8/+5
DW_AT_GNU_ranges_base instead of DWARF version llvm-svn: 210945
2014-06-12[llvm-symbolizer] Fix parsing DW_AT_ranges in Fission skeleton compile unit ↵Alexey Samsonov1-3/+9
DIEs. Turns out that DW_AT_ranges_base attribute sets the offset for DW_AT_ranges values specified in the .dwo file, but not for DW_AT_ranges specified in the skeleton compile unit DIE in the main executable. This is extremely confusing, and would hopefully be fixed in DWARF-5 when it's finalized. For now this behavior makes sense, as otherwise Fission would break DWARF consumers who doesn't know anything about DW_AT_ranges_base. llvm-svn: 210809
2014-04-29[DWARF parser] Compress DIEMinimal even further, simplify building DIE tree.Alexey Samsonov1-31/+24
DIE doesn't need to store a pointer to its parent: we can traverse the DIE tree only with functions getFirstChild() and getSibling(). Parents must be known only when we construct the tree. Rewrite setDIERelations() procedure in a more straightforward way, and get rid of lots of now unused DIEMinimal methods. No functionality change. llvm-svn: 207563
2014-04-24[DWARF parser] Make a few methods non-publicAlexey Samsonov1-4/+4
llvm-svn: 207156
2014-04-24[DWARF parser] DWARFUnit ctor doesn't need both parsed and raw .debug_abbrev ↵Alexey Samsonov1-12/+14
section. Remove the former. llvm-svn: 207153
2014-04-18[DWARF parser] Respect address ranges specified in compile unit DIE.Alexey Samsonov1-0/+7
When address ranges for compile unit are specified in compile unit DIE itself, there is no need to collect ranges from children subprogram DIEs. This change speeds up llvm-symbolizer on Clang-produced binaries with full debug info. For instance, symbolizing a first address in a 1Gb binary is now 2x faster (1s vs. 2s). llvm-svn: 206641
2014-04-18[DWARF parser] Refactor fetching DIE address ranges.Alexey Samsonov1-16/+9
Add a helper method to get address ranges specified in a DIE (either by DW_AT_low_pc/DW_AT_high_pc, or by DW_AT_ranges). Use it to untangle and simplify the code. No functionality change. llvm-svn: 206624
2014-04-15[C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper1-12/+12
instead of comparing to nullptr. llvm-svn: 206252
2014-03-13[C++11] Convert DWARF parser to range-based for loopsAlexey Samsonov1-4/+5
llvm-svn: 203766
2014-01-22Change createObjectFile to return an ErrorOr.Rafael Espindola1-2/+2
llvm-svn: 199776
2013-10-31DWARFUnit: kill dead code and make a couple of functions private. No ↵Alexey Samsonov1-24/+0
functionality change. llvm-svn: 193780
2013-10-28DWARF parser: Use ArrayRef to represent form sizes and simplify ↵Alexey Samsonov1-4/+1
DWARFDIE::extractFast() interface. No functionality change. llvm-svn: 193560
2013-10-28DebugInfo: Introduce the notion of "form classes"Alexey Samsonov1-8/+8
Summary: Use DWARF4 table of form classes to fetch attributes from DIE in a more consistent way. This shouldn't change the functionality and serves as a refactoring for upcoming change: DW_AT_high_pc has different semantics depending on its form class. Reviewers: dblaikie, echristo Reviewed By: echristo CC: echristo, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1961 llvm-svn: 193553
2013-09-23Unbreak the build (from r191233)since we're calling printf.David Blaikie1-0/+1
llvm-svn: 191238
2013-09-23Exract most of DWARFCompileUnit into a new DWARFUnit to prepare for the ↵David Blaikie1-0/+391
coming DWARFTypeUnit. llvm-svn: 191233