summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove unsused variables.Frederic Riss2014-11-121-2/+0
| | | | llvm-svn: 221834
* [dwarfdump] Dump DW_AT_ranges values inline in the debug_info dump.Frederic Riss2014-10-231-1/+19
| | | | | | | | | | | The output looks like that: DW_AT_ranges [FORM_data4] (0x00000000 [0x00000001000024a0 - 0x00000001000024c2) [0x0000000100002505 - 0x000000010000268b)) Differential Revision: http://reviews.llvm.org/D5712 llvm-svn: 220466
* Constify input argument of RelocVisitor and DWARFContext constructors. NFC.Alexey Samsonov2014-10-203-3/+3
| | | | llvm-svn: 220228
* Add couple of missing 'override' keyword. NFC.Fariborz Jahanian2014-10-101-1/+1
| | | | llvm-svn: 219516
* [dwarfdump] Prettyprint DW_AT_APPLE_property_attribute bitfield values.Frederic Riss2014-10-101-0/+19
| | | | | | | | | | | | | This change depends on the ApplePropertyString helper that I sent spearately. Not sure how you want this tested: as a tool test by adding a binary to dump, or as an llvm test starting from an IR file? Reviewers: dblaikie, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5689 llvm-svn: 219507
* [dwarfdump] Resolve also variable specifications/abstract_origins.Frederic Riss2014-10-102-11/+20
| | | | | | | | | | | | | | | | | DW_AT_specification and DW_AT_abstract_origin resolving was only performed on subroutine DIEs because it used the getSubroutineName method. Introduce a more generic getName() and use it to dump the reference attributes. Testcases have been updated to check the printed names instead of the offsets except when the name could be ambiguous. Reviewers: dblaikie, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5625 llvm-svn: 219506
* Remove bogus std::error_code returns form SectionRef.Rafael Espindola2014-10-081-6/+3
| | | | | | | | | | | | | | There are two methods in SectionRef that can fail: * getName: The index into the string table can be invalid. * getContents: The section might point to invalid contents. Every other method will always succeed and returning and std::error_code just complicates the code. For example, a section can have an invalid alignment, but if we are able to get to the section structure at all and create a SectionRef, we will always be able to read that invalid alignment. llvm-svn: 219314
* llvm-dwarfdump: Add support for some COFF relocationsDavid Majnemer2014-10-081-6/+3
| | | | | | | DWARF in COFF utilizes several relocations. Implement support for them in RelocVisitor to support llvm-dwarfdump. llvm-svn: 219280
* [DebugInfo] Pass DWARFSection down to DWARFUnit constructor (NFC).Alexey Samsonov2014-10-084-25/+25
| | | | | | Keep the actual section contents and the relocation map together. llvm-svn: 219261
* [DebugInfo] Pass DWARFSection into DWARFUnitSection constructor (NFC).Alexey Samsonov2014-10-083-27/+25
| | | | llvm-svn: 219259
* [DebugInfo] Turn DWARFContext::Section into DWARFSection (NFC).Alexey Samsonov2014-10-072-25/+45
| | | | | | | | 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
* Refactor RelocVisitor to take an object. This removes someEric Christopher2014-10-061-1/+1
| | | | | | | | | string comparisons and makes it a bit easier to check individual targets. Patch by Charlie Turner. llvm-svn: 219108
* Resolve ambiguity between llvm::make_unique and std::make_unique.Yaron Keren2014-10-061-2/+3
| | | | | | | Intorduced in r219098. llvm-svn: 219105
* [dwarfdump] Print the name for referenced specification of abstract_origin DIEs.Frederic Riss2014-10-061-0/+14
| | | | | | | | | | Reviewers: dblaikie, samsonov, echristo, aprantl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5466 llvm-svn: 219099
* Factor the Unit section parsing into the DWARFUnitSection class.Frederic Riss2014-10-063-62/+50
| | | | | | | | | | | | Summary: No functional change. Reviewers: dblaikie, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5522 llvm-svn: 219098
* Remove unnecessary copying or replace it with moves in a bunch of places.Benjamin Kramer2014-10-042-3/+4
| | | | | | NFC. llvm-svn: 219061
* Store TypeUnits in a SmallVector<DWARFUnitSection> instead of a single ↵Frederic Riss2014-09-293-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Object: BSS/virtual sections don't have contentsDavid Majnemer2014-09-261-0/+9
| | | | | | | | | | | | Users of getSectionContents shouldn't try to pass in BSS or virtual sections. In all instances, this is a bug in the code calling this routine. N.B. Some COFF implementations (like CL) will mark their BSS sections as taking space on disk. This would confuse COFFObjectFile into thinking the section is larger than the file. llvm-svn: 218549
* Revert "Store TypeUnits in a SmallVector<DWARFUnitSection> instead of a ↵Frederic Riss2014-09-262-23/+16
| | | | | | | | | | | 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-262-16/+23
| | | | | | | | | | | | | | | | | | | | | 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
* Revert 218406 - Refactor the RelocVisitor::visit methodRenato Golin2014-09-241-1/+1
| | | | llvm-svn: 218416
* Refactor the RelocVisitor::visit methodRenato Golin2014-09-241-1/+1
| | | | | | | | | | | | | | | | | | This change replaces the brittle if/else chain of string comparisons with a switch statement on the detected target triple, removing the need for testing arbitrary architecture names returned from getFileFormatName, whose primary purpose seems to be for display (user-interface) purposes. The visitor now takes a reference to the object file, rather than its arbitrary file format name to figure out whether the file is a 32 or 64-bit object file and what the detected target triple is. A set of tests have been added to help show that the refactoring processes relocations for the same targets as the original code. Patch by Charlie Turner. llvm-svn: 218406
* Revert "Refactor the RelocVisitor::visit method"Kaelyn Takata2014-09-241-1/+1
| | | | | | | | | This reverts commit faac033f7364bb4226e22c8079c221c96af10d02. The test depends on all targets to be enabled in llc in order to pass, and needs to be rewritten/refactored to not have that dependency. llvm-svn: 218393
* Refactor the RelocVisitor::visit methodRenato Golin2014-09-241-1/+1
| | | | | | | | | | | | | | | | | | This change replaces the brittle if/else chain of string comparisons with a switch statement on the detected target triple, removing the need for testing arbitrary architecture names returned from getFileFormatName, whose primary purpose seems to be for display (user-interface) purposes. The visitor now takes a reference to the object file, rather than its arbitrary file format name to figure out whether the file is a 32 or 64-bit object file and what the detected target triple is. A set of tests have been added to help show that the refactoring processes relocations for the same targets as the original code. Patch by Charlie Turner. llvm-svn: 218388
* [dwarfdump] Dump full filenames as DW_AT_(decl|call)_file attribute valuesFrederic Riss2014-09-222-5/+15
| | | | | | | | | | Reviewers: dblaikie samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5192 llvm-svn: 218246
* Allow DWARFDebugInfoEntryMinimal::getSubroutineName to resolve cross-unit ↵Frederic Riss2014-09-221-4/+16
| | | | | | | | | | | | | | references. Summary: getSubroutineName is currently only used by llvm-symbolizer, thus add a binary test containing a cross-cu inlining example. Reviewers: samsonov, dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5394 llvm-svn: 218245
* Turn local DWARFContext helpers getFileNameForUnit() and ↵Frederic Riss2014-09-193-58/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getFileLineInfoForCompileUnit() into full-blowm DWARFDebugLine::LineTable methods. Summary: getFileNameForUnit() is basically a wrapper around LineTable::getFileNameByIndex(). Fold its additional functionality (adding the DWARFUnit compilation dir) into LineTable::getFileNameByIndex(). getFileLineInfoForCompileUnit() is a wrapper around getFileNameForUnit(). As a function to search the line information by address, it seems natural to put it in the LineTable also. Before this commit only the Context with its private helpers could do Linetable lookups. This newly exposed feature will be used by the DIE dumping code to get access to file information referenced in DIE attributes. This commit has already been partly reviewed in D5192 and contained an additional and a bit controversial 'realpath' call that is left out of this patch. We can reinstate that realpath code later if it is desirable. Test Plan: The patch contains no tests as it should be functionally equivalent to the previous code. As requested in the last review, I checked if the relative path handling copied from the Context to LineTable::getFileNameByIndex() was covered, and indeed the symbolizer tests fail if it is removed. Reviewers: dblaikie, echristo, aprantl, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5354 llvm-svn: 218125
* Fix DWARFUnitSection::getUnitForOffset().Frederic Riss2014-09-181-10/+2
| | | | | | | | | | | | | | | | | | | | | The current code is only able to return the right unit if the passed offset is the exact offset of a section. Generalize the search function by comparing againt the offset of the next unit instead and by switching the search algorithm to upper_bound. This way, the unit returned is the first unit with a getNextUnitOffset() strictly greater than the searched offset, which is exactly what we want. Note that there is no need for testing the range of the resulting unit as the offsets of a DWARFUnitSection are in a single contiguous range from 0 inclusive to lastUnit->getNextUnitOffset() exclusive. Reviewers: dblaikie samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5262 llvm-svn: 218040
* Make DWARFUnitSection final and change base class to non-virtual protected ↵Frederic Riss2014-09-161-3/+4
| | | | | | | | destructor. As per dblaikie suggestion. llvm-svn: 217871
* Fix a non-virtual destructor warning introduced in r217747.Frederic Riss2014-09-151-0/+2
| | | | llvm-svn: 217756
* Fix ambiguous typedef introduced in r217747.Frederic Riss2014-09-151-2/+2
| | | | | | | | Use fully qualified name inside a typedef from llvm::iterator_range<...> to iterator_range. This is reported (rightly I think) by GCC as an ambiguous name redefinition. Hope this fixes the buildbots. llvm-svn: 217751
* Introduce the DWARFUnitSection abstraction.Frederic Riss2014-09-156-44/+69
| | | | | | | | | | | | | | | | | | 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
* [DWARF parser] Fix nasty memory corruption in .dwo files handling.Alexey Samsonov2014-09-052-13/+11
| | | | | | | Forge a test case where llvm-symbolizer has to use external .dwo file to produce the inlining information. llvm-svn: 217270
* [dwarfdump] Dump DW_AT_(decl|call)_line attribute values as decimal values.Frederic Riss2014-09-051-0/+2
| | | | llvm-svn: 217232
* [ dwarfdump ] Add symbolic dump of known DWARF attribute values.Frederic Riss2014-09-041-1/+11
| | | | | | | | | | Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5187 llvm-svn: 217186
* Fix build faliure introduced by r217129.Frederic Riss2014-09-041-2/+2
| | | | | | Looks like one can't put 'const uint8_t' as ArrayRef contained type. It fails to build with libstdc++. llvm-svn: 217132
* Rename DWARFContext::getLineTableForCompileUnit to getLineTableForUnit.Frederic Riss2014-09-042-19/+18
| | | | | | | All DWARFUnits can have line information. Rename and change arguments' type accordingly. llvm-svn: 217130
* Add DWARFFormValue::getAsBlock() and add FC_Flag as an acceptable class for ↵Frederic Riss2014-09-041-1/+9
| | | | | | | | an unsigned constant. To be used in further patches that improve the dumpers. llvm-svn: 217129
* Add a DWARFContext& member in DWARFUnit.Frederic Riss2014-09-045-24/+29
| | | | | | | | | | 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
* Don't own the buffer in object::Binary.Rafael Espindola2014-08-191-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
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-1314-29/+29
| | | | | | | | | | 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
* DWOHolder takes ownership of the argument constructor, use std::unique_ptr.Rafael Espindola2014-07-312-5/+6
| | | | | | Thanks to David Blaikie for noticing it. llvm-svn: 214434
* Use a reference instead of a pointer.Rafael Espindola2014-07-314-10/+10
| | | | | | This makes using a std::unique_ptr in the caller more convenient. llvm-svn: 214433
* Use std::unique_ptr to make the ownership explicit.Rafael Espindola2014-07-311-2/+2
| | | | llvm-svn: 214377
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-261-3/+4
| | | | | | Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-261-4/+3
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
* [DWARF parser] Use distinction between DW_AT_ranges_base and ↵Alexey Samsonov2014-06-133-8/+17
| | | | | | DW_AT_GNU_ranges_base instead of DWARF version llvm-svn: 210945
* Remove 'using std::errro_code' from lib.Rafael Espindola2014-06-131-2/+1
| | | | llvm-svn: 210871
* [DWARF parser] Fix broken address ranges construction.Alexey Samsonov2014-06-122-60/+56
| | | | | | | | | | | | | | | | | Previous algorithm for constructing [Address ranges]->[Compile Units] mapping was wrong. It somewhat relied on the assumption that address ranges for different compile units may not overlap. It is not so. For example, two compile units may contain the definition of the same linkonce_odr function. These definitions will be merged at link-time, resulting in equivalent .debug_ranges entries for both these units Instead of sorting and merging original address ranges (from .debug_ranges and .debug_aranges), implement a different approach: save endpoints of all ranges, and then use a sweep-line approach to construct the desired mapping. If we find that certain address maps to several compilation units, we just pick any of them. llvm-svn: 210860
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-121-0/+1
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
OpenPOWER on IntegriCloud