summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "X86, AArch64, ARM: Do not attach debug location to spill/reload ↵Matt Morehouse2018-10-022-3/+2
| | | | | | | | instructions" This reverts r343520 due to breakage of HWASan tests on Android. llvm-svn: 343616
* [codeview] Fix 32-bit x86 variable locations in realigned stack framesReid Kleckner2018-10-022-2/+231
| | | | | | | | | | | | | | | | | | Add the .cv_fpo_stackalign directive so that we can define $T0, or the VFRAME virtual register, with it. This was overlooked in the initial implementation because unlike MSVC, we push CSRs before allocating stack space, so this value is only needed to describe local variable locations. Variables that the compiler now addresses via ESP are instead described as being stored at offsets from VFRAME, which for us is ESP after alignment in the prologue. This adds tests that show that we use the VFRAME register properly in our S_DEFRANGE records, and that we emit the correct FPO data to define it. Fixes PR38857 llvm-svn: 343603
* [codeview] Emit S_FRAMEPROC and use S_DEFRANGE_FRAMEPOINTER_RELReid Kleckner2018-10-0110-68/+784
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* X86, AArch64, ARM: Do not attach debug location to spill/reload instructionsMatthias Braun2018-10-012-2/+3
| | | | | | | | | | | Spill/reload instructions are artificially generated by the compiler and have no relation to the original source code. So the best thing to do is not attach any debug location to them (instead of just taking the next debug location we find on following instructions). Differential Revision: https://reviews.llvm.org/D52125 llvm-svn: 343520
* [PDB] Add support for dumping Typedef records.Zachary Turner2018-10-011-0/+33
| | | | | | | | | | 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 native support for dumping array types.Zachary Turner2018-09-302-0/+37
| | | | llvm-svn: 343412
* [PDB] Fix this test for real.Zachary Turner2018-09-301-1/+1
| | | | | | | I was able to test this fix on an actual Windows machine so this should get the bot green again. llvm-svn: 343400
* Only dump the types we need in the test.Zachary Turner2018-09-301-1/+1
| | | | | | | | | We added support for dumping pointers but pointers to arrays won't correctly dump until we add support for dumping arrays. Instead of trying to dump everything, which this test isn't even interested in, just dump enums and typedefs. llvm-svn: 343398
* [PDB] Better native API support for pointers.Zachary Turner2018-09-291-3/+36
| | | | | | | | | | | | 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
* [DebugInfo] Do not generate address info for removed debug labels.Hsiangkai Wang2018-09-261-0/+39
| | | | | | | | | | | | | | | In some senario, LLVM will remove llvm.dbg.labels in IR. For example, when the labels are in unreachable blocks, these labels will not be generated in LLVM IR. In the case, these debug labels will have address zero as their address. It is not legal address for debugger to set breakpoints or query sources. So, the patch inhibits the address info (DW_AT_low_pc) of removed labels. Fix build failed in BuildBot, clang-stage1-cmake-RA-incremental, on macOS. Differential Revision: https://reviews.llvm.org/D51908 llvm-svn: 343062
* [WebAssembly] Move/clone DBG_VALUE during WebAssemblyRegStackify passYury Delendik2018-09-252-0/+215
| | | | | | | | | | | | | | | | | | Summary: The MoveForSingleUse or MoveAndTeeForMultiUse functions move wasm instructions, however DBG_VALUE stay unchanged -- moving or cloning these. Reviewers: dschuff Reviewed By: dschuff Subscribers: mattd, MatzeB, dschuff, sbc100, jgravelle-google, aheejin, sunfish, llvm-commits, aardappel Tags: #debug-info Differential Revision: https://reviews.llvm.org/D49034 llvm-svn: 343007
* Revert "[DebugInfo] Do not generate address info for removed debug labels."Justin Bogner2018-09-251-39/+0
| | | | | | | | | | The added test is failing on macOS: http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/53550/ This reverts r342943. llvm-svn: 342993
* [DebugInfo] Do not generate address info for removed debug labels.Hsiangkai Wang2018-09-251-0/+39
| | | | | | | | | | | | | In some senario, LLVM will remove llvm.dbg.labels in IR. For example, when the labels are in unreachable blocks, these labels will not be generated in LLVM IR. In the case, these debug labels will have address zero as their address. It is not legal address for debugger to set breakpoints or query sources. So, the patch inhibits the address info (DW_AT_low_pc) of removed labels. Differential Revision: https://reviews.llvm.org/D51908 llvm-svn: 342943
* [NativePDB] Add support for reading function signatures.Zachary Turner2018-09-213-0/+945
| | | | | | | 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-211-0/+539
| | | | | | | | | | | | 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
* [PDB] Add the ability to map forward references to full decls.Zachary Turner2018-09-205-4/+167
| | | | | | | | | | | | | | | | | | | | | 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] - Emit the correct value for DW_AT_addr_base.George Rimar2018-09-203-1/+3
| | | | | | | | | | | | | | Currently, we emit DW_AT_addr_base that points to the beginning of the .debug_addr section. That is not correct for the DWARF5 case because address table contains the header and the attribute should point to the first entry following the header. This is currently the reason why LLDB does not work with such executables correctly. Patch fixes the issue. Differential revision: https://reviews.llvm.org/D52168 llvm-svn: 342635
* [WEB] add new flags to a DebugInfo lit testMichael Berg2018-09-191-1/+1
| | | | llvm-svn: 342598
* [X86] Handle COPYs of physregs better (regalloc hints)Simon Pilgrim2018-09-194-13/+14
| | | | | | | | | | | | | | Enable enableMultipleCopyHints() on X86. Original Patch by @jonpa: While enabling the mischeduler for SystemZ, it was discovered that for some reason a test needed one extra seemingly needless COPY (test/CodeGen/SystemZ/call-03.ll). The handling for that is resulted in this patch, which improves the register coalescing by providing not just one copy hint, but a sorted list of copy hints. On SystemZ, this gives ~12500 less register moves on SPEC, as well as marginally less spilling. Instead of improving just the SystemZ backend, the improvement has been implemented in common-code (calculateSpillWeightAndHint(). This gives a lot of test failures, but since this should be a general improvement I hope that the involved targets will help and review the test updates. Differential Revision: https://reviews.llvm.org/D38128 llvm-svn: 342578
* [PDB] Better support for enumerating pointer types.Zachary Turner2018-09-185-54/+458
| | | | | | | | | | | | | | | | | | | 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-173-246/+1022
| | | | | | | | | | | 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-171-0/+25
| | | | | | | | 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-175-57/+23
| | | | | | | | | 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
* [PDB] Make the pretty dumper output modified types.Zachary Turner2018-09-145-216/+249
| | | | | | | | | | | Currently if we got something like `const Foo` we'd ignore it and just rely on printing the unmodified `Foo` later on. However, for testing the native reading code we really would like to be able to see these so that we can verify that the native reader can actually handle them. Instead of printing out the full type though, just print out the header. llvm-svn: 342295
* Fix debug info for SelectionDAG legalization of DAG nodes with two results.Adrian Prantl2018-09-141-0/+47
| | | | | | | | | | | | | | | | This patch fixes the debug info handling for SelectionDAG legalization of DAG nodes with two results. When an replaced SDNode has more than one result, transferDbgValues was always copying the SDDbgValue from the first result and attaching them to all members. In reality SelectionDAG::ReplaceAllUsesWith() is given an array of SDNodes (though the type signature doesn't make this obvious (cf. the call site code in ReplaceNode()). rdar://problem/44162227 Differential Revision: https://reviews.llvm.org/D52112 llvm-svn: 342264
* [DWARF] reposting r342048, which was reverted in r342056 due to buildbot Wolfgang Pieb2018-09-145-23/+57
| | | | | | | | errors. Adjusted 2 test cases for ARM and darwin and fixed a bug with the original change in dsymutil. llvm-svn: 342218
* [MC/Dwarf] Unclamp DWARF linetables format on Darwin.Jonas Devlieghere2018-09-132-4/+4
| | | | | | | | | | | In r319995, we fixed the line table format to version 2 on Darwin because dsymutil didn't yet understand the new format which caused test failures for the LLDB bots. This has been resolved in the meantime so there's no reason to keep this limitation. rdar://problem/35968332 llvm-svn: 342136
* Reverting r342048, which caused UBSan failures in dsymutil.Wolfgang Pieb2018-09-125-57/+23
| | | | llvm-svn: 342056
* [DWARF] Refactoring range list dumping to fold DWARF v4 functionality into ↵Wolfgang Pieb2018-09-125-23/+57
| | | | | | | | | | | | | 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
* [codeview] Decode and dump FP regs from S_FRAMEPROC recordsReid Kleckner2018-09-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There are two registers encoded in the S_FRAMEPROC flags: one for locals and one for parameters. The encoding is described by the ExpandEncodedBasePointerReg function in cvinfo.h. Two bits are used to indicate one of four possible values: 0: no register - Used when there are no variables. 1: SP / standard - Variables are stored relative to the standard SP for the ISA. 2: FP - Variables are addressed relative to the ISA frame pointer, i.e. EBP on x86. If realignment is required, parameters use this. If a dynamic alloca is used, locals will be EBP relative. 3: Alternative - Variables are stored relative to some alternative third callee-saved register. This is required to address highly aligned locals when there are dynamic stack adjustments. In this case, both the incoming SP saved in the standard FP and the current SP are at some dynamic offset from the locals. LLVM uses ESI in this case, MSVC uses EBX. Most of the changes in this patch are to pass around the CPU so that we can decode these into real, named architectural registers. Subscribers: hiraditya Differential Revision: https://reviews.llvm.org/D51894 llvm-svn: 341999
* llvm-symbolizer: Fix bug related to TUs interfering with symbolizingDavid Blaikie2018-09-112-0/+8
| | | | | | | | | | | With the merge of TUs and CUs into a single container, some code that relied on the CU range having an ordered range of contiguous addresses (for locating a CU at a given offset) broke. But the units from debug_info (currently only CUs, but CUs and TUs in DWARFv5) are in a contiguous sub-range of that container - searching only through that subrange is still valid & so do that. llvm-svn: 341889
* AMDGPU: Fix tests using old number for constant address spaceMatt Arsenault2018-09-101-3/+3
| | | | llvm-svn: 341770
* Fix some of the PDB tests.Zachary Turner2018-09-071-4/+4
| | | | | | | | They were unintentionally calling DIA directly, which requires Windows. We need to pass the -native flag, and this then required fixing up one or two tests. llvm-svn: 341731
* [PDB] Support pointer types in the native reader.Zachary Turner2018-09-072-0/+238
| | | | | | | | | | In order to start testing this, I've added a new mode to llvm-pdbutil which is only really useful for writing tests. It just dumps the value of raw fields in record format. This isn't really ideal and it won't allow us to test some important cases, but it's better than nothing for now. llvm-svn: 341729
* [codeview] Improve readobj FPO dumper and pdbutil register namesReid Kleckner2018-09-072-24/+160
| | | | | | The improved dumping helps me investigate PR38857. llvm-svn: 341695
* [DebugInfo] Handle stack slot offsets for spilled sub-registers in LDVDavid Stenberg2018-09-071-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Extend LDV so that stack slot offsets for spilled sub-registers are added to the emitted debug locations. This is accomplished by querying InstrInfo::getStackSlotRange(). With this change, LDV will add a DW_OP_plus_uconst operation to the expression if a sub-register is spilled. Later on, PEI will add an offset operation for the stack slot, meaning that we will get expressions of the forms: * {DW_OP_constu #fp-offset, DW_OP_minus, DW_OP_plus_uconst #subreg-offset} * {DW_OP_plus_const #fp-offset, DW_OP_minus, DW_OP_plus_uconst #subreg-offset} The two offset operations should ideally be merged. Reviewers: rnk, aprantl, stoklund Reviewed By: aprantl Subscribers: dblaikie, bjope, nemanjai, JDevlieghere, llvm-commits Tags: #debug-info Differential Revision: https://reviews.llvm.org/D51612 llvm-svn: 341659
* [DebugInfo] Do not generate label debug info if it has been processed.Hsiangkai Wang2018-09-061-1/+3
| | | | | | | | In DwarfDebug::collectEntityInfo(), if the label entity is processed in DbgLabels list, it means the label is not optimized out. There is no need to generate debug info for it with null position. llvm-svn: 341513
* [DebugInfo] Normalize common kinds of DWARF sub-expressions.Jonas Devlieghere2018-09-0512-41/+40
| | | | | | | | | | | | Normalize common kinds of DWARF sub-expressions to make debug info encoding a bit more compact: DW_OP_constu [X < 32] -> DW_OP_litX DW_OP_constu [all ones] -> DW_OP_lit0, DW_OP_not (64-bit only) Differential revision: https://reviews.llvm.org/D51640 llvm-svn: 341457
* [DebugInfo] Fix bug in LiveDebugVariables.Hsiangkai Wang2018-09-051-0/+53
| | | | | | | | | | | | | | | In lib/CodeGen/LiveDebugVariables.cpp, it uses std::prev(MBBI) to get DebugValue's SlotIndex. However, the previous instruction may be also a debug instruction. It could not use a debug instruction to query SlotIndex in mi2iMap. Scan all debug instructions and use the first debug instruction to query SlotIndex for following debug instructions. Only handle DBG_VALUE in handleDebugValue(). Differential Revision: https://reviews.llvm.org/D50621 llvm-svn: 341446
* Revert "[DebugInfo] Fix bug in LiveDebugVariables."Hsiangkai Wang2018-09-021-51/+0
| | | | | | | | | This reverts commit 8f548ff2a1819e1bc051e8218584f1a3d2cf178a. buildbot failure in LLVM on clang-ppc64be-linux http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/19765 llvm-svn: 341290
* [DebugInfo] Fix bug in LiveDebugVariables.Hsiangkai Wang2018-09-021-0/+51
| | | | | | | | | | | | | | | In lib/CodeGen/LiveDebugVariables.cpp, it uses std::prev(MBBI) to get DebugValue's SlotIndex. However, the previous instruction may be also a debug instruction. It could not use a debug instruction to query SlotIndex in mi2iMap. Scan all debug instructions and use the first debug instruction to query SlotIndex for following debug instructions. Only handle DBG_VALUE in handleDebugValue(). Differential Revision: https://reviews.llvm.org/D50621 llvm-svn: 341289
* [DebugInfo] Common behavior for error typesAlexandre Ganea2018-08-312-2/+2
| | | | | | | | | | | | | | | Following D50807, and heading towards D50664, this intermediary change does the following: 1. Upgrade all custom Error types in llvm/trunk/lib/DebugInfo/ to use the new StringError behavior (D50807). 2. Implement std::is_error_code_enum and make_error_code() for DebugInfo error enumerations. 3. Rename GenericError -> PDBError (the file will be renamed in a subsequent commit) 4. Update custom error messages to follow the same formatting: (\w\s*)+\. 5. Keep generic "file not found" (ENOENT) errors as they are in PDB code. Previously, there used to be a custom enumeration for that purpose. 6. Remove a few extraneous LF in log() implementations. Printing LF is a responsability at a higher level, not at the error level. Differential Revision: https://reviews.llvm.org/D51499 llvm-svn: 341228
* [codeview] Clean up machinery for deferring .cv_loc emissionReid Kleckner2018-08-287-11/+11
| | | | | | | | | | | Now that we create the label at the point of the directive, we don't need to set the "current CV location", and then later when we emit the next instruction, create a label for it and emit it. DWARF still defers the labels used in .debug_loc until the next instruction or value, for reasons unknown. llvm-svn: 340883
* Clarify comment in the string-offsets-table-order.ll testPavel Labath2018-08-281-1/+3
| | | | llvm-svn: 340826
* DebugInfo: Fix skipping CUs in DWARFv5 debug_names tableDavid Blaikie2018-08-241-27/+45
| | | | | | | | | | My previoust test case had skipped CUs from one TU out of a two-TU LTO scenario, which meant the CU index wasn't needed (as it was unambiguous which CU a table entry applied to) - expanding the test to use 3 TUs, skipping one (so long as it's not the last one) shows the indexes are miscomputed. Fix that with a little indirection for the index. llvm-svn: 340646
* DebugInfo: Improve debug location mergingDavid Blaikie2018-08-232-1/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a set of related bugs: * Considering two locations as equivalent when their lines are the same but their scopes are different causes erroneous debug info that attributes a commoned call to be attributed to one of the two calls it was commoned from. * The previous code to compute a new location's scope was inaccurate and would use the inlinedAt that was the /parent/ of the inlinedAt that is the nearest common one, and also used that parent scope instead of the nearest common scope. * Not generating new locations generally seemed like a lower quality choice There was some risk that generating more new locations could hurt object size by making more fine grained line table entries, but it looks like that was offset by the decrease in line table (& address & ranges) size caused by more accurately computing the scope - which likely lead to fewer range entries (more contiguous ranges) & reduced size that way. All up with these changes I saw minor reductions (-1.21%, -1.77%) in .rela.debug_ranges and .rela.debug_addr (in a fission, compressed debug info build) as well as other minor size changes (generally reductinos) across the board (-1.32% debug_info.dwo, -1.28% debug_loc.dwo). Measured in an optimized (-O2) build of the clang binary. If you are investigating a size regression in an optimized debug builds, this is certainly a patch to look into - and I'd be happy to look into any major regressions found & see what we can do to address them. llvm-svn: 340583
* Revert r340508: [DebugInfo] Fix bug in LiveDebugVariables.Chandler Carruth2018-08-231-59/+0
| | | | | | | | This patch's test case relies on debug prints which isn't generally an OK way to test stuff in LLVM and fails whenever asserts aren't enabled. I've send a heads-up to the commit and detailed comments on the review. llvm-svn: 340513
* [DebugInfo] Fix bug in LiveDebugVariables.Hsiangkai Wang2018-08-231-0/+59
| | | | | | | | | | | | | | | In lib/CodeGen/LiveDebugVariables.cpp, it uses std::prev(MBBI) to get DebugValue's SlotIndex. However, the previous instruction may be also a debug instruction. It could not use a debug instruction to query SlotIndex in mi2iMap. Scan all debug instructions and use the first debug instruction to query SlotIndex for following debug instructions. Only handle DBG_VALUE in handleDebugValue(). Differential Revision: https://reviews.llvm.org/D50621 llvm-svn: 340508
* Avoid dbg.value use-before-def in a few tests (NFC)Vedant Kumar2018-08-213-7/+7
| | | | | | | | | | This is preparation for landing a use-before-def verifier for debug intrinsics (D46100). As a drive-by, remove `tail` from debug intrinsic calls because it doesn't mean anything in that context. llvm-svn: 340366
* Update DBG_VALUE register operand during LiveInterval operationsYury Delendik2018-08-211-0/+110
| | | | | | | | | | | | | | | | | | | Summary: Handling of DBG_VALUE in ConnectedVNInfoEqClasses::Distribute() was fixed in PR16110. However DBG_VALUE register operands are not getting updated. This patch properly resolves the value location. Reviewers: MatzeB, vsk Reviewed By: MatzeB Subscribers: kparzysz, thegameg, vsk, MatzeB, dschuff, sbc100, jgravelle-google, aheejin, sunfish, llvm-commits Tags: #debug-info Differential Revision: https://reviews.llvm.org/D48994 llvm-svn: 340310
OpenPOWER on IntegriCloud