summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF
Commit message (Collapse)AuthorAgeFilesLines
...
* [dwarfdump][NFC] Consistent errors and warnings with --verifyJonas Devlieghere2017-09-293-88/+118
| | | | | | | | | | | This patch introduces 3 helper functions: error(), warn() and note() to make printing during verification more consistent. When supported, the respective prefixes are printed in color using the same color scheme as clang. Differential revision: https://reviews.llvm.org/D38368 llvm-svn: 314498
* llvm-dwarfdump: support .apple-namespaces in --findAdrian Prantl2017-09-291-15/+13
| | | | llvm-svn: 314481
* llvm-dwarfdump: add support for .apple_types in --findAdrian Prantl2017-09-291-2/+6
| | | | llvm-svn: 314479
* llvm-dwarfdump: implement --find for .apple_namesAdrian Prantl2017-09-282-3/+87
| | | | | | | | | | | | This patch implements the dwarfdump option --find=<name>. This option looks for a DIE in the accelerator tables and dumps it if found. This initial patch only adds support for .apple_names to keep the review small, adding the other sections and pubnames support should be trivial though. Differential Revision: https://reviews.llvm.org/D38282 llvm-svn: 314439
* [dwarfdump] Verify that CUs have a unit DIE.Jonas Devlieghere2017-09-281-3/+8
| | | | | | | | | This patch adds a check to the DWARF verifier to detect CUs without a unit DIE. Differential revision: https://reviews.llvm.org/D38363 llvm-svn: 314426
* [dwarfdump] Fix printing of .debug_line offset.Jonas Devlieghere2017-09-271-1/+1
| | | | | | | | | Fixes 32-bit buildbots: http://bb.pgr.jp/builders/test-llvm-i686-linux-RA/builds/542 http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15/builds/11533 http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/11494 llvm-svn: 314291
* [dwarfdump] Add support for -debug-line=OFFSETJonas Devlieghere2017-09-271-0/+3
| | | | | | | | This patch adds support for passing an offset to -debug-line. Differential revision: https://reviews.llvm.org/D38240 llvm-svn: 314288
* [dwarfdump] Add support for -debug-loc=OFFSETJonas Devlieghere2017-09-272-6/+48
| | | | | | | | This patch adds support for passing an offset to -debug-loc. Differential revision: https://reviews.llvm.org/D38237 llvm-svn: 314286
* [dwarfdump] Skip 'stripped' sectionsJonas Devlieghere2017-09-261-0/+4
| | | | | | | | | | | | | | | | | | | When dsymutil generates the companion file, its strips all unnecessary sections by omitting their body and setting the offset in their corresponding load command to zero. One such section is the .eh_frame section, as it contains runtime information rather than debug information and is part of the __TEXT segment. When reading this section, we would just read the number of bytes specified in the load command, starting from offset 0 (i.e. the beginning of the file). Rather than trying to parse this obviously invalid section, dwarfdump now skips this. Differential revision: https://reviews.llvm.org/D38135 llvm-svn: 314208
* [dwarfdump] Add verbose output for .debug-line sectionJonas Devlieghere2017-09-212-8/+83
| | | | | | | | | | | | This patch adds dumping of line table instructions as well as the final state at each specified pc value in verbose mode. This is essentially the same as the default in Darwin's dwarfdump. Dumping the actual line table opcodes can be particularly useful for something like debugging a bad `.debug_line` section. Differential revision: https://reviews.llvm.org/D37971 llvm-svn: 313910
* llvm-dwarfdump support --debug-frame=<offset> and --eh-frame=<offset>Adrian Prantl2017-09-212-16/+33
| | | | llvm-svn: 313900
* [DWARF] Shrink AttributeSpec from 24 to 16 bytes.Benjamin Kramer2017-09-211-11/+10
| | | | | | | This is a bit ugly because we can't put Optional into a union. Hide all of that behind a set of accessors and make accesses safer using asserts. llvm-svn: 313884
* llvm-dwarfdump: implement --recurse-depth=<N>Adrian Prantl2017-09-205-21/+24
| | | | | | | | | | This patch implements the Darwin dwarfdump option --recurse-depth=<N>, which limits the recursion depth when selectively printing DIEs at an offset. Differential Revision: https://reviews.llvm.org/D38064 llvm-svn: 313778
* dwarfdump/symbolizer: Avoid loading unneeded CUs from a DWPDavid Blaikie2017-09-193-9/+11
| | | | | | | | When symbolizing large binaries, parsing every CU in a DWP file is a significant performance penalty. Instead, use the index to only load the CUs that are needed. llvm-svn: 313659
* dwarfdump: Delay parsing abbreviations until they're neededDavid Blaikie2017-09-192-10/+33
| | | | | | | | | | | This speeds up dumping specific DIEs by not parsing abbreviations for units that are not used. (this is also handy to have in eventually to speed up llvm-symbolizer for .dwp files, where parsing most of the DWP file can be avoided by using the index) llvm-svn: 313635
* llvm-dwarfdump: use more efficient API (NFC)Adrian Prantl2017-09-181-4/+4
| | | | llvm-svn: 313573
* 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
OpenPOWER on IntegriCloud