summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFContext.h
Commit message (Collapse)AuthorAgeFilesLines
* [DebugInfo] Move all DWARF headers to the public include directory.Frederic Riss2014-12-191-292/+0
| | | | | | | | | | 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
* [dwarfdump] Handle relocations in Dwarf accelerator tablesFrederic Riss2014-11-141-12/+12
| | | | | | | | | | | ELF targets (and maybe COFF) use relocations when referring to strings in the .debug_str section. Handle that in the accelerator table dumper. This commit restores the test/DebugInfo/cross-cu-inlining.ll test to its expected platform independant form, validating that the fix works (this test failed on linux boxes). llvm-svn: 222029
* Reapply "[dwarfdump] Add support for dumping accelerator tables."Frederic Riss2014-11-141-0/+12
| | | | | | | | | | | | | This reverts commit r221842 which was a revert of r221836 and of the test parts of r221837. This new version fixes an UB bug pointed out by David (along with addressing some other review comments), makes some dumping more resilient to broken input data and forces the accelerator tables to be dumped in the tests where we use them (this decision is platform specific otherwise). llvm-svn: 222003
* Revert "[dwarfdump] Add support for dumping accelerator tables."Frederic Riss2014-11-131-12/+0
| | | | | | | | | | This reverts commit r221836. The tests are asserting on some buildbots. This also reverts the test part of r221837 as it relies on dwarfdump dumping the accelerator tables. llvm-svn: 221842
* [dwarfdump] Add support for dumping accelerator tables.Frederic Riss2014-11-121-0/+12
| | | | | | | The class used for the dump only allows to dump for the moment, but it can (and will) be easily extended to support search also. llvm-svn: 221836
* Constify input argument of RelocVisitor and DWARFContext constructors. NFC.Alexey Samsonov2014-10-201-1/+1
| | | | llvm-svn: 220228
* [DebugInfo] Turn DWARFContext::Section into DWARFSection (NFC).Alexey Samsonov2014-10-071-25/+21
| | | | | | | | It would be more convenient to pass DWARFSection into DWARFUnitSection constructor, instead of passing its components (Data and RelocAddrMap) as a separate arguments. llvm-svn: 219252
* Store TypeUnits in a SmallVector<DWARFUnitSection> instead of a single ↵Frederic Riss2014-09-291-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | DWARFUnitSection. There will be multiple TypeUnits in an unlinked object that will be extracted from different sections. Now that we have DWARFUnitSection that is supposed to represent an input section, we need a DWARFUnitSection<TypeUnit> per input .debug_types section. Once this is done, the interface is homogenous and we can move the Section parsing code into DWARFUnitSection. This is a respin of r218513 that got reverted because it broke some builders. This new version features an explicit move constructor for the DWARFUnitSection class to workaround compilers unable to generate correct C++11 default constructors. Reviewers: samsonov, dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5482 llvm-svn: 218606
* Revert "Store TypeUnits in a SmallVector<DWARFUnitSection> instead of a ↵Frederic Riss2014-09-261-7/+6
| | | | | | | | | | | single DWARFUnitSection." This reverts commit r218513. Buildbots using libstdc++ issue an error when trying to copy SmallVector<std::unique_ptr<>>. Revert the commit until we have a fix. llvm-svn: 218514
* Store TypeUnits in a SmallVector<DWARFUnitSection> instead of a single ↵Frederic Riss2014-09-261-6/+7
| | | | | | | | | | | | | | | | | | | | | DWARFUnitSection. Summary: There will be multiple TypeUnits in an unlinked object that will be extracted from different sections. Now that we have DWARFUnitSection that is supposed to represent an input section, we need a DWARFUnitSection<TypeUnit> per input .debug_types section. Once this is done, the interface is homogenous and we can move the Section parsing code into DWARFUnitSection. Reviewers: samsonov, dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5482 llvm-svn: 218513
* Introduce the DWARFUnitSection abstraction.Frederic Riss2014-09-151-8/+6
| | | | | | | | | | | | | | | | | | 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
* Rename DWARFContext::getLineTableForCompileUnit to getLineTableForUnit.Frederic Riss2014-09-041-2/+1
| | | | | | | All DWARFUnits can have line information. Rename and change arguments' type accordingly. llvm-svn: 217130
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-2/+2
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* Use a reference instead of a pointer.Rafael Espindola2014-07-311-1/+1
| | | | | | This makes using a std::unique_ptr in the caller more convenient. llvm-svn: 214433
* Simplify compression API by decompressing into a SmallVector rather than a ↵David Blaikie2014-04-051-1/+1
| | | | | | | | | | | | MemoryBuffer This avoids an extra copy during decompression and avoids the use of MemoryBuffer which is a weirdly esoteric device that includes unrelated concepts like "file name" (its rather generic name is a bit misleading). Similar refactoring of zlib::compress coming up. llvm-svn: 205676
* DebugInfo: Support debug_loc under fissionDavid Blaikie2014-03-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | Implement debug_loc.dwo, as well as llvm-dwarfdump support for dumping this section. Outlined in the DWARF5 spec and http://gcc.gnu.org/wiki/DebugFission the debug_loc.dwo section has more variation than the standard debug_loc, allowing 3 different forms of entry (plus the end of list entry). GCC seems to, and Clang certainly, only use one form, so I've just implemented dumping support for that for now. It wasn't immediately obvious that there was a good refactoring to share the implementation of dumping support between debug_loc and debug_loc.dwo, so they're separate for now - ideas welcome or I may come back to it at some point. As per a comment in the code, we could choose different forms that may reduce the number of debug_addr entries we emit, but that will require further study. llvm-svn: 204697
* [C++11] DWARF parser: use SmallVector<std::unique_ptr> for parsed units in ↵Alexey Samsonov2014-03-131-7/+5
| | | | | | DWARFContext, and delete custom destructors llvm-svn: 203770
* [C++11] Convert DWARF parser to range-based for loopsAlexey Samsonov2014-03-131-36/+48
| | | | llvm-svn: 203766
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-7/+6
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-051-30/+30
| | | | | | class. llvm-svn: 202946
* llvm-dwarfdump: Support for debug_line.dwo section for file names for type ↵David Blaikie2014-02-241-0/+3
| | | | | | units under fission. llvm-svn: 202091
* llvm-dwarfdump: type unit dwo supportDavid Blaikie2014-01-091-0/+24
| | | | llvm-svn: 198850
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-1/+1
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* DebugInfo: Move type units into the debug_types section with appropriate ↵David Blaikie2013-12-131-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | comdat grouping and type unit headers This commit does not complete the type units feature - there are issues around fission support (skeletal type units, pubtypes/pubnames) and hashing of some types including those containing references to types in other type units. Originally committed as r197073 and reverted in r197079. Recommitted as r197197 to reproduce the failure and reverted as r197199 Turns out there was unstable ordering in the type unit dumping code. Fixed by using MapVector in DWARFContext to store the debug_types comdat sections. Recommitted as r197210 with a fix to dumping and reverted as r197211 because I was a bit gun shy and thought I saw a failure that turned out to be unrelated. So here we go - once more with feeling! \o/ llvm-svn: 197275
* Revert "DebugInfo: Move type units into the debug_types section with ↵David Blaikie2013-12-131-6/+5
| | | | | | | | appropriate comdat grouping and type unit headers" This reverts commit r197210. llvm-svn: 197211
* DebugInfo: Move type units into the debug_types section with appropriate ↵David Blaikie2013-12-131-5/+6
| | | | | | | | | | | | | | | | | | comdat grouping and type unit headers This commit does not complete the type units feature - there are issues around fission support (skeletal type units, pubtypes/pubnames) and hashing of some types including those containing references to types in other type units. Originally committed as r197073 and reverted in r197079. Recommitted as r197197 to reproduce the failure and reverted as r197199 Turns out there was unstable ordering in the type unit dumping code. Fixed by using MapVector in DWARFContext to store the debug_types comdat sections. llvm-svn: 197210
* Dump the normal dwarf pubtypes section as well.Eric Christopher2013-09-251-0/+3
| | | | llvm-svn: 191408
* llvm-dwarfdump support for gnu_pubtypesDavid Blaikie2013-09-241-0/+3
| | | | llvm-svn: 191329
* llvm-dwarfdump/libDebugInfo support for type unitsDavid Blaikie2013-09-231-0/+24
| | | | llvm-svn: 191234
* DebugInfo: Wrap section data and relocs together for dwarf dumping supportDavid Blaikie2013-09-231-26/+17
| | | | | | | | | | | | | | | | | | This is a small step that may enable some simplifications in producer (DWARFContext) and consumer (DWARFCompileUnit and other places) by making a more complete abstraction around the data and relocations for a section. Small initial steps could include simple changes such as passing the pair to DWARFCompileUnit's ctor rather than passing the data and relocs separately. I don't intend to pursue any such changes immediately, however. The motivation for doing this now is that type unit dumping will need to deal with these data+reloc pairs moreso than the existing dumping support has needed to associate the data as type unit sections are named the same (debug_types) and comdat group folded. So to implement dumping and reloc handling we'll need a mapping of section->data+relocs. llvm-svn: 191209
* DebugInfo: llvm-dwarfdump support for gnu_pubnames sectionDavid Blaikie2013-09-191-0/+3
| | | | llvm-svn: 191050
* Make DWARFCompileUnit non-copyableAlexey Samsonov2013-08-231-4/+5
| | | | | | | | | | | | | | | | | Summary: This is a part of D1164. DWARFCompileUnit is not that lightweight to copy it around, and we want it to own corresponding .dwo compile unit eventually. Reviewers: echristo Reviewed By: echristo CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1298 llvm-svn: 189089
* Add LLVM-style RTTI to DIContext/DWARFContext classesAlexey Samsonov2013-08-061-1/+6
| | | | llvm-svn: 187790
* Allow 4 as a valid debug info version.Eric Christopher2013-08-061-1/+1
| | | | llvm-svn: 187763
* llvm-dwarfdump: Add support for dumping the .debug_loc sectionDavid Blaikie2013-06-191-0/+11
| | | | | | | | | This is a basic implementation - we still don't have any support (that I know of) for dumping DWARF expressions in a meaningful way, so the location information itself is just printed as a sequence of bytes as we do elsewhere. llvm-svn: 184361
* Use zlib to uncompress debug sections in DWARF parser.Alexey Samsonov2013-04-231-0/+3
| | | | | | | This makes llvm-dwarfdump and llvm-symbolizer understand debug info sections compressed by ld.gold linker. llvm-svn: 180088
* Add support for the pubnames section to llvm-dwarfdump.Krzysztof Parzyszek2013-02-121-0/+3
| | | | llvm-svn: 174976
* Initial support for DWARF CFI parsing and dumping in LLVMEli Bendersky2013-02-051-0/+11
| | | | llvm-svn: 174463
* Add DIContext::getLineInfoForAddressRange() function and test. This ↵Andrew Kaylor2013-01-261-0/+2
| | | | | | function allows a caller to obtain a table of line information for a function using the function's address and size. llvm-svn: 173537
* Add support for applying in-memory relocations to the .debug_line section ↵Andrew Kaylor2013-01-251-0/+3
| | | | | | and, in the case of ELF files, using symbol addresses when available for relocations to the .debug_info section. Also extending the llvm-rtdyld tool to add the ability to dump line number information for testing purposes. llvm-svn: 173517
* Add command-line flags for DWARF dumping.Eli Bendersky2013-01-251-1/+1
| | | | | | | Flags for dumping specific DWARF sections added in lib/DebugInfo and llvm-dwarfdump. llvm-svn: 173480
* Split address information for DWARF5 split dwarf proposal. This involvesEric Christopher2013-01-151-0/+5
| | | | | | | | | | | | | | | using the DW_FORM_GNU_addr_index and a separate .debug_addr section which stays in the executable and is fully linked. Sneak in two other small changes: a) Print out the debug_str_offsets.dwo section. b) Change form we're expecting the entries in the debug_str_offsets.dwo section to take from ULEB128 to U32. Add tests for all of this in the fission-cu.ll test. llvm-svn: 172578
* Whitespace and 80-col.Eric Christopher2013-01-071-1/+3
| | | | llvm-svn: 171804
* Add support for separating strings for the split debug info DWARF5Eric Christopher2013-01-071-0/+5
| | | | | | | | | | | | | proposal. This leaves the strings in the skeleton die as strp, but in all dwo files they're accessed now via DW_FORM_GNU_str_index. Add support for dumping these sections and modify the fission-cu.ll testcase to have the correct strings and form. Fix a small bug in the fixed form sizes routine that involved out of array accesses for the table and add a FIXME in the extractFast routine to fix this up. llvm-svn: 171779
* Extend the dumping infrastructure to deal with additionalEric Christopher2013-01-021-3/+50
| | | | | | | | | | | | sections for debug info. These are some of the dwo sections from the DWARF5 split debug info proposal. Update the fission-cu.ll testcase to show what we should be able to dump more of now. Work in progress: Ultimately the relocations will be gone for the dwo section and the strings will be a different form (as well as the rest of the sections will be included). llvm-svn: 171428
* Sort includes for all of the .h files under the 'lib' tree. These wereChandler Carruth2012-12-041-1/+1
| | | | | | | | | | missed in the first pass because the script didn't yet handle include guards. Note that the script is now able to handle all of these headers without manual edits. =] llvm-svn: 169224
* Rewrite DIContext interface to take an object. Update all callers.Eric Christopher2012-11-121-26/+9
| | | | llvm-svn: 167757
* Fixup for r167558: Store raw pointer (instead of reference) to RelocMap in ↵Alexey Samsonov2012-11-121-4/+4
| | | | | | DIContext. This is needed to prevent crashes because of dangling reference if the clients don't provide RelocMap to DIContext constructor. llvm-svn: 167728
* Add a relocation visitor to lib object. This works via caching relocatedEric Christopher2012-11-071-3/+8
| | | | | | | values in a map that can be passed to consumers. Add a testcase that ensures this works for llvm-dwarfdump. llvm-svn: 167558
* Mark unimplemented copy constructors and copy assignment operators as ↵Craig Topper2012-09-181-2/+2
| | | | | | LLVM_DELETED_FUNCTION. llvm-svn: 164090
OpenPOWER on IntegriCloud