summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix indentation.Adrian Prantl2017-09-181-1/+1
| | | | llvm-svn: 313568
* llvm-dwarfdump: add a --show-parents options when selectively dumping DIEs.Adrian Prantl2017-09-181-1/+16
| | | | llvm-svn: 313567
* llvm-dwarfdump: Sink the handling of ShowChildren into DWARFDie::dump(). NFC.Adrian Prantl2017-09-182-4/+3
| | | | llvm-svn: 313560
* [dwarfdump] Make .eh_frame an alias for .debug_frameJonas Devlieghere2017-09-182-11/+16
| | | | | | | | | | | | | | | | | | | | This patch makes the `.eh_frame` extension an alias for `.debug_frame`. Up till now it was only possible to dump the section using objdump, but not with dwarfdump. Since the two are essentially interchangeable, we dump whichever of the two is present. As a workaround, this patch also adds parsing for 3 currently unimplemented CFA instructions: `DW_CFA_def_cfa_expression`, `DW_CFA_expression`, and `DW_CFA_val_expression`. Because I lack the required knowledge, I just parse the fields without actually creating the instructions. Finally, this also fixes the typo in the `.debug_frame` section name which incorrectly contained a trailing `s`. Differential revision: https://reviews.llvm.org/D37852 llvm-svn: 313530
* llvm-dwarfdump: support a --show-children optionAdrian Prantl2017-09-161-2/+4
| | | | | | | This will print all children of a DIE when selectively printing only one DIE at a given offset. llvm-svn: 313464
* llvm-dwarfdump: Add support for -debug-types=<offset>.Adrian Prantl2017-09-161-12/+15
| | | | llvm-svn: 313463
* llvm-dwarfdump: Add support for -debug-info=<offset>.Adrian Prantl2017-09-151-45/+53
| | | | | | | | | This is the first of many commits that enable selectively dumping just one record from the debug info. This reapplies r313412 with some extra qualification to appease GCC and MSVC. llvm-svn: 313419
* Revert "llvm-dwarfdump: Add support for -debug-info=<offset>."Adrian Prantl2017-09-151-53/+45
| | | | | | This reverts commit r313412 because of a g++ incompatibility. llvm-svn: 313413
* llvm-dwarfdump: Add support for -debug-info=<offset>.Adrian Prantl2017-09-151-45/+53
| | | | | | | This is the first of many commits that enable selectively dumping just one record from the debug info. llvm-svn: 313412
* llvm-dwarfdump: Factor out the printing of the section header (NFC)Adrian Prantl2017-09-152-65/+68
| | | | llvm-svn: 313370
* [test] Fix TestDWARFDieRangeInfoIntersectsJonas Devlieghere2017-09-141-0/+2
| | | | | | Fixes heap buffer overflow triggered in DWARF verifier, detected by ASAN. llvm-svn: 313280
* llvm-dwarfdump: support dumping static archives.Adrian Prantl2017-09-141-3/+0
| | | | llvm-svn: 313272
* [dwarfdump] Add DWARF verifiers for address rangesJonas Devlieghere2017-09-141-4/+135
| | | | | | | | | | | | | | | | This patch started as an attempt to rebase Greg's differential (D32821). The result is both quite similar and different at the same time. It adds the following checks: - Verify that all address ranges in a DIE are valid. - Verify that no ranges within the DIE overlap. - Verify that no ranges overlap with the ranges of a sibling. - Verify that children are completely contained in its (direct) parent's address range. (unless both are subprograms) Differential revision: https://reviews.llvm.org/D37696 llvm-svn: 313255
* Revert "[dwarfdump] Add DWARF verifiers for address ranges"Jonas Devlieghere2017-09-141-135/+4
| | | | | | This reverts commit r313250. llvm-svn: 313253
* [dwarfdump] Add DWARF verifiers for address rangesJonas Devlieghere2017-09-141-4/+135
| | | | | | | | | | | | | | | | This patch started as an attempt to rebase Greg's differential (D32821). The result is both quite similar and different at the same time. It adds the following checks: - Verify that all address ranges in a DIE are valid. - Verify that no ranges within the DIE overlap. - Verify that no ranges overlap with the ranges of a sibling. - Verify that children are completely contained in its (direct) parent's address range. (unless both are subprograms) Differential revision: https://reviews.llvm.org/D37696 llvm-svn: 313250
* llvm-dwarfdump: automatically dump both regular and .dwo variant of sectionsAdrian Prantl2017-09-131-74/+91
| | | | | | | | | | | | Since users typically don't really care about the .dwo / non.dwo distinction, this patch makes it so dwarfdump --debug-<info,...> dumps .debug_info and (if available) also .debug_info.dwo. This simplifies the command line interface (I've removed all dwo-specific dump options) and makes the tool friendlier to use. Differential Revision: https://reviews.llvm.org/D37771 llvm-svn: 313207
* llvm-dwarfdump: support dumping UUIDs of Mach-O binaries.Adrian Prantl2017-09-131-0/+28
| | | | | | | This is a feature supported by Darwin dwarfdump. UUIDs are used to associate executables with their .dSYM bundles. llvm-svn: 313165
* [dwarfdump] Rename Brief to Verbose in DIDumpOptionsJonas Devlieghere2017-09-135-28/+29
| | | | | | | | | | | This patches renames "brief" to "verbose" in de DIDumpOptions and inverts the logic to match the new behavior where brief is the default. Changing the default value uncovered some bugs related to the DIDumpOptions not being propagated and have been fixed as well. Differential revision: https://reviews.llvm.org/D37745 llvm-svn: 313139
* llvm-dwarfdump: Replace -debug-dump=sect option with individual options.Adrian Prantl2017-09-111-33/+33
| | | | | | | | | | | | | | | | | | | | | | As discussed on llvm-dev in http://lists.llvm.org/pipermail/llvm-dev/2017-September/117301.html this changes the command line interface of llvm-dwarfdump to match the one used by the dwarfdump utility shipping on macOS. In addition to being shorter to type this format also has the advantage of allowing more than one section to be specified at the same time. In a nutshell, with this change $ llvm-dwarfdump --debug-dump=info $ llvm-dwarfdump --debug-dump=apple-objc becomes $ dwarfdump --debug-info --apple-objc Differential Revision: https://reviews.llvm.org/D37714 llvm-svn: 312970
* [dwarfdump] Verify line table prologueJonas Devlieghere2017-09-081-0/+41
| | | | | | | | | | This patch adds prologue verification, which is already present in Apple's dwarfdump. It checks for invalid directory indices and warns about duplicate file paths. Differential revision: https://reviews.llvm.org/D37511 llvm-svn: 312782
* [DebugInfo] - Fix for lld DWARF parsing of base address selection entries in ↵George Rimar2017-09-043-10/+26
| | | | | | | | | | | | | range lists. It solves issue of wrong section index evaluating for ranges when base address is used. Based on David Blaikie's patch D36097. Differential revision: https://reviews.llvm.org/D37214 llvm-svn: 312477
* [dwarfdump] Pretty print location expressions and location listsReid Kleckner2017-08-296-81/+482
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Based on Fred's patch here: https://reviews.llvm.org/D6771 I can't seem to commandeer the old review, so I'm creating a new one. With that change the locations exrpessions are pretty printed inline in the DIE tree. The output looks like this for debug_loc entries: DW_AT_location [DW_FORM_data4] (0x00000000 0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3 0x000000000000000b - 0x0000000000000012: DW_OP_consts +7 0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4 0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0) And like this for debug_loc.dwo entries: DW_AT_location [DW_FORM_sec_offset] (0x00000000 Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4) Simple locations without ranges are printed inline: DW_AT_location [DW_FORM_block1] (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0) The debug_loc(.dwo) dumping in changed accordingly to factor the code. Reviewers: dblaikie, aprantl, friss Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D37123 llvm-svn: 312042
* Revert "[llvm-dwarfdump] Print type names in DW_AT_type DIEs"Jonas Devlieghere2017-08-221-2/+1
| | | | | | This reverts commit r311492. llvm-svn: 311499
* [llvm-dwarfdump] Print type names in DW_AT_type DIEsJonas Devlieghere2017-08-221-1/+2
| | | | | | | This patch adds printing for DW_AT_type DIEs like it's currently already the case for DW_AT_specification DIEs. llvm-svn: 311492
* Move helper classes into anonymous namespaces.Benjamin Kramer2017-08-201-1/+1
| | | | | | No functionality change intended. llvm-svn: 311288
* [llvm-dwarfdump] Hide .debug_str and DIE reference offsets in brief modeJonas Devlieghere2017-08-182-12/+13
| | | | | | | | | This patch hides the .debug_str offset and DIE reference offsets into the CU when llvm-dwarfdump is invoked with -brief. Differential Revision: https://reviews.llvm.org/D36835 llvm-svn: 311201
* Add a convenience overload of DWARFDie::dump() for debugging purposes.Adrian Prantl2017-08-161-0/+2
| | | | llvm-svn: 311026
* [llvm-dwarfdump] - Attemp to fix BB after r310915.George Rimar2017-08-151-1/+1
| | | | | | | Now MIPS one is unhappy: http://lab.llvm.org:8011/builders/llvm-mips-linux/builds/2221 llvm-svn: 310928
* [llvm-dwarfdump] - Refactor section name/uniqueness gathering.George Rimar2017-08-152-18/+20
| | | | | | | | | | | As was requested in D36313 thread, with this patch section names and uniqueness calculated once, and not every time when a range is dumped. Differential revision: https://reviews.llvm.org/D36740 llvm-svn: 310923
* [llvm-dwarfdump] - Print section name and index when dumping .debug_info rangesGeorge Rimar2017-08-153-19/+53
| | | | | | | | | Teaches llvm-dwarfdump to print section index and name of range when it dumps .debug_info. Differential revision: https://reviews.llvm.org/D36313 llvm-svn: 310915
* [DebugInfo][DWARF] Address paulr's comment on rL310253.Simon Dardis2017-08-071-1/+1
| | | | llvm-svn: 310267
* [DebugInfo][DWARF] Correct some usages of PRIx32 to PRIx64Simon Dardis2017-08-071-4/+4
| | | | | | | | | | | These lead to tests failing spuriously as the values after being rendered to a string were incorrect. Reviewers: clayborg Differential Revision: https://reviews.llvm.org/D36319 llvm-svn: 310262
* [DebugInfo][DWARF] Use PRIx64 explicitly in output.Simon Dardis2017-08-071-2/+2
| | | | llvm-svn: 310253
* DebugInfo: Test & handle (differently) non-zero DW_AT_ranges_baseDavid Blaikie2017-08-021-6/+7
| | | | | | | | | Followup to r309570, fixing it slightly differently (ranges_base and addr_base should never be read from a DWO file - so there shouldn't be any issue with 'overriding' the values - conditionalize the code and assert that the values aren't being overriden). llvm-svn: 309879
* [DebugInfo] Use shrink_to_fit to simplify code. NFCI.Benjamin Kramer2017-08-012-14/+4
| | | | llvm-svn: 309683
* [DWARF] Added verification check for tags in accelerator tables. This patch ↵Spyridoula Gravani2017-07-312-7/+23
| | | | | | | | verifies that the atom tag is actually the same with the tag of the DIE that we retrieve from the table. Differential Revision: https://reviews.llvm.org/D35963 llvm-svn: 309596
* [DebugInfo] Don't overwrite DWARFUnit fields if the CU DIE doesn't have them.Benjamin Kramer2017-07-311-2/+6
| | | | | | | | | | DIEs are lazily deserialized so it's possible that the DWO CU is created before the DIE is parsed. DWO shares .debug_addr and .debug_ranges with the object file so overwriting the offset with 0 will make the CU unusable. No test case because I couldn't get clang to emit a non-zero range base. llvm-svn: 309570
* DebugInfo: Fix for CU index usage in 309507David Blaikie2017-07-301-1/+3
| | | | | | Not sure quite how I failed so clearly to test this, but anyway. llvm-svn: 309514
* DebugInfo: Use DWP cu_index to speed up symbolizing (as intended)David Blaikie2017-07-302-3/+26
| | | | | | | | | | | I was a bit lazy when I first implemented this & skipped the index lookup - obviously for large files this becomes pretty crucial, so here we go, do the index lookup. Speeds up large DWP symbolizing by... lots. (20m -> 20s, actually, maybe more in a release build (that was a release build without index lookup, compared to a debug/non-release build with the index usage)) llvm-svn: 309507
* DebugInfo: Provide option for explicitly specifying the name of the DWP fileDavid Blaikie2017-07-301-6/+9
| | | | | | | | | | | | | | | | If you've archived the DWP file somewhere it's probably useful to be able to just tell llvm-symbolizer where it is when you're symbolizing stack traces from the binary. This only provides a mechanism for specifying a single DWP file, good if you're symbolizing a program with a single DWP file, but it's likely if the program is dynamically linked that you might have a DWP for each dynamic library - in which case this feature won't help (at least as it's surfaced in llvm-symbolizer for now) - in theory it could be extended to specify a collection of DWP files that could all be consulted for split CU hash resolution. llvm-svn: 309498
* [DWARF] Minor code style modification, no functionality change.Spyridoula Gravani2017-07-271-8/+5
| | | | llvm-svn: 309240
* [DWARF] Generalized verification of .apple_names accelerator table to be ↵Spyridoula Gravani2017-07-262-48/+65
| | | | | | | | applicable to any acceleration table. Added verification for .apple_types, .apple_namespaces and .apple_objc sections. Differential Revision: https://reviews.llvm.org/D35853 llvm-svn: 309068
* DWARFVerifier.cpp: Fix -m32 in r308928. Use PRIx64.NAKAMURA Takumi2017-07-251-1/+2
| | | | llvm-svn: 308949
* [DWARF] Added verification check for die ranges. If highPC is an address, ↵Spyridoula Gravani2017-07-241-0/+13
| | | | | | | | then it should be greater than lowPC for each range. Differential Revision: https://reviews.llvm.org/D35733 llvm-svn: 308928
* Move DWARFSectionMap to a .cpp file.Rafael Espindola2017-07-241-0/+6
| | | | | | Thanks to Paul Robinson for the suggestion. llvm-svn: 308913
* [DWARF] Generalized verification of .debug_abbrev to be applicable to both ↵Spyridoula Gravani2017-07-211-14/+24
| | | | | | | | .debug_abbrev and .debug_abbrev.dwo sections. Differential Revision: https://reviews.llvm.org/D35698 llvm-svn: 308703
* [DWARF] Added check that verifies that no abbreviation declaration has more ↵Spyridoula Gravani2017-07-202-0/+32
| | | | | | | | | | | | | than one attribute with the same name. SUMMARY This patch adds a verification check on the abbreviation declarations in the .debug_abbrev section. The check makes sure that no abbreviation declaration has more than one attributes with the same name. Differential Revision: https://reviews.llvm.org/D35643 llvm-svn: 308579
* Use llvm::make_unique once more to avoid ADL ambiguity with std::make_uniqueReid Kleckner2017-07-191-2/+3
| | | | llvm-svn: 308552
* Use llvm::make_unique to try to fix the windows build.Rafael Espindola2017-07-191-2/+2
| | | | llvm-svn: 308551
* Remove some leftover DWARFContextInMemory.Rafael Espindola2017-07-191-14/+0
| | | | | | Not sure how I missed these on the previous commit. llvm-svn: 308550
OpenPOWER on IntegriCloud