about summary refs log tree commit diff
path: root/tests/debuginfo
AgeCommit message (Collapse)AuthorLines
2025-10-02codegen: Generate `dbg_value` for the ref statementdianqk-0/+50
2025-08-29tests: Ignore basic-stepping.rs on riscv64Caiweiran-0/+1
2025-08-22Rollup merge of #145745 - heiher:ignore-basic-stepping, r=lqdJacob Pratt-0/+1
tests: Ignore basic-stepping.rs on LoongArch
2025-08-22Rollup merge of #145218 - nilptr:nilptr/feat/lldb-enum-pretty-printer, ↵Jacob Pratt-3/+3
r=Mark-Simulacrum [Debuginfo] improve enum value formatting in LLDB for better readability > TL;DR: When debugging with CodeLLDB, I noticed enum values were often hard to read because LLDB lists every possible variant, resulting in a verbose and cluttered view, even though only one variant is actually valid. Interestingly, raw enum types display nicely. After some investigation, I found that `&enum` values get classified as `Other`, so it falls back to `DefaultSyntheticProvider`, which causes this verbose output. ## What does this PR do? This PR contains 2 commits: 1. change the enum value formatting from showing 2 separate fields (`value` for attached data and `$discr$` for the discriminator) to a concise `<readable variant name>: <attached data>` format 2. dereference pointer types in `classify_rust_type` so that it can return more accurate type for reference type ## Self-test proof Before: <img width="1706" height="799" alt="before" src="https://github.com/user-attachments/assets/b66c7e22-990a-4da5-9036-34e3f9f62367" /> After: <img width="1541" height="678" alt="after" src="https://github.com/user-attachments/assets/36db32e2-f822-4883-8f17-cb8067e509f6" />
2025-08-22tests: Ignore basic-stepping.rs on LoongArchWANG Rui-0/+1
2025-08-21Rollup merge of #145297 - adwinwhite:recursive-debuginfo, r=wesleywiserJacob Pratt-0/+9
fix(debuginfo): handle false positives in overflow check Fixes rust-lang/rust#144636. Duplicate wrappers and normal recursive types can lead to false positives. ```rust struct Recursive { a: Box<Box<Recursive>>, } ``` The ADT stack can be: - `Box<Recursive>` - `Recursive` - `Box<Box<Recursive>>` (`Box` now detected as expanding) We can filter them out by tracing the generic arg back through the stack, as true expanding recursive types must have their expanding arg used as generic arg throughout. r? ````@wesleywiser````
2025-08-17feat(lldb debug info): improve enum value formatting in lldbnilptr-3/+3
2025-08-12fix(debuginfo): handle false positives in overflow checkAdwin White-0/+9
2025-08-06Revert "Embed GDB pretty printers in rlibs and dylibs"bjorn3-2/+0
This reverts commit b4d923cea0509933b1fb859930cb20784251f9be.
2025-08-06Embed GDB pretty printers in rlibs and dylibsSebastian Poeplau-0/+2
Instead of collecting pretty printers transitively when building executables/staticlibs/cdylibs, let the debugger find each crate's pretty printers via its .debug_gdb_scripts section. This covers the case where libraries defining custom pretty printers are loaded dynamically.
2025-08-04Rollup merge of #144497 - Enselic:basic-stepping, r=Mark-SimulacrumStuart Cook-0/+47
tests: Add test for basic line-by-line stepping in a debugger Let's wait with lldb testing until the test works properly with gdb. This is a regression test to prevent further regressions of https://github.com/rust-lang/rust/issues/33013 which unfortunately regressed in **nightly-2023-04-24**. See https://github.com/rust-lang/rust/issues/33013#issuecomment-3121579216.
2025-08-01Remove the omit_gdb_pretty_printer_section attributebjorn3-247/+108
Disabling loading of pretty printers in the debugger itself is more reliable. Before this commit the .gdb_debug_scripts section couldn't be included in dylibs or rlibs as otherwise there is no way to disable the section anymore without recompiling the entire standard library.
2025-07-29Verify llvm-needs-components are not empty and match the --target valueDaniel Paoliello-1/+0
2025-07-26tests: Add test for basic line-by-line stepping in a debuggerMartin Nordholts-0/+47
Let's wait with lldb testing until the test works properly with gdb.
2025-07-21Rephrase comment to include some tracking issuesJens Reidel-4/+8
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-20tests: debuginfo: Work around or disable broken tests on powerpcJens Reidel-2/+9
f16 support for PowerPC has issues in LLVM, therefore we need a small workaround to prevent LLVM from emitting symbols that don't exist for PowerPC yet. It also appears that unused by-value non-immedate issue with gdb applies to PowerPC targets as well, though I've only tested 64-bit Linux targets. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-06-16tests: `{Meta,Pointee}Sized` in non-minicore testsDavid Wood-6/+8
As before, add `MetaSized` and `PointeeSized` traits to all of the non-minicore `no_core` tests so that they don't fail for lack of language items.
2025-06-09tests: Change "fastcall" to "system" in some testsJubilee Young-2/+2
Lets the test still work on different architectures.
2025-05-29Rollup merge of #138285 - beetrees:repr128-stable, r=traviscross,bjorn3Jacob Pratt-2/+0
Stabilize `repr128` ## Stabilisation report The `repr128` feature ([tracking issue](https://github.com/rust-lang/rust/issues/56071)) allows the use of `#[repr(u128)]` and `#[repr(i128)]` on enums in the same way that other primitive representations such as `#[repr(u64)]` can be used. For example: ```rust #[repr(u128)] enum Foo { One = 1, Two, Big = u128::MAX, } #[repr(i128)] enum Bar { HasThing(u16) = 42, HasSomethingElse(i64) = u64::MAX as i128 + 1, HasNothing, } ``` This is the final part of adding 128-bit integers to Rust ([RFC 1504](https://rust-lang.github.io/rfcs/1504-int128.html)); all other parts of 128-bit integer support were stabilised in #49101 back in 2018. From a design perspective, `#[repr(u128)]`/`#[repr(i128)]` function like `#[repr(u64)]`/`#[repr(i64)]` but for 128-bit integers instead of 64-bit integers. The only differences are: - FFI safety: as `u128`/`i128` are not currently considered FFI safe, neither are `#[repr(u128)]`/`#[repr(i128)]` enums (I discovered this wasn't the case while drafting this stabilisation report, so I have submitted #138282 to fix this). - Debug info: while none of the major debuggers currently support 128-bit integers, as of LLVM 20 `rustc` will emit valid debuginfo for both DWARF and PDB (PDB makes use of the same natvis that is also used for all enums with fields, whereas DWARF has native support). Tests for `#[repr(u128)]`/`#[repr(i128)]` enums include: - [ui/enum-discriminant/repr128.rs](https://github.com/rust-lang/rust/blob/385970f0c1fd0c09bac426b02f38300c0b1ba9a2/tests/ui/enum-discriminant/repr128.rs): checks that 128-bit enum discriminants have the correct values. - [debuginfo/msvc-pretty-enums.rs](https://github.com/rust-lang/rust/blob/385970f0c1fd0c09bac426b02f38300c0b1ba9a2/tests/debuginfo/msvc-pretty-enums.rs): checks the PDB debuginfo is correct. - [run-make/repr128-dwarf](https://github.com/rust-lang/rust/blob/385970f0c1fd0c09bac426b02f38300c0b1ba9a2/tests/run-make/repr128-dwarf/rmake.rs): checks the DWARF debuginfo is correct. Stabilising this feature does not require any changes to the Rust Reference as [the documentation on primitive representations](https://doc.rust-lang.org/nightly/reference/type-layout.html#r-layout.repr.primitive.intro) already includes `u128` and `i128`. Closes #56071 Closes https://github.com/rust-lang/reference/issues/1368 r? lang ```@rustbot``` label +I-lang-nominated +T-lang
2025-05-28Stabilise `repr128`beetrees-2/+0
2025-05-26ci: move tests from x86_64-gnu-llvm-19 job to aarch64MarcoIeni-0/+1
2025-05-22Use the fn_span when emitting function calls for better debug info.Kyle Huey-0/+35
This especially improves the developer experience for long chains of function calls that span multiple lines, which is common with builder patterns, chains of iterator/future combinators, etc.
2025-05-07[win][arm64] Disable various DebugInfo tests that don't work on Arm64 WindowsDaniel Paoliello-0/+6
2025-04-18Rollup merge of #138599 - adwinwhite:recursive-overflow, r=wesleywiserMatthias Krüger-1/+58
avoid overflow when generating debuginfo for expanding recursive types Fixes #135093 Fixes #121538 Fixes #107362 Fixes #100618 Fixes #115994 The overflow happens because expanding recursive types keep creating new nested types when recurring into sub fields. I fixed that by returning an empty stub node when expanding recursion is detected.
2025-04-17tests: refine disable reason for `tests/debuginfo/drop-locations.rs`Jieyou Xu-1/+3
2025-04-10replace `//@ compile-flags: --edition` with `//@ edition`Pietro Albini-1/+2
2025-03-17(re)move fixed crash testsAdwin White-0/+42
2025-03-17fix(debuginfo): avoid overflow when handling expanding recursive typeAdwin White-1/+16
2025-03-11Rollup merge of #137967 - mustartt:fix-aix-test-hangs, r=workingjubileeJakub Beránek-0/+1
[AIX] Fix hangs during testing Fixes all current test hangs experienced during CI runs. 1. ipv6 link-local (the loopback device) gets assigned an automatic zone id of 1, causing the assert to fail and hang in `library/std/src/net/udp/tests.rs` 2. Const alloc does not fail gracefully 3. Debuginfo test has problem with gdb auto load safe path
2025-03-04Fix test hangs on AIXHenry Jiang-0/+1
2025-02-27Delete tuple unsizingAlice Ryhl-21/+0
2025-02-23Rollup merge of #135354 - Walnut356:msvc_lldb, r=wesleywiserJacob Pratt-4/+5
[Debuginfo] Add MSVC Synthetic and Summary providers to LLDB Adds handling for `tuple$<>`, `ref$<slice$2<>`, `ref$<str$>` and `enum2$<>`. Also fixes a bug in MSVC vec/string handling where the script was unable to determine the element's type due to LLDB ignoring template arg debug information <details> <summary>Sample code</summary> ```rust pub enum Number { One = 57, Two = 99, } #[repr(u8)] pub enum Container { First(u32), Second { val: u64, val2: i8 }, Third, } ... let u8_val = b'a'; let float = 42.78000000000001; let tuple = (u8_val, float); let str_val = "eef"; let mut string = "freef".to_owned(); let mut_str = string.as_mut_str(); let array: [u8; 4] = [1, 2, 3, 4]; let ref_array = array.as_slice(); let mut array2: [u32; 4] = [1, 2, 3, 4]; let mut_array = array2.as_mut_slice(); let enum_val = Number::One; let mut enum_val2 = Number::Two; let sum_val = Container::First(15); let sum_val_2 = Container::Second { val: 0, val2: 0 }; let sum_val_3 = Container::Third; let non_zero = NonZeroU128::new(100).unwrap(); let large_discr = NonZeroU128::new(255); ``` </details> Before: ![image](https://github.com/user-attachments/assets/19fd0881-a4c3-4c68-b28f-769a67d95e35) After: ![image](https://github.com/user-attachments/assets/d0479035-17ed-4584-8eb4-71d1314f8f7c) try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: x86_64-mingw-1 try-job: i686-mingw try-job: aarch64-gnu
2025-02-12fix string and tuple struct formattingWalnut-4/+5
2025-01-14Revert "Remove the Arc rt::init allocation for thread info"joboet-4/+4
This reverts commit 0747f2898e83df7e601189c0f31762e84328becb.
2025-01-13Auto merge of #135192 - jdupak-ms:cdb-tests, r=wesleywiserbors-49/+294
Add and improve debuginfo tests for Windows Adds new test for closures and function pointers. Improves robustness of existing tests by sorting wildcard matched outputs. try-job: i686-msvc
2025-01-13Add and improve debuginfo tests for WindowsJakub Dupak-49/+294
2025-01-09Update a bunch of library types for MCP807Scott McMurray-1/+1
This greatly reduces the number of places that actually use the `rustc_layout_scalar_valid_range_*` attributes down to just 3: ``` library/core\src\ptr\non_null.rs 68:#[rustc_layout_scalar_valid_range_start(1)] library/core\src\num\niche_types.rs 19: #[rustc_layout_scalar_valid_range_start($low)] 20: #[rustc_layout_scalar_valid_range_end($high)] ``` Everything else -- PAL Nanoseconds, alloc's `Cap`, niched FDs, etc -- all just wrap those `niche_types` types.
2025-01-02Move some things to `std::sync::poison` and reexport them in `std::sync`Pavel Grigorenko-7/+7
2024-12-22Begin to implement type system layer of unsafe bindersMichael Goulet-1/+1
2024-12-04Reformat Python code with `ruff`Jakub Beránek-0/+9
2024-11-17Mark `numeric-types.rs` as 64-bit only for nowJieyou Xu-2/+5
This is to unblock the tree, a proper fix will need to be investigated. I think the debuginfo test suite supports revisions, however debugger directives do not respect such revisions, which is problematic. It's that 32-bit and 64-bit msvc of course have different integer widths for `isize` and `usize`, meaning their underlying integer is different and thus printed differently.
2024-11-17Update cdb annotations for `unit-type.rs` with cdb `10.0.26100.2161`Jieyou Xu-4/+7
2024-11-17Update cdb annotations for `range-types.rs` with cdb `10.0.26100.2161`Jieyou Xu-7/+13
2024-11-17Update cdb annotations for `numeric-types` with cdb `10.0.26100.2161`Jieyou Xu-29/+32
2024-10-24Auto merge of #123550 - GnomedDev:remove-initial-arc, r=Noratriebbors-4/+4
Remove the `Arc` rt::init allocation for thread info Removes an allocation pre-main by just not storing anything in std::thread::Thread for the main thread. - The thread name can just be a hard coded literal, as was done in #123433. - Storing ThreadId and Parker in a static that is initialized once at startup. This uses SyncUnsafeCell and MaybeUninit as this is quite performance critical and we don't need synchronization or to store a tag value and possibly leave in a panic.
2024-10-21Auto merge of #131570 - ehuss:update-xcode, r=Mark-Simulacrumbors-3/+3
(ci) Update macOS Xcode to 15 This updates the macOS builders to Xcode 15. The aarch64 images will be removing Xcode 14 and 16 very soon (https://github.com/actions/runner-images/issues/10703), so we will need to make the switch to continue operating. The linked issue also documents GitHub's new policy for how they will be updating Xcode in the future. Also worth being aware of is the future plans for x86 runners documented in https://github.com/actions/runner-images/issues/9255 and https://github.com/actions/runner-images/issues/10686, which will impact our future upgrade behaviors. I decided to also update the Xcode in the x86_64 runners, even though they are not being removed. It felt better to me to have all macOS runners on the same (major) version of Xcode. However, note that the x86_64 runners do not have the latest version of 15 (15.4), so I left them at 15.2 (which is currently the default Xcode of the runner). Xcode 15 was previously causing problems (see #121058) which seem to be resolved now. `@bjorn3` fixed the `invalid r_symbolnum` issue with cranelift. The issue with clang failing to link seems to be fixed, possibly by the update of the pre-built LLVM from 14 to llvm 15 in https://github.com/rust-lang/rust/pull/124850, or an update in our source version of LLVM. I have run some try builds and at least LLVM seems to build (I did not run any tests). Closes #121058
2024-10-21Update debuginfo test for newer lldbEric Huss-3/+3
For reasons I don't understand, lldb in Xcode 15 no longer prints objects as: (long) $0 = 19 instead, it is printing them as: (long) 19
2024-10-19Remove the Arc rt::init allocation for thread infoGnomedDev-4/+4
2024-10-15Rollup merge of #131521 - jdonszelmann:rc, r=joboetMichael Goulet-2/+1
rename RcBox to RcInner for consistency Arc uses ArcInner too (created in collaboration with `@aDotInTheVoid` and `@WaffleLapkin` )
2024-10-12Rollup merge of #128784 - tdittr:check-abi-on-fn-ptr, r=compiler-errorsMatthias Krüger-2/+2
Check ABI target compatibility for function pointers Tracking issue: https://github.com/rust-lang/rust/issues/130260 Related tracking issue: #87678 Compatibility of an ABI for a target was previously only performed on function definitions and `extern` blocks. This PR adds it also to function pointers to be consistent. This might have broken some of the `tests/ui/` depending on the platform, so a try run seems like a good idea. Also this might break existing code, because we now emit extra errors. Does this require a crater run? # Example ```rust // build with: --target=x86_64-unknown-linux-gnu // These raise E0570 extern "thiscall" fn foo() {} extern "thiscall" { fn bar() } // This did not raise any error fn baz(f: extern "thiscall" fn()) { f() } ``` # Open Questions * [x] Should this report a future incompatibility warning like #87678 ? * [ ] Is this the best place to perform the check?