summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r347490 as it breaks address sanitizer buildsLuke Cheeseman2018-11-232-17/+10
| | | | llvm-svn: 347499
* Revert r343341Luke Cheeseman2018-11-232-10/+17
| | | | | | | - Cannot reproduce the build failure locally and the build logs have been deleted. llvm-svn: 347490
* llvm-symbolizer: Avoid calling getFromOffset when the index entry is already ↵David Blaikie2018-11-171-8/+14
| | | | | | | | | | | | available Especially for symbolizer it can be efficient to have to search through the entire index when it isn't needed - llvm-symbolizer looks up only a few CUs & already has an index available in getUnitForEntry, once it's passed down to DWARFUnitHeader::extract then there's no need for it to call getFromOffset. llvm-svn: 347134
* Use llvm::copy. NFCFangrui Song2018-11-171-2/+2
| | | | llvm-svn: 347126
* [DWARF] Use PRIx64 instead of 'x' to format 64-bit valuesSimon Atanasyan2018-11-161-2/+2
| | | | | | | | This is a follow-up to r346715. Use PRIx64 to formatted print of 64-bit value in the `DWARFDebugLoclists::LocationList::dump` to escape problem on big-endian hosts. llvm-svn: 347049
* [DWARF] Do not use PRIx32 for printing uint64_t valuesSimon Atanasyan2018-11-121-1/+1
| | | | | | | | | | | | | | | The `DWARFDebugAddrTable::dump` routine prints 32/64-bits addresses. These values are stored in a vector of `uint64_t` independently of their original sizes. But `format` function gets format string with PRIx32 suffix in case of 32-bit address size. At least on MIPS 32-bit targets that leads to incorrect output. This patch changes formats strings and always use PRIx64 to print `uint64_t` values. Differential Revision: http://reviews.llvm.org/D54424 llvm-svn: 346715
* NFC: DebugInfo: Reduce scope of DebugOffset to simplify codeDavid Blaikie2018-11-121-31/+33
| | | | | | | | | | | This was being used as a sort of indirect out parameter from shouldDump - seems simpler to use it as the actual result of the call. (this does mean using a pointer to an Optional & actually using all 3 states (null, None, and present) which is, admittedly, a tad subtle - but given the limited scope, seems OK to me - open to discussion though, if others feel strongly about it) llvm-svn: 346691
* [DWARF] Change pubnames to use DWARFSection instead of StringRefFangrui Song2018-11-112-25/+27
| | | | | | | | | | | | | | Summary: The debug_info_offset values in .debug_{,gnu_}pub{name,types} may be relocated. Change it to DWARFSection so that we can get relocated values. Reviewers: ruiu, dblaikie, grimar, JDevlieghere Reviewed By: JDevlieghere Subscribers: aprantl, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D54375 llvm-svn: 346615
* Add parentheses to silence warning.Jorge Gorbe Moya2018-11-071-1/+1
| | | | | | DWARFContext.cpp:356:20: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses] llvm-svn: 346365
* [DWARFv5] Read and dump multiple .debug_info sections.Paul Robinson2018-11-072-33/+66
| | | | | | | | Type units go in .debug_info comdats, not .debug_types, in v5. Differential Revision: https://reviews.llvm.org/D53907 llvm-svn: 346360
* [DWARF] Support types CU list in .gdb_index dumpingFangrui Song2018-11-051-3/+20
| | | | | | Some executables have non-empty types CU list and -gdb-index would report "<error reporting>" before. llvm-svn: 346181
* [DWARF v5] Verifier: Add checks for DW_FORM_strx* forms.Wolfgang Pieb2018-11-031-0/+39
| | | | | | | | | Adding functionality to the DWARF verifier for DWARF v5 strx* forms which index into the string offsets table. Differential Revision: https://reviews.llvm.org/D54049 llvm-svn: 346061
* [DWARF] Fix typo, .gnu_index -> .gdb_indexFangrui Song2018-11-021-1/+1
| | | | llvm-svn: 346039
* [DWARF][NFC] Refactor a function to return Optional<> instead of boolWolfgang Pieb2018-10-312-9/+9
| | | | | | | | Minor refactor of DWARFUnit::getStringOffsetSectionItem(). Differential Revision: https://reviews.llvm.org/D53948 llvm-svn: 345776
* [DWARF] Revert r345546: Refactor range list extraction and dumpingWolfgang Pieb2018-10-317-214/+229
| | | | | | This patch caused some internal tests to break which are being investigated. llvm-svn: 345687
* DWARFVerifier: make the verifier more comprehensive for objectsSaleem Abdulrasool2018-10-301-1/+1
| | | | | | | Make the code do what was mentioned in the comment: only skip the CU types. This enables the lexical blocks to be verified as well. llvm-svn: 345675
* [DWARF][NFC] Refactor range list extraction and dumpingWolfgang Pieb2018-10-297-229/+214
| | | | | | | | | | | | | | | | | The purpose of this patch is twofold: - Fold pre-DWARF v5 functionality into v5 to eliminate the need for 2 different versions of range list handling. We get rid of DWARFDebugRangelist{.cpp,.h}. - Templatize the handling of range list tables so that location list handling can take advantage of it as well. Location list and range list tables have the same basic layout. A non-NFC version of this patch was previously submitted with r342218, but it caused errors with some TSan tests. This patch has no functional changes. The difference to the non-NFC patch is that there are no changes to rangelist dumping in this patch. Differential Revision: https://reviews.llvm.org/D53545 llvm-svn: 345546
* Revert "Revert "DebugInfo: reduce DIE range verification on object files""Saleem Abdulrasool2018-10-281-13/+45
| | | | | | | This reverts commit 836c763dadbd9478fa35b1a291a38bf17aa206ba. Default initialize the values that MSAN caught. llvm-svn: 345482
* Revert "DebugInfo: reduce DIE range verification on object files"Vlad Tsyrklevich2018-10-271-44/+13
| | | | | | | This reverts commits r345441 and r345444, they were causing msan buildbot failures. llvm-svn: 345457
* DebugInfo: reduce DIE range verification on object filesSaleem Abdulrasool2018-10-271-13/+44
| | | | | | | | Relocatable content may have overlapping ranges until the sections are finalized. This reduces the amount of verification that is done on an object file so that invalid errors are not raised. llvm-svn: 345441
* [DWARF][NFC] cleanup (mostly leftovers from the implementation of string ↵Wolfgang Pieb2018-10-261-43/+31
| | | | | | | | | | offsets tables) Majority of the patch by David Blaikie. Differential Revision: https://reviews.llvm.org/D53741 llvm-svn: 345404
* llvm-dwarfdump: loclists: Don't expect an (albeit empty) expression for ↵David Blaikie2018-10-251-6/+8
| | | | | | LLE_base_address llvm-svn: 345320
* [llvm-dwarfdump] - Fix incorrect parsing of the DW_LLE_startx_lengthGeorge Rimar2018-10-253-8/+25
| | | | | | | | | | | | | | | | | As was already mentioned in comments for D53364, DWARF 5 spec says about DW_LLE_startx_length: "This is a form of bounded location description that has two unsigned ULEB operands. The first value is an address index (into the .debug_addr section) that indicates the beginning of the address range over which the location is valid. The second value is the length of the range. ") Currently, the length is always parsed as U32. Patch change the behavior to parse DW_LLE_startx_length as ULEB128 for DWARF 5 and keeps it as U32 for DWARF4+(pre-DWARF5) for compatibility. Differential revision: https://reviews.llvm.org/D53564 llvm-svn: 345254
* llvm-dwarfdump: Account for skeleton addr_base when dumping addresses in ↵David Blaikie2018-10-241-0/+10
| | | | | | split unit in the same file llvm-svn: 345215
* [llvm-dwarfdump] - Fix win10 build bot failture.George Rimar2018-10-221-3/+6
| | | | | | | | | | | Bot failed: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20877/steps/test/logs/stdio This was broken after the r344895 "[llvm-dwarfdump] - Add the support of parsing .debug_loclists." because of wrong formatting specifiers used. llvm-svn: 344896
* [llvm-dwarfdump] - Add the support of parsing .debug_loclists.George Rimar2018-10-223-28/+108
| | | | | | | | | | | | 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 DW_OP_addrx in DWARFv5David Blaikie2018-10-201-0/+1
| | | | | | Reuse addresses in the address pool, even in non-split cases. llvm-svn: 344838
* llvm-dwarfdump: Support RLE_addressx and RLE_startx_length in .debug_rnglistsDavid Blaikie2018-10-203-22/+82
| | | | llvm-svn: 344835
* DebugInfo: Use debug_addr for non-dwo addresses in DWARF 5David Blaikie2018-10-205-22/+35
| | | | | | | | 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-193-30/+42
| | | | | | | | | | | | | 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
* [DwarfVerifier] Fixed -Wimplicit-fallthrough warningDavid Bolvansky2018-10-101-1/+2
| | | | | | | | | | | | Reviewers: JDevlieghere, RKSimon Reviewed By: JDevlieghere Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52963 llvm-svn: 344176
* [DWARF] Make llvm-dwarfdump display the .debug_loc.dwo section. Fixes PR38991.Wolfgang Pieb2018-10-091-5/+4
| | | | | | | | Reviewer: dblaikie Differential Revision: https://reviews.llvm.org/D52444 llvm-svn: 344068
* dwarfdump: Avoid parsing units unnecessarilyDavid Blaikie2018-10-051-15/+14
| | | | | | | | | NFC-ish (the parsing of the units is not a functional change - no errors/warnings are emitted during the shallow parsing - though without parsing them here, the "max version" would be wrong (still zero) later on, so in those cases the units do need to be parsed) llvm-svn: 343884
* [DebugInfo] Add support for DWARF5 call site-related attributesVedant Kumar2018-10-051-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DWARF v5 introduces DW_AT_call_all_calls, a subprogram attribute which indicates that all calls (both regular and tail) within the subprogram have call site entries. The information within these call site entries can be used by a debugger to populate backtraces with synthetic tail call frames. Tail calling frames go missing in backtraces because the frame of the caller is reused by the callee. Call site entries allow a debugger to reconstruct a sequence of (tail) calls which led from one function to another. This improves backtrace quality. There are limitations: tail recursion isn't handled, variables within synthetic frames may not survive to be inspected, etc. This approach is not novel, see: https://gcc.gnu.org/wiki/summit2010?action=AttachFile&do=get&target=jelinek.pdf This patch adds an IR-level flag (DIFlagAllCallsDescribed) which lowers to DW_AT_call_all_calls. It adds the minimal amount of DWARF generation support needed to emit standards-compliant call site entries. For easier deployment, when the debugger tuning is LLDB, the DWARF requirement is adjusted to v4. Testing: Apart from check-{llvm, clang}, I built a stage2 RelWithDebInfo clang binary. Its dSYM passed verification and grew by 1.4% compared to the baseline. 151,879 call site entries were added. rdar://42001377 Differential Revision: https://reviews.llvm.org/D49887 llvm-svn: 343883
* Revert r343317Luke Cheeseman2018-09-282-17/+10
| | | | | | - asan buildbots are breaking and I need to investigate the issue llvm-svn: 343341
* Reapply changes reverted by r343235Luke Cheeseman2018-09-282-10/+17
| | | | | | | | - Add fix so that all code paths that create DWARFContext with an ObjectFile initialise the target architecture in the context - Add an assert that the Arch is known in the Dwarf CallFrameString method llvm-svn: 343317
* Revert r343192 as an ubsan build is currently failingLuke Cheeseman2018-09-272-12/+9
| | | | llvm-svn: 343235
* Reapply changes reverted in r343114, lldb patch to follow shortlyLuke Cheeseman2018-09-272-9/+12
| | | | llvm-svn: 343192
* llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)Fangrui Song2018-09-273-4/+5
| | | | | | | | | | | | Summary: The convenience wrapper in STLExtras is available since rL342102. Reviewers: dblaikie, javed.absar, JDevlieghere, andreadb Subscribers: MatzeB, sanjoy, arsenm, dschuff, mehdi_amini, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, javed.absar, gbedwell, jrtc27, mgrang, atanasyan, steven_wu, george.burgess.iv, dexonsmith, kristina, jsji, llvm-commits Differential Revision: https://reviews.llvm.org/D52573 llvm-svn: 343163
* Revert r343112 as CallFrameString API change has broken lldb buildsLuke Cheeseman2018-09-262-12/+9
| | | | llvm-svn: 343114
* [AArch64] - Return address signing dwarf supportLuke Cheeseman2018-09-262-9/+12
| | | | | | - Reapply r343089 with a fix for DebugInfo/Sparc/gnu-window-save.ll llvm-svn: 343112
* Revert r343089 "[AArch64] - Return address signing dwarf support"Hans Wennborg2018-09-262-12/+9
| | | | | | | | | | | | | | | | | | | This caused the DebugInfo/Sparc/gnu-window-save.ll test to fail. > Functions that have signed return addresses need additional dwarf support: > - After signing the LR, and before authenticating it, the LR register is in a > state the is unusable by a debugger or unwinder > - To account for this a new directive, .cfi_negate_ra_state, is added > - This directive says the signed state of the LR register has now changed, > i.e. unsigned -> signed or signed -> unsigned > - This directive has the same CFA code as the SPARC directive GNU_window_save > (0x2d), adding a macro to account for multiply defined codes > - This patch matches the gcc implementation of this support: > https://patchwork.ozlabs.org/patch/800271/ > > Differential Revision: https://reviews.llvm.org/D50136 llvm-svn: 343103
* [AArch64] - Return address signing dwarf supportLuke Cheeseman2018-09-262-9/+12
| | | | | | | | | | | | | | | | | Functions that have signed return addresses need additional dwarf support: - After signing the LR, and before authenticating it, the LR register is in a state the is unusable by a debugger or unwinder - To account for this a new directive, .cfi_negate_ra_state, is added - This directive says the signed state of the LR register has now changed, i.e. unsigned -> signed or signed -> unsigned - This directive has the same CFA code as the SPARC directive GNU_window_save (0x2d), adding a macro to account for multiply defined codes - This patch matches the gcc implementation of this support: https://patchwork.ozlabs.org/patch/800271/ Differential Revision: https://reviews.llvm.org/D50136 llvm-svn: 343089
* [dwarfdump] Verify DW_AT_type is set and points to a compatible DIE.Jonas Devlieghere2018-09-211-0/+21
| | | | | | | | | | | | | This extends the verifier to catch three new errors: * Missing DW_AT_type attributes for DW_TAG_formal_parameter, DW_TAG_variable and DW_TAG_array_type. * Valid references for DW_AT_type pointing to a non-type tag. Differential revision: https://reviews.llvm.org/D52223 llvm-svn: 342713
* [dwarfdump] Verify compatibility of attribute TAGs.Jonas Devlieghere2018-09-212-7/+34
| | | | | | | | | Verify that DW_AT_specification and DW_AT_abstract_origin reference a DIE with a compatible tag. Differential revision: https://reviews.llvm.org/D38719 llvm-svn: 342712
* [DWARF Verifier] Add helper function to dump DIEs. [NFC]Jonas Devlieghere2018-09-191-24/+18
| | | | | | | | | It's pretty common for the verifier to dump the relevant DIE when it finds an issue. This tends to be relatively verbose and error prone because we have to pass the DIDumpOptions to the DIE's dump method. This patch adds a helper function to the verifier to make this easier. llvm-svn: 342526
* Revert "[DWARF] reposting r342048, which was reverted in r342056 due to ↵Alexander Kornienko2018-09-177-201/+221
| | | | | | | | | 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
* [DebugInfo] Remove redundant argument. [NFC]Jonas Devlieghere2018-09-171-18/+17
| | | | | | | Removes the redundant UnitType parameter from verifyUnitContents. I also fixed some formatting issues as I was touching the file. llvm-svn: 342396
* [DWARF] reposting r342048, which was reverted in r342056 due to buildbot Wolfgang Pieb2018-09-147-221/+201
| | | | | | | | errors. Adjusted 2 test cases for ARM and darwin and fixed a bug with the original change in dsymutil. llvm-svn: 342218
OpenPOWER on IntegriCloud