summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [PDB] Fix another bug in globals stream name lookup.Zachary Turner2018-10-091-9/+15
| | | | | | | | When we're on the last bucket the computation is tricky. We were failing when the last bucket contained multiple matches. Added a new test for this. llvm-svn: 344081
* [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
* [PDB] Fix failure on big endian machines.Zachary Turner2018-10-091-1/+2
| | | | | | | | | | | | | | | We changed an ArrayRef<uint8_t> to an ArrayRef<uint32_t>, but it needs to be an ArrayRef<support::ulittle32_t>. We also change ArrayRef<> to FixedStreamArray<>. Technically an ArrayRef<> will work, but it can cause a copy in the underlying implementation if the memory is not contiguous, and there's no reason not to use a FixedStreamArray<>. Thanks to nemanjai@ and thakis@ for helping me track this down and confirm the fix. llvm-svn: 344063
* Remove unused variable.Zachary Turner2018-10-081-1/+0
| | | | llvm-svn: 344002
* [PDB] fix a bug in global stream name lookup.Zachary Turner2018-10-081-5/+8
| | | | | | | When we're looking up a record in the last hash bucket chain, we need to be careful with the end-offset calculation. llvm-svn: 344001
* [DebugInfo][PDB] Fix a signed/unsigned coversion warningKristina Brooks2018-10-081-1/+1
| | | | | | | | | | | | Fix the following warning when compiling with clang (caused by commit rL343951): GlobalsStream.cpp:61:33: warning: comparison of integers of different signs: 'int' and 'uint32_t' This also avoids double evaluation of `GlobalsTable.HashBuckets.size()`. llvm-svn: 343957
* Fix a -Wsign-compare warning.Zachary Turner2018-10-081-1/+1
| | | | llvm-svn: 343953
* Fix a compilation failure on non-MSVC compilers.Zachary Turner2018-10-081-1/+1
| | | | llvm-svn: 343952
* [PDB] Add the ability to lookup global symbols by name.Zachary Turner2018-10-084-7/+65
| | | | | | | | | | The Globals table is a hash table keyed on symbol name, so it's possible to lookup symbols by name in O(1) time. Add a function to the globals stream to do this, and add an option to llvm-pdbutil to exercise this, then use it to write some tests to verify correctness. llvm-svn: 343951
* 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
* [PDB] Add support for more kinds of PDB Sym Tags.Zachary Turner2018-10-011-1/+13
| | | | | | | DIA SDK is returning several new sym tag types, so we update the enumeration and printing code to support these. llvm-svn: 343547
* [codeview] Emit S_FRAMEPROC and use S_DEFRANGE_FRAMEPOINTER_RELReid Kleckner2018-10-011-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change, LLVM would always describe locals on the stack as being relative to some specific register, RSP, ESP, EBP, ESI, etc. Variables in stack memory are pretty common, so there is a special S_DEFRANGE_FRAMEPOINTER_REL symbol for them. This change uses it to reduce the size of our debug info. On top of the size savings, there are cases on 32-bit x86 where local variables are addressed from ESP, but ESP changes across the function. Unlike in DWARF, there is no FPO data to describe the stack adjustments made to push arguments onto the stack and pop them off after the call, which makes it hard for the debugger to find the local variables in frames further up the stack. To handle this, CodeView has a special VFRAME register, which corresponds to the $T0 variable set by our FPO data in 32-bit. Offsets to local variables are instead relative to this value. This is part of PR38857. Reviewers: hans, zturner, javed.absar Subscribers: aprantl, hiraditya, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D52217 llvm-svn: 343543
* [PDB] Add support for dumping Typedef records.Zachary Turner2018-10-015-0/+123
| | | | | | | | | | These work a little differently because they are actually in the globals stream and are treated as symbol records, even though DIA presents them as types. So this also adds the necessary infrastructure to cache records that live somewhere other than the TPI stream as well. llvm-svn: 343507
* [PDB] Add support for parsing VFTable Shape records.Zachary Turner2018-10-015-2/+53
| | | | | | This allows them to be returned from the native API. llvm-svn: 343506
* [PDB] Add native support for dumping array types.Zachary Turner2018-09-304-0/+75
| | | | llvm-svn: 343412
* [PDB] Better native API support for pointers.Zachary Turner2018-09-291-0/+59
| | | | | | | | | | | | We didn't properly detect when a pointer was a member pointer, and when that was the case we were not properly returning class parent info. This caused member pointers to render incorrectly in pretty mode. However, we didn't even have pretty tests for pointers in native mode, so those are also added now to ensure this. llvm-svn: 343393
* 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
* [pdb] Simplify the code by replacing a few string conversions with calls to ↵Aaron Smith2018-09-285-51/+11
| | | | | | | | | | | | invokeBstrMethod() Reviewers: aleksandr.urakov, zturner, llvm-commits Reviewed By: zturner Differential Revision: https://reviews.llvm.org/D52624 llvm-svn: 343291
* 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-276-11/+11
| | | | | | | | | | | | 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
* Add missing include.Zachary Turner2018-09-211-0/+1
| | | | llvm-svn: 342781
* [NativePDB] Add support for reading function signatures.Zachary Turner2018-09-217-30/+248
| | | | | | | This adds support for parsing function signature records and returning them through the native DIA interface. llvm-svn: 342780
* [PDB] Add native reading support for UDT / class types.Zachary Turner2018-09-2110-131/+431
| | | | | | | | | | | | This allows the native reader to find records of class/struct/ union type and dump them. This behavior is tested by using the diadump subcommand against golden output produced by actual DIA SDK on the same PDB file, and again using pretty -native to confirm that we actually dump the classes. We don't find class members or anything like that yet, for now it's just the class itself. llvm-svn: 342779
* [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
* [PDB] Fix -Wcovered-switch-default warning.Zachary Turner2018-09-201-3/+0
| | | | llvm-svn: 342681
* Fix warnings.Zachary Turner2018-09-201-1/+0
| | | | llvm-svn: 342670
* [PDB] Better printing of builtin types when using DIA dumper.Zachary Turner2018-09-203-2/+33
| | | | llvm-svn: 342658
* [PDB] Add the ability to map forward references to full decls.Zachary Turner2018-09-202-0/+133
| | | | | | | | | | | | | | | | | | | | | Some records point to an LF_CLASS, LF_UNION, LF_STRUCTURE, or LF_ENUM which is a forward reference and doesn't contain complete debug information. In these cases, we'd like to be able to quickly locate the full record. The TPI stream stores an array of pre-computed record hash values, one for each type record. If we pre-process this on startup, we can build a mapping from hash value -> {list of possible matching type indices}. Since hashes of full records are only based on the name and or unique name and not the full record contents, we can then use forward ref record to compute the hash of what *would* be the full record by just hashing the name, use this to get the list of possible matches, and iterate those looking for a match on name or unique name. llvm-pdbutil is updated to resolve forward references for the purposes of testing (plus it's just useful). Differential Revision: https://reviews.llvm.org/D52283 llvm-svn: 342656
* [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
* [PDB] Better support for enumerating pointer types.Zachary Turner2018-09-189-52/+191
| | | | | | | | | | | | | | | | | | | There were several issues with the previous implementation. 1) There were no tests. 2) We didn't support creating PDBSymbolTypePointer records for builtin types since those aren't described by LF_POINTER records. 3) We didn't support a wide enough variety of builtin types even ignoring pointers. This patch fixes all of these issues. In order to add tests, it's helpful to be able to ignore the symbol index id hierarchy because it makes the golden output from the DIA version not match our output, so I've extended the dumper to disable dumping of id fields. llvm-svn: 342493
* [PDB] Make the native reader support enumerators.Zachary Turner2018-09-176-12/+254
| | | | | | | | | | | Previously we would dump the names of enum types, but not their enumerator values. This adds support for enumerator values. In doing so, we have to introduce a general purpose mechanism for caching symbol indices of field list members. Unlike global types, FieldList members do not have a TypeIndex. So instead, we identify them by the pair {TypeIndexOfFieldList, IndexInFieldList}. llvm-svn: 342415
* [PDB] Make the native reader support modified types.Zachary Turner2018-09-175-53/+150
| | | | | | | | Previously for cv-qualified types, we would just ignore them and they would never get printed. Now we can enumerate them and cache them like any other symbol type. llvm-svn: 342414
* 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
* Give InfoStreamBuilder an opt-in method to write a hash of the PDB as GUID.Nico Weber2018-09-152-10/+34
| | | | | | | | | | | | | Naively computing the hash after the PDB data has been generated is in practice as fast as other approaches I tried. I also tried online-computing the hash as parts of the PDB were written out (https://reviews.llvm.org/D51887; that's also where all the measuring data is) and computing the hash in parallel (https://reviews.llvm.org/D51957). This approach here is simplest, without being slower. Differential Revision: https://reviews.llvm.org/D51956 llvm-svn: 342333
* [PDB] Refactor a little of the Symbol creation code.Zachary Turner2018-09-143-28/+16
| | | | | | | | | | | Eventually we need to be able to support nested types, which don't have an associated CVType record. To handle this, remove the CVType from all of the record classes, and instead store the deserialized record. Then move the deserialization up to the thing that creates the type. This actually makes error handling better anyway as we can return an invalid symbol instead of asserting false. llvm-svn: 342284
* Remove unused DIASession fieldReid Kleckner2018-09-142-3/+2
| | | | llvm-svn: 342272
* [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