summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARFContext.cpp
Commit message (Collapse)AuthorAge
* Remove 'using std::errro_code' from lib.Rafael Espindola2014-06-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210871 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-12
| | | | | | This should make sure that most new uses use the std prefix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210835 91177308-0d34-0410-b5e6-96231b3b80d8
* [DWARF parser] Use enums instead of bitfields in DILineInfoSpecifier.Alexey Samsonov2014-05-15
| | | | | | | | | | | | | It is more appropriate than the current situation, when one flag (AbsoluteFilePath) is relevant only if another flag is set. This refactoring would also simplify fetching the short function name (stored in DW_AT_name) instead of a linkage name returned currently. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208921 91177308-0d34-0410-b5e6-96231b3b80d8
* [DWARF parser] Cleanup code in DWARFDebugLine.Alexey Samsonov2014-04-30
| | | | | | | | | | | | | | | | | | | Streamline parsing and dumping line tables: Prefer composition to multiple inheritance in DWARFDebugLine::ParsingState. Get rid of the weird concept of "DumpingState" structure. was: DWARFDebugLine::DumpingState state(OS); DWARFDebugLine::parseStatementTable(..., state); now: DWARFDebugLine::LineTable LineTable; LineTable.parse(...); LineTable.dump(OS); No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207599 91177308-0d34-0410-b5e6-96231b3b80d8
* [DWARF parser] Cleanup code in DWARFDebugLine.Alexey Samsonov2014-04-29
| | | | | | | | | | | | | | Move several function definitions into .cpp, unify constructors and clear() methods (fixing a couple of latent bugs from copy-paste), turn static function parsePrologue() into Prologue::parse(). More work needed here to untangle weird multiple inheritance in table parsing and dumping. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207579 91177308-0d34-0410-b5e6-96231b3b80d8
* [DWARF parser] Cleanup code in DWARFDebugAranges.Alexey Samsonov2014-04-25
| | | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207276 91177308-0d34-0410-b5e6-96231b3b80d8
* [DWARF parser] Cleanup code in DWARFDebugAbbrev.Alexey Samsonov2014-04-25
| | | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207274 91177308-0d34-0410-b5e6-96231b3b80d8
* [DWARF parser] DWARFUnit ctor doesn't need both parsed and raw .debug_abbrev ↵Alexey Samsonov2014-04-24
| | | | | | section. Remove the former. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207153 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Make Support/Debug.h modular. This requires it to not changeChandler Carruth2014-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | behavior based on other files defining DEBUG_TYPE, which means it cannot define DEBUG_TYPE at all. This is actually better IMO as it forces folks to define relevant DEBUG_TYPEs for their files. However, it requires all files that currently use DEBUG(...) to define a DEBUG_TYPE if they don't already. I've updated all such files in LLVM and will do the same for other upstream projects. This still leaves one important change in how LLVM uses the DEBUG_TYPE macro going forward: we need to only define the macro *after* header files have been #include-ed. Previously, this wasn't possible because Debug.h required the macro to be pre-defined. This commit removes that. By defining DEBUG_TYPE after the includes two things are fixed: - Header files that need to provide a DEBUG_TYPE for some inline code can do so by defining the macro before their inline code and undef-ing it afterward so the macro does not escape. - We no longer have rampant ODR violations due to including headers with different DEBUG_TYPE definitions. This may be mostly an academic violation today, but with modules these types of violations are easy to check for and potentially very relevant. Where necessary to suppor headers with DEBUG_TYPE, I have moved the definitions below the includes in this commit. I plan to move the rest of the DEBUG_TYPE macros in LLVM in subsequent commits; this one is big enough. The comments in Debug.h, which were hilariously out of date already, have been updated to reflect the recommended practice going forward. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206822 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-symbolizer] Print file/line for a PC even if there is no DIE ↵Alexey Samsonov2014-04-18
| | | | | | | | | | | | describing it. This is important for symbolizing executables with debug info in unavailable .dwo files. Even if all DIE entries are missing, we can still symbolize an address: function name can be fetched from symbol table, and file/line info can be fetched from line table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206665 91177308-0d34-0410-b5e6-96231b3b80d8
* [DWARF parser] Turn DILineInfo into a struct.Alexey Samsonov2014-04-18
| | | | | | | | | | | Immutable DILineInfo doesn't bring any benefits and complicates code. Also, use std::string instead of SmallString<16> for file and function names - their length can vary significantly. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206654 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-15
| | | | | | instead of comparing to nullptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206252 91177308-0d34-0410-b5e6-96231b3b80d8
* 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] Introduce SectionRef::relocations() to use range-based loopsAlexey Samsonov2014-03-14
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3077 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203927 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Introduce ObjectFile::sections().Alexey Samsonov2014-03-13
| | | | | | | | | | | | | | | | | | Summary: This adds ObjectFile::section_iterator_range, that allows to write range-based for-loops running over all sections of a given file. Several files from lib/ are converted to the new interface. Similar fixes should be applied to a variety of llvm-* tools. Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3069 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203799 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] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202957 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
* Change the begin and end methods in ObjectFile to match the style guide.Rafael Espindola2014-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201108 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the handling of iterators in ObjectFile.Rafael Espindola2014-01-30
| | | | | | | | | | | | None of the object file formats reported error on iterator increment. In retrospect, that is not too surprising: no object format stores symbols or sections in a linked list or other structure that requires chasing pointers. As a consequence, all error checking can be done on begin() and end(). This reduces the text segment of bin/llvm-readobj in my machine from 521233 to 518526 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200442 91177308-0d34-0410-b5e6-96231b3b80d8
* DWARFContext: Fix possible memory leak since r198908.NAKAMURA Takumi2014-01-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200000 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
* Simplify/collapse/denest a conditions/blocks.David Blaikie2014-01-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198813 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-dwarfdump: reorder dwo sections to immediately proceed their non-dwo ↵David Blaikie2014-01-08
| | | | | | | | | equivalents This makes it easier to write a test that's mostly shared between fission and non-fission (using FileCheck's multiple prefix support). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198806 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
* DebugInfo: Avoid emitting pubtype entries for type DIEs that just indirect ↵David Blaikie2013-11-26
| | | | | | to a type unit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195698 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Make pubnames header printing similar to unit header printingDavid Blaikie2013-11-01
| | | | | | | | | | | | | | | In a failed attempt to allow the gnu-public-names.ll test case to not hardcode the size of the unit that the pubnames section referred to I've at least managed to have unit headers and pubnames headers print out in a similar style. This failed to achieve the desired goal because the header in a unit specifies the length of the unit without the length element of the header whereas the length in the pubnames includes this element, so the numbers are off by 4 bytes. I don't know of any arithmetic powers in FileCheck so the test case can't simply say "CU_LENGTH + 4". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193872 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Introduce the notion of "form classes"Alexey Samsonov2013-10-28
| | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193553 91177308-0d34-0410-b5e6-96231b3b80d8
* [DebugInfo] Further simplify DWARFDebugAranges public interfaceAlexey Samsonov2013-10-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191813 91177308-0d34-0410-b5e6-96231b3b80d8
* Deallocate type units when destroying a DWARFContext.Benjamin Kramer2013-09-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191637 91177308-0d34-0410-b5e6-96231b3b80d8
* Rework conditional for printing out pub sections.Eric Christopher2013-09-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191571 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
* Unify pubsection/gnu pubsection printing.Eric Christopher2013-09-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191407 91177308-0d34-0410-b5e6-96231b3b80d8
* Slight formatting change for pubnames/pubtypes output.Eric Christopher2013-09-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191401 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-dwarfdump: add missing opening quotation mark lost in r191330David Blaikie2013-09-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191333 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-dwarfdump: re-add field formatting for the entry kind lost in r191329David Blaikie2013-09-24
| | | | | | CR feedback from Eric Christopher git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191330 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
* Format the index entry kind string to align.Eric Christopher2013-09-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191255 91177308-0d34-0410-b5e6-96231b3b80d8
* Comments for r191234 as suggested by Eric Christopher.David Blaikie2013-09-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191244 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
* Exract most of DWARFCompileUnit into a new DWARFUnit to prepare for the ↵David Blaikie2013-09-23
| | | | | | coming DWARFTypeUnit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191233 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
* StringRef-ize some thingsDavid Blaikie2013-09-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191178 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r191062; the build break was also fixed in a different (incompatible) ↵Richard Smith2013-09-20
| | | | | | way in r191060. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191065 91177308-0d34-0410-b5e6-96231b3b80d8