summary refs log tree commit diff
path: root/src/test/debuginfo
AgeCommit message (Collapse)AuthorLines
2021-04-27Fix failed tests related to pointer printing when using GDB 10lrh2000-8/+7
As mentioned in #79009, there are four failed debuginfo test cases when using GDB 10. This commit fixes two of them, which fail because GDB 10 won't print pointers as string anymore. We can use `printf` as a workaround. It should work regardless of the version of GDB. Refer this [comment] for more details. [comment]: https://github.com/rust-lang/rust/issues/79009#issuecomment-826952708
2021-04-18Auto merge of #83799 - crlf0710:stablize_non_ascii_idents, r=Manishearthbors-2/+0
Stablize `non-ascii-idents` This is the stablization PR for RFC 2457. Currently this is waiting on fcp in [tracking issue](https://github.com/rust-lang/rust/issues/55467). r? `@Manishearth`
2021-04-08Fix closed over variables not available in debuginfo for Windows MSVCWesley Wiser-0/+91
The issue was that the resulting debuginfo was too complex for LLVM to translate into CodeView records correctly. As a result, it simply ignored the debuginfo which meant Windows debuggers could not display any closed over variables when stepping inside a closure. This fixes that by spilling additional variables to the stack so that the resulting debuginfo is simple (just `*my_variable.dbg.spill`) and LLVM can generate the correct CV records.
2021-04-08Stablize `non_ascii_idents` feature.Charles Lew-2/+0
2021-04-03Remove redundant `ignore-tidy-linelength` annotationsSimon Jakobi-47/+0
This is step 2 towards fixing #77548. In the codegen and codegen-units test suites, the `//` comment markers were kept in order not to affect any source locations. This is because these tests cannot be automatically `--bless`ed.
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