about summary refs log tree commit diff
path: root/src/test/debuginfo
AgeCommit message (Collapse)AuthorLines
2021-01-13Update tests for extern block lintingMark Rousskov-26/+32
2020-12-28Improvements to NatVis supportArlie Davis-10/+12
NatVis files describe how to display types in some Windows debuggers, such as Visual Studio, WinDbg, and VS Code. This commit makes several improvements: * Adds visualizers for Rc<T>, Weak<T>, and Arc<T>. * Changes [size] to [len], for consistency with the Rust API. Visualizers often use [size] to mirror the size() method on C++ STL collections. * Several visualizers used the PVOID and ULONG typedefs. These are part of the Windows API; they are not guaranteed to always be defined in a pure Rust DLL/EXE. I converted PVOID to `void*` and `ULONG` to `unsigned long`. * Cosmetic change: Removed {} braces around the visualized display for `Option` types. They now display simply as `Some(value)` or `None`, which reflects what is written in source code. * The visualizer for `alloc::string::String` makes assumptions about the layout of `String` (it casts `String*` to another type), rather than using symbolic expressions. This commit changes the visualizer so that it simply uses symbolic expressions to access the string data and string length.
2020-11-21Auto merge of #78461 - TimDiekmann:vec-alloc, r=Amanieubors-2/+2
Add support for custom allocators in `Vec` This follows the [roadmap](https://github.com/rust-lang/wg-allocators/issues/7) of the allocator WG to add custom allocators to collections. r? `@Amanieu` This pull request requires a crater run. ### Prior work: - #71873: Crater-test to solve rust-lang/wg-allocators#1 - [`alloc-wg`](https://github.com/TimDiekmann/alloc-wg)-crate
2020-11-20Auto merge of #78104 - ssomers:btree_root_redux, r=Mark-Simulacrumbors-2/+2
BTreeMap: replace Root with NodeRef<Owned, ...> `NodeRef<marker::Owned, …>` already exists as a representation of root nodes, and it makes more sense to alias `Root` to that than to reuse the space-efficient `BoxedNode` that is oblivious to height, where height is required. r? `@Mark-Simulacrum`
2020-11-19Fix debuginfo test for `Vec`Tim Diekmann-2/+2
2020-11-18BTreeMap: reuse NodeRef as Root, keep BoxedNode for edges only, ban UniqueStein Somers-2/+2
2020-11-16Add //ignore-macos to pretty-std-collections.rsest31-0/+1
On macOS the test is flaky and sometimes fails, sometimes succeeds on CI.
2020-10-14BTreeMap: improve gdb introspection of BTreeMap with ZST keys or valuesStein Somers-8/+20
2020-10-10BTreeMap: fix gdb introspection of BTreeMap with ZST keys or valuesStein Somers-5/+11
2020-09-05debuginfo: Ignore HashMap tests before cdb 10.0.18362.1MaulingMonkey-0/+4
cdb chokes on the cast and reports "Unable to find type 'tuple<u64,u64> *' for cast."
2020-08-11Revert "Suppress debuginfo on naked function arguments"Nathaniel McCallum-42/+0
This reverts commit 25670749b44a9c7a4cfd3fbf780bbe3344a9a6c5. This commit does not actually fix the problem. It merely removes the name of the argument from the LLVM output. Even without the name, Rust codegen still spills the (nameless) variable onto the stack which is the root cause. The root cause is solved in the next commit.
2020-08-08Rollup merge of #75224 - Aaron1011:fix/function-arguments-naked, r=AmanieuYuki Okushi-4/+6
Don't call a function in function-arguments-naked.rs Fixes #75096 It's U.B. to use anything other than inline assmebling in a naked function. Fortunately, the `#break` directive works fine without anything in the function body.
2020-08-07Apply `extern "C"` calling conventionAaron Hill-1/+1
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
2020-08-07Only test function-arguments-naked.rs on x86_64Aaron Hill-1/+5
We need to use inline assembly, which is inherently platform-specific.
2020-08-07Fix natvis testsAmanieu d'Antras-15/+15
2020-08-06Don't call a function in function-arguments-naked.rsAaron Hill-3/+1
Fixes #75096 It's U.B. to use anything other than inline assmebling in a naked function. Fortunately, the `#break` directive works fine without anything in the function body.
2020-08-02tests: Ignore src/test/debuginfo/rc_arc.rs on WindowsVadim Petrochenkov-0/+1
It requires loading pretty-printers, but GDB doesn't load them on Windows
2020-07-27Suppress debuginfo on naked function argumentsNathaniel McCallum-0/+40
A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes https://github.com/rust-lang/rust/issues/42779 cc https://github.com/rust-lang/rust/issues/32408
2020-07-19Add missing : after min-gdb-versionLzu Tao-5/+5
2020-06-24Modify type names on MSVC to make tuples .natvis compatible.MaulingMonkey-0/+109
- Mangles (T0, T1) as tuple<T0, T1>, possibly unblocking rust-lang/rust#70052 "Update hashbrown to 0.8.0" - Prettifies Rust tuples similar to VS2017's std::tuple - Improves debuginfo test coverage
2020-06-09Implement new gdb/lldb pretty-printersortem-302/+392
Replace old GDB and LLDB pretty-printers with new ones which were originally written for IntelliJ Rust. New LLDB pretty-printers support synthetic children. New GDB/LLDB pretty-printers support all Rust types supported by old pretty-printers, and also support: Rc, Arc, Cell, Ref, RefCell, RefMut, HashMap, HashSet.
2020-05-16`ret` has been optimized away in debuginfo testDylan MacKenzie-30/+9
2020-04-14Update the minimum external LLVM to 8Josh Stone-26/+11
LLVM 8 was released on March 20, 2019, over a year ago.
2020-03-26Test and fix gdb pretty printing againStein Somers-4/+15
2020-03-21Test pretty printing more and fix overzealous type substitutionStein Somers-2/+10
2020-03-20Fix debugger pretty printing of BTreesMark Rousskov-7/+17
2020-03-03Update testsYuki Okushi-37/+0
2020-02-16Ignore GDB versions with broken str printing.spunit262-0/+1
https://sourceware.org/bugzilla/show_bug.cgi?id=22236
2020-02-09rustc_codegen_ssa: only "spill" SSA-like values to the stack for debuginfo.Eduard-Mihai Burtescu-1/+1
2020-02-02Add a resume type parameter to `Generator`Jonas Schievink-7/+7
2020-01-07Remove legacy debuginfo testsNikita Popov-916/+0
These are no longer relevant, as our minimum supported version is LLVM 7.
2019-11-20debuginfo: Support for std::collections::Hash* in windows debuggers.MaulingMonkey-0/+97
2019-09-18fix debuginfo/issue22656 with LLDB 8Maximilian Roos-1/+1
2019-09-15use println!()Guanqun Lu-2/+2
2019-08-31Rename test locals to work around LLDB bugJoe Ranweiler-8/+8
LLDB's expression parser can't unambiguously resolve local variables in some cases, as described in #47938. Work around this by using names that don't shadow direct submodules of `core`.
2019-08-27debuginfo: always include disambiguator in type namesPhilip Craig-10/+10
2019-08-25debuginfo: give unique names to closure and generator typesPhilip Craig-0/+55
Closure types have been moved to the namespace where they are defined, and both closure and generator type names now include the disambiguator. This fixes an exception when lldb prints nested closures. Fixes #57822
2019-05-20Fix CDB support tidy check line length failures.MaulingMonkey-3/+3
2019-05-19Add basic CDB support to debuginfo compiletest s, to help catch `*.natvis` ↵MaulingMonkey-2/+59
regressions, like those fixed in #60687. Several Microsoft debuggers (VS, VS Code, WinDbg, CDB, ...) consume the `*.natvis` files we embed into rust `*.pdb` files. While this only tests CDB, that test coverage should help for all of them. CHANGES src\bootstrap - test.rs: Run CDB debuginfo tests on MSVC targets src\test\debuginfo - issue-13213.rs: CDB has trouble with this, skip for now (newly discovered regression?) - pretty-std.rs: Was ignored, re-enable for CDB only to start with, add CDB tests. - should-fail.rs: Add CDB tests. src\tools\compiletest: - Added "-cdb" option - Added Mode::DebugInfoCdb ("debuginfo-cdb") - Added run_debuginfo_cdb_test[_no_opt] - Renamed Mode::DebugInfoBoth -> DebugInfoGdbLldb ("debuginfo-gdb+lldb") since it's no longer clear what "Both" means. - Find CDB at the default Win10 SDK install path "C:\Program Files (x86)\Windows Kits\10\Debugger\*\cdb.exe" - Ignore CDB tests if CDB not found. ISSUES - `compute_stamp_hash`: not sure if there's any point in hashing `%ProgramFiles(x86)%` - `OsString` lacks any `*.natvis` entries (would be nice to add in a followup changelist) - DSTs (array/string slices) which work in VS & VS Code fail in CDB. - I've avoided `Mode::DebugInfoAll` as 3 debuggers leads to pow(2,3)=8 possible combinations. REFERENCE CDB is not part of the base Visual Studio install, but can be added via the Windows 10 SDK: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk Installing just "Debugging Tools for Windows" is sufficient. CDB appears to already be installed on appveyor CI, where this changelist can find it, based on it's use here: https://github.com/rust-lang/rust/blob/0ffc57311030a1930edfa721fe57d0000a063af4/appveyor.yml#L227 CDB commands and command line reference: https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-reference
2019-05-03Address review commentsTyler Mandry-4/+4
2019-04-25Include generator locals as field names in debuginfoTyler Mandry-4/+4
2019-04-25Make generator object debuginfo easier to readTyler Mandry-4/+4
2019-04-25Describe generator variants in debuginfoTyler Mandry-0/+68
2019-04-25Test debuginfo of different var liveness in generatorsTyler Mandry-4/+49
2019-04-23Remove unnecessary ignore-tidy-linelengthvarkor-6/+0
2019-04-22Remove double trailing newlinesvarkor-2/+0
2019-03-30Rollup merge of #59380 - philipc:thinlto-variant, r=michaelwoeristerMazdak Farrokhzad-0/+48
Fix invalid DWARF for enums when using ThinLTO We were setting the same identifier for both the DW_TAG_structure_type and the DW_TAG_variant_part. This becomes a problem when using ThinLTO becauses it uses the identifier as a key for a map of types that is used to delete duplicates based on the ODR, so one of them is deleted as a duplicate, resulting in invalid DWARF. The DW_TAG_variant_part isn't a standalone type, so it doesn't need an identifier. Fix by omitting its identifier. ODR uniquing is [enabled here](https://github.com/rust-lang/rust/blob/f21dee2c6179276321a88a63300dce74ff707e92/src/rustllvm/PassWrapper.cpp#L1101).
2019-03-27Give variant parts their own unique idPhilip Craig-1/+1
and bump llvm version in test
2019-03-23Fix invalid DWARF for enums when using thinltoPhilip Craig-0/+48
We were setting the same identifier for both the DW_TAG_structure_type and the DW_TAG_variant_part. This becomes a problem when using thinlto becauses it uses the identifier as a key for a map of types that is used to delete duplicates based on the ODR, so one of them is deleted as a duplicate, resulting in invalid DWARF. The DW_TAG_variant_part isn't a standalone type, so it doesn't need an identifier. Fix by omitting its identifier.
2019-03-22Correct minimum system LLVM version in testsSamuel Holland-8/+8
Since commit 9452a8dfa3ba, the new debug info format is only generated for LLVM 8 and newer versions. However, the tests still assume that LLVM 7 will use the new debug info format. Fix the tests (and a comment in the code) to match the actual version check.