summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-dwarfdump] - Add the support of parsing .debug_loclists.George Rimar2018-10-221-5/+17
| | | | | | | | | | | | This teaches llvm-dwarfdump to dump the content of .debug_loclists sections. It converts the DWARFDebugLocDWO class to DWARFDebugLoclists, teaches llvm-dwarfdump about .debug_loclists section and adds the implementation for parsing the DW_LLE_offset_pair entries. Differential revision: https://reviews.llvm.org/D53364 llvm-svn: 344895
* DebugInfo: Use debug_addr for non-dwo addresses in DWARF 5David Blaikie2018-10-201-1/+1
| | | | | | | | Putting addresses in the address pool, even with non-fission, can reduce relocations - reusing the addresses from debug_info and debug_rnglists (the latter coming soon) llvm-svn: 344834
* [DWARF] Make llvm-dwarfdump display location lists in a .dwp file correctly. ↵Wolfgang Pieb2018-10-191-6/+4
| | | | | | | | | | | | | Fixes PR38990. Considers the index when extracting location lists from a .dwp file. Majority of the patch by David Blaikie. Reviewers: dblaikie Differential revision: https://reviews.llvm.org/D53155 llvm-svn: 344807
* [dwarfdump] Hide ranges in diff-mode.Jonas Devlieghere2018-10-191-1/+3
| | | | | | | | | llvm-dwarfdump --diff should not print DW_AT_ranges. This patch fixes that. Differential revision: https://reviews.llvm.org/D53353 llvm-svn: 344794
* Revert "[DWARF] reposting r342048, which was reverted in r342056 due to ↵Alexander Kornienko2018-09-171-0/+1
| | | | | | | | | buildbot errors. Adjusted 2 test cases for ARM and darwin and fixed a bug with the original change in dsymutil." This reverts commit r342218. Due to a number of failures under TSAN. An isolated test case is being worked on. llvm-svn: 342399
* [DWARF] reposting r342048, which was reverted in r342056 due to buildbot Wolfgang Pieb2018-09-141-1/+0
| | | | | | | | errors. Adjusted 2 test cases for ARM and darwin and fixed a bug with the original change in dsymutil. llvm-svn: 342218
* Reverting r342048, which caused UBSan failures in dsymutil.Wolfgang Pieb2018-09-121-0/+1
| | | | llvm-svn: 342056
* [DWARF] Refactoring range list dumping to fold DWARF v4 functionality into ↵Wolfgang Pieb2018-09-121-1/+0
| | | | | | | | | | | | | v5 handling Eliminating some duplication of rangelist dumping code at the expense of some version-dependent code in dump and extract routines. Reviewer: dblaikie, JDevlieghere, vleschuk Differential revision: https://reviews.llvm.org/D51081 llvm-svn: 342048
* [dwarfdump] Improve -diff option by hiding more data.Jonas Devlieghere2018-09-041-2/+4
| | | | | | | | | | The -diff option makes it easy to diff dwarf by hiding addresses and offsets. However not all of them were hidden, which should be fixed by this patch. Differential revision: https://reviews.llvm.org/D51593 llvm-svn: 341377
* [DebugInfo/DWARF] [3/4] Rename DWARFUnitSection to DWARFUnitVector. NFCPaul Robinson2018-08-011-1/+1
| | | | | | | | | | | | | This is patch 3 of 4 NFC refactorings to handle type units and compile units more consistently and with less concern about the object-file section that they came from. Patch 3 simply renames DWARFUnitSection to DWARFUnitVector, as the object-file section of a unit is nearly irrelevant now. Differential Revision: https://reviews.llvm.org/D49743 llvm-svn: 338632
* [DebugInfo] Make children iterator bidirectionalJonas Devlieghere2018-07-111-0/+12
| | | | | | | | | Make the DIE iterator bidirectional so we can move to the previous sibling of a DIE. Differential revision: https://reviews.llvm.org/D49173 llvm-svn: 336823
* [DWARF] Improved error reporting for range lists. Wolfgang Pieb2018-06-201-8/+20
| | | | | | | | | | | Errors found processing the DW_AT_ranges attribute are propagated by lower level routines and reported by their callers. Reviewer: JDevlieghere Differential Revision: https://reviews.llvm.org/D48344 llvm-svn: 335188
* [dwarfdump] Make -c and -p work togetherJonas Devlieghere2018-05-261-3/+7
| | | | | | | | | | | | | When requesting to dump both the parent chain and children, we used to print the DIE more than once because we propagated the dump options to the parent without clearing the respective flags. This commit fixes this oversight and adds a test. rdar://39415292 Differential revision: https://reviews.llvm.org/D47263 llvm-svn: 333350
* [DebugInfo] Use absolute addresses in location listsJonas Devlieghere2018-05-211-4/+7
| | | | | | | | | | | Rather than relying on the user to do the address calculating in DW_AT_location we should just dump the absolute address. rdar://problem/38513870 Differential revision: https://reviews.llvm.org/D47152 llvm-svn: 332873
* [DWARF v5] Improved support for .debug_rnglists (consumer). Enables any ↵Wolfgang Pieb2018-05-181-6/+15
| | | | | | | | | | | | consumer to extract DWARF v5 encoded rangelists. Reviewer: JDevlieghere Differential Revision: https://reviews.llvm.org/D45549 llvm-svn: 332759
* [DebugInfo] Prevent infinite recursion for malformed DWARFJonas Devlieghere2018-04-301-10/+30
| | | | | | | | | | | This prevents infinite recursion in DWARFDie::findRecursively for malformed DWARF where a DIE references itself. This fixes PR36257. Differential revision: https://reviews.llvm.org/D43092 llvm-svn: 331200
* [dwarf] Unify unknown dwarf enum formatting codePavel Labath2018-03-211-20/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We have had at least three pieces of code (in DWARFAbbreviationDeclaration, DWARFAcceleratorTable and DWARFDie) that have hand-rolled support for dumping unknown dwarf enum values. While not terrible, they are a bit distracting and enable small differences to creep in (Unknown_ffff vs. Unknown_0xffff). I ended up needing to add a fourth place (DWARFVerifier), so it seems it would be a good time to centralize. This patch creates an alternative to the XXXString dumping functions in the BinaryFormat library, which formats an unknown value as DW_TYPE_unknown_1234, instead of just an empty string. It is based on the formatv function, as that allows us to avoid materializing the string for unknown values (and because this way I don't have to invent a name for the new functions :P). In this patch I add formatters for dwarf attributes, forms, tags, and index attributes as these are the ones in use currently, but adding other enums is straight-forward. Reviewers: dblaikie, JDevlieghere, aprantl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44570 llvm-svn: 328090
* [Support] Move syntax highlighting into supportJonas Devlieghere2018-03-091-9/+10
| | | | | | | | | | | | Move the DWARF syntax highlighting into support. This has several advantages, most notably that this makes the WithColor RAII wrapper available outside libDebugInfo. Furthermore, several projects all have their own code for handling colored output. This provides a place to centralize it. Differential revision: https://reviews.llvm.org/D44215 llvm-svn: 327108
* [DebugInfo] Unify dumping of address rangesJonas Devlieghere2018-01-161-4/+2
| | | | | | | | | | | | | | | Summary: This patch unifies the printing of address ranges as [0x0, 0x1). rdar://34822059 Reviewers: aprantl, dblaikie Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D42056 llvm-svn: 322543
* dwarfdump: Add support for the --diff option.Adrian Prantl2017-12-081-7/+10
| | | | | | | | | --diff Emit the output in a diff-friendly way by omitting offsets and addresses. <rdar://problem/34502625> llvm-svn: 320214
* llvm-dwarfdump: honor the --show-children option when dumping a specific DIE.Adrian Prantl2017-11-291-1/+1
| | | | llvm-svn: 319271
* Fixed the ability to recursively get an attribute value from a DWARFDie.Greg Clayton2017-11-271-10/+9
| | | | | | | | The previous implementation would only look 1 DW_AT_specification or DW_AT_abstract_origin deep. This means DWARFDie::getName() would fail in certain cases. I ran into such a case while creating a tool that used the LLVM DWARF parser to generate a symbolication format so I have seen this in the wild. Differential Revision: https://reviews.llvm.org/D40156 llvm-svn: 319104
* [llvm-dwarfdump] Display DW_AT_high_pc as absolute valueJonas Devlieghere2017-11-271-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | DWARF4 relative DW_AT_high_pc values are now displayed as absolute addresses. The relative value is only shown when explicitly dumping the forms, i.e. in show-form or verbose mode. ``` DW_AT_low_pc (0x0000000000000049) DW_AT_high_pc (0x00000019) ``` becomes ``` DW_AT_low_pc (0x0000000000000049) DW_AT_high_pc (0x0000000000000062) ``` Differential revision: https://reviews.llvm.org/D40317 rdar://35416943 llvm-svn: 319044
* [DWARFv5] Support DW_FORM_strp in the .debug_line header.Paul Robinson2017-11-071-2/+3
| | | | | | | | Supporting this form in .debug_line.dwo will be done as a follow-up. Differential Revision: https://reviews.llvm.org/D33155 llvm-svn: 317607
* [llvm-dwarfdump] - Fix array out of bounds access crash.George Rimar2017-10-251-0/+6
| | | | | | | | | | | This fixes possible out of bound access in DWARFDie::getFirstChild() which might happen when .debug_info section is corrupted, like shown in testcase. Differential revision: https://reviews.llvm.org/D39185 llvm-svn: 316566
* [llvm-dwarfdump] - Teach tool about few GNU call_sites constants.George Rimar2017-10-231-1/+2
| | | | | | | | | | | | | | This teaches tool about following consants: DW_TAG_GNU_call_site, DW_TAG_GNU_call_site_parameter, DW_AT_GNU_call_site_value, DW_AT_GNU_all_call_sites. Constants documented here: https://sourceware.org/elfutils/DwarfExtensions Differential revision: https://reviews.llvm.org/D39119 llvm-svn: 316321
* Re-land "[llvm-dwarfdump] Print type names in DW_AT_type DIEs"Jonas Devlieghere2017-10-101-4/+64
| | | | | | | | | | | | This patch adds printing for DW_AT_type DIEs like it is already the case for DW_AT_specification DIEs. This is a rather naive approach and only a start. We should have pretty printers for different languages. Recommit after being reverted in r315299. Differential revision: https://reviews.llvm.org/D36993 llvm-svn: 315316
* Revert "[llvm-dwarfdump] Print type names in DW_AT_type DIEs"Jonas Devlieghere2017-10-101-62/+0
| | | | | | This reverts commit r315297. llvm-svn: 315299
* [llvm-dwarfdump] Print type names in DW_AT_type DIEsJonas Devlieghere2017-10-101-0/+62
| | | | | | | | | | This patch adds printing for DW_AT_type DIEs like it is already the case for DW_AT_specification DIEs. This is a rather naive approach and only a start. We should have pretty printers for different languages. Differential revision: https://reviews.llvm.org/D36993 llvm-svn: 315297
* clang-format file.Adrian Prantl2017-10-041-30/+27
| | | | llvm-svn: 314942
* delete commented out code.Adrian Prantl2017-10-041-2/+0
| | | | llvm-svn: 314941
* [dwarfdump] Add -show-formJonas Devlieghere2017-10-021-1/+1
| | | | | | | | | This enables printing of DWARF form types after the DWARF attribute types. Differential revision: https://reviews.llvm.org/D38459 llvm-svn: 314685
* llvm-dwarfdump: implement --recurse-depth=<N>Adrian Prantl2017-09-201-6/+7
| | | | | | | | | | 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
* 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-181-0/+1
| | | | llvm-svn: 313560
* [dwarfdump] Rename Brief to Verbose in DIDumpOptionsJonas Devlieghere2017-09-131-6/+7
| | | | | | | | | | | 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
* [dwarfdump] Pretty print location expressions and location listsReid Kleckner2017-08-291-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [llvm-dwarfdump] Hide .debug_str and DIE reference offsets in brief modeJonas Devlieghere2017-08-181-9/+9
| | | | | | | | | 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-151-18/+7
| | | | | | | | | | | 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-151-12/+40
| | | | | | | | | 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
* fix trivial typos in comments; NFCHiroshi Inoue2017-07-031-1/+1
| | | | llvm-svn: 307004
* [DWARF] NFC: DWARFDataExtractor combines relocs with DataExtractor.Paul Robinson2017-06-291-1/+1
| | | | | | | | | | | Requires callers to directly associate relocations with a DataExtractor used to read data from a DWARF section, which helps a callee not make assumptions about which section it is reading. This is the next step in reducing DWARFFormValue's dependence on DWARFUnit. Differential Revision: https://reviews.llvm.org/D34704 llvm-svn: 306699
* Move Object format code to lib/BinaryFormat.Zachary Turner2017-06-071-1/+1
| | | | | | | | | | | | This creates a new library called BinaryFormat that has all of the headers from llvm/Support containing structure and layout definitions for various types of binary formats like dwarf, coff, elf, etc as well as the code for identifying a file from its magic. Differential Revision: https://reviews.llvm.org/D33843 llvm-svn: 304864
* Introduce -brief command line option to llvm-dwarfdumpAdrian Prantl2017-06-061-16/+21
| | | | | | | | | | | | | This patch introduces a new command line option, called brief, to llvm-dwarfdump. When -brief is used, the attribute forms for the .debug_info section will not be emitted to output. Patch by Spyridoula Gravani! rdar://problem/21474365 Differential Revision: https://reviews.llvm.org/D33867 llvm-svn: 304844
* Sort the remaining #include lines in include/... and lib/....Chandler Carruth2017-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line with a #include and let it re-sort things according to the precise LLVM rules for include ordering baked into clang-format these days. I've reverted a number of files where the results of sorting includes isn't healthy. Either places where we have legacy code relying on particular include ordering (where possible, I'll fix these separately) or where we have particular formatting around #include lines that I didn't want to disturb in this patch. This patch is *entirely* mechanical. If you get merge conflicts or anything, just ignore the changes in this patch and run clang-format over your #include lines in the files. Sorry for any noise here, but it is important to keep these things stable. I was seeing an increasing number of patches with irrelevant re-ordering of #include lines because clang-format was used. This patch at least isolates that churn, makes it easy to skip when resolving conflicts, and gets us to a clean baseline (again). llvm-svn: 304787
* Recommit "[DWARF] - Make collectAddressRanges() return section index in ↵George Rimar2017-05-271-5/+8
| | | | | | | | | | | | | | | | | | | | | | addition to Low/High PC" With fix of uninitialized variable. Original commit message: This change is intended to use for LLD in D33183. Problem we have in LLD when building .gdb_index is that we need to know section which address range belongs to. Previously it was solved on LLD side by providing fake section addresses with use of llvm::LoadedObjectInfo interface. We assigned file offsets as addressed. Then after obtaining ranges lists, for each range we had to find section ID's. That not only was slow, but also complicated implementation and was the reason of incorrect behavior when sections share the same offsets, like D33176 shows. This patch makes DWARF parsers to return section index as well. That solves problem mentioned above. Differential revision: https://reviews.llvm.org/D33184 llvm-svn: 304078
OpenPOWER on IntegriCloud