summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARFContext.h
Commit message (Collapse)AuthorAge
* Simplify compression API by decompressing into a SmallVector rather than a ↵David Blaikie2014-04-05
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205676 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Support debug_loc under fissionDavid Blaikie2014-03-25
| | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204697 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] DWARF parser: use SmallVector<std::unique_ptr> for parsed units in ↵Alexey Samsonov2014-03-13
| | | | | | DWARFContext, and delete custom destructors git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203770 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Convert DWARF parser to range-based for loopsAlexey Samsonov2014-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203766 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-06
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203083 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-05
| | | | | | class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202946 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-dwarfdump: Support for debug_line.dwo section for file names for type ↵David Blaikie2014-02-24
| | | | | | units under fission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202091 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-dwarfdump: type unit dwo supportDavid Blaikie2014-01-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198850 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-07
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198685 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Move type units into the debug_types section with appropriate ↵David Blaikie2013-12-13
| | | | | | | | | | | | | | | | | | | | | | | | 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/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197275 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "DebugInfo: Move type units into the debug_types section with ↵David Blaikie2013-12-13
| | | | | | | | appropriate comdat grouping and type unit headers" This reverts commit r197210. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197211 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Move type units into the debug_types section with appropriate ↵David Blaikie2013-12-13
| | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197210 91177308-0d34-0410-b5e6-96231b3b80d8
* Dump the normal dwarf pubtypes section as well.Eric Christopher2013-09-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191408 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-dwarfdump support for gnu_pubtypesDavid Blaikie2013-09-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191329 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-dwarfdump/libDebugInfo support for type unitsDavid Blaikie2013-09-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191234 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Wrap section data and relocs together for dwarf dumping supportDavid Blaikie2013-09-23
| | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191209 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: llvm-dwarfdump support for gnu_pubnames sectionDavid Blaikie2013-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191050 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DWARFCompileUnit non-copyableAlexey Samsonov2013-08-23
| | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189089 91177308-0d34-0410-b5e6-96231b3b80d8
* Add LLVM-style RTTI to DIContext/DWARFContext classesAlexey Samsonov2013-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187790 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow 4 as a valid debug info version.Eric Christopher2013-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187763 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-dwarfdump: Add support for dumping the .debug_loc sectionDavid Blaikie2013-06-19
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184361 91177308-0d34-0410-b5e6-96231b3b80d8
* Use zlib to uncompress debug sections in DWARF parser.Alexey Samsonov2013-04-23
| | | | | | | | This makes llvm-dwarfdump and llvm-symbolizer understand debug info sections compressed by ld.gold linker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180088 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the pubnames section to llvm-dwarfdump.Krzysztof Parzyszek2013-02-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174976 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for DWARF CFI parsing and dumping in LLVMEli Bendersky2013-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174463 91177308-0d34-0410-b5e6-96231b3b80d8
* Add DIContext::getLineInfoForAddressRange() function and test. This ↵Andrew Kaylor2013-01-26
| | | | | | function allows a caller to obtain a table of line information for a function using the function's address and size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173537 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for applying in-memory relocations to the .debug_line section ↵Andrew Kaylor2013-01-25
| | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173517 91177308-0d34-0410-b5e6-96231b3b80d8
* Add command-line flags for DWARF dumping.Eli Bendersky2013-01-25
| | | | | | | | | Flags for dumping specific DWARF sections added in lib/DebugInfo and llvm-dwarfdump. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173480 91177308-0d34-0410-b5e6-96231b3b80d8
* Split address information for DWARF5 split dwarf proposal. This involvesEric Christopher2013-01-15
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172578 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace and 80-col.Eric Christopher2013-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171804 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for separating strings for the split debug info DWARF5Eric Christopher2013-01-07
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171779 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the dumping infrastructure to deal with additionalEric Christopher2013-01-02
| | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171428 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort includes for all of the .h files under the 'lib' tree. These wereChandler Carruth2012-12-04
| | | | | | | | | | 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. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169224 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite DIContext interface to take an object. Update all callers.Eric Christopher2012-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167757 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixup for r167558: Store raw pointer (instead of reference) to RelocMap in ↵Alexey Samsonov2012-11-12
| | | | | | DIContext. This is needed to prevent crashes because of dangling reference if the clients don't provide RelocMap to DIContext constructor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167728 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a relocation visitor to lib object. This works via caching relocatedEric Christopher2012-11-07
| | | | | | | values in a map that can be passed to consumers. Add a testcase that ensures this works for llvm-dwarfdump. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167558 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark unimplemented copy constructors and copy assignment operators as ↵Craig Topper2012-09-18
| | | | | | LLVM_DELETED_FUNCTION. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164090 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for fetching inlining context (stack of source code locations)Alexey Samsonov2012-09-04
| | | | | | | | | | | | by instruction address from DWARF. Add --inlining flag to llvm-dwarfdump to demonstrate and test this functionality, so that "llvm-dwarfdump --inlining --address=0x..." now works much like "addr2line -i 0x...", provided that the binary has debug info (Clang's -gline-tables-only *is* enough). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163128 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor fetching file/line info from DWARFContext to simplify theAlexey Samsonov2012-08-30
| | | | | | | | | code and allow better code reuse. Make the code a bit more conforming to LLVM code style. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162895 91177308-0d34-0410-b5e6-96231b3b80d8
* Add basic support for .debug_ranges section to LLVM's DebugInfo library.Alexey Samsonov2012-08-27
| | | | | | | | | | | | This section (introduced in DWARF-3) is used to define instruction address ranges for functions that are not contiguous and can't be described by low_pc/high_pc attributes (this is the usual case for inlined subroutines). The patch is the first step to support fetching complete inlining info from DWARF. Reviewed by Benjamin Kramer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162657 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch extends the libLLVMDebugInfo which contains a minimalistic DWARF ↵Alexey Samsonov2012-07-02
| | | | | | | | | | parser: 1) DIContext is now able to return function name for a given instruction address (besides file/line info). 2) llvm-dwarfdump accepts flag --functions that prints the function name (if address is specified by --address flag). 3) test case that checks the basic functionality of llvm-dwarfdump added git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159512 91177308-0d34-0410-b5e6-96231b3b80d8
* Unweaken vtables as per ↵David Blaikie2011-12-20
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8
* DWARF: Put all the pieces we have together and provide a single accessor to ↵Benjamin Kramer2011-09-15
| | | | | | DIContext that provides line information when given an address. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139836 91177308-0d34-0410-b5e6-96231b3b80d8
* DWARF: Remove accessors that parse the whole line table section in one go, ↵Benjamin Kramer2011-09-15
| | | | | | | | this can't possibly work. The address size is specified by the compile unit associated with a line table, there is no global address size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139835 91177308-0d34-0410-b5e6-96231b3b80d8
* DWARF: Add basic support for line tables.Benjamin Kramer2011-09-15
| | | | | | The llvm-dwarfdump output isn't very verbose yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139771 91177308-0d34-0410-b5e6-96231b3b80d8
* DWARF: Port support for parsing .debug_aranges section from LLDB and wire it ↵Benjamin Kramer2011-09-14
| | | | | | | | | up to llvm-dwarfdump. This is only one half of it, the part that caches address ranges from the DIEs when .debug_aranges is not available will be ported soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139680 91177308-0d34-0410-b5e6-96231b3b80d8
* Sketch out a DWARF parser.Benjamin Kramer2011-09-13
This introduces a new library to LLVM: libDebugInfo. It will provide debug information parsing to LLVM. Much of the design and some of the code is taken from the LLDB project. It also contains an llvm-dwarfdump tool that can dump the abbrevs and DIEs from an object file. It can be used to write tests for DWARF input and output easily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139627 91177308-0d34-0410-b5e6-96231b3b80d8