about summary refs log tree commit diff
path: root/tests/debuginfo
AgeCommit message (Collapse)AuthorLines
2025-07-29Verify llvm-needs-components are not empty and match the --target valueDaniel Paoliello-1/+0
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?
2024-10-11rename RcBox in other places tooJonathan Dönszelmann-2/+1
2024-09-23Check ABI target compatibility for function pointersTamme Dittrich-2/+2
This check was previously only performed on functions not function pointers. Co-authored-by: Folkert <folkert@folkertdev.nl>
2024-09-17Reorder stack spills so that constants come later.Kyle Huey-0/+35
Currently constants are "pulled forward" and have their stack spills emitted first. This confuses LLVM as to where to place breakpoints at function entry, and results in argument values being wrong in the debugger. It's straightforward to avoid emitting the stack spills for constants until arguments/etc have been introduced in debug_introduce_locals, so do that. Example LLVM IR (irrelevant IR elided): Before: define internal void @_ZN11rust_1289457binding17h2c78f956ba4bd2c3E(i64 %a, i64 %b, double %c) unnamed_addr #0 !dbg !178 { start: %c.dbg.spill = alloca [8 x i8], align 8 %b.dbg.spill = alloca [8 x i8], align 8 %a.dbg.spill = alloca [8 x i8], align 8 %x.dbg.spill = alloca [4 x i8], align 4 store i32 0, ptr %x.dbg.spill, align 4, !dbg !192 ; LLVM places breakpoint here. #dbg_declare(ptr %x.dbg.spill, !190, !DIExpression(), !192) store i64 %a, ptr %a.dbg.spill, align 8 #dbg_declare(ptr %a.dbg.spill, !187, !DIExpression(), !193) store i64 %b, ptr %b.dbg.spill, align 8 #dbg_declare(ptr %b.dbg.spill, !188, !DIExpression(), !194) store double %c, ptr %c.dbg.spill, align 8 #dbg_declare(ptr %c.dbg.spill, !189, !DIExpression(), !195) ret void, !dbg !196 } After: define internal void @_ZN11rust_1289457binding17h2c78f956ba4bd2c3E(i64 %a, i64 %b, double %c) unnamed_addr #0 !dbg !178 { start: %x.dbg.spill = alloca [4 x i8], align 4 %c.dbg.spill = alloca [8 x i8], align 8 %b.dbg.spill = alloca [8 x i8], align 8 %a.dbg.spill = alloca [8 x i8], align 8 store i64 %a, ptr %a.dbg.spill, align 8 #dbg_declare(ptr %a.dbg.spill, !187, !DIExpression(), !192) store i64 %b, ptr %b.dbg.spill, align 8 #dbg_declare(ptr %b.dbg.spill, !188, !DIExpression(), !193) store double %c, ptr %c.dbg.spill, align 8 #dbg_declare(ptr %c.dbg.spill, !189, !DIExpression(), !194) store i32 0, ptr %x.dbg.spill, align 4, !dbg !195 ; LLVM places breakpoint here. #dbg_declare(ptr %x.dbg.spill, !190, !DIExpression(), !195) ret void, !dbg !196 } Note in particular the position of the "LLVM places breakpoint here" comment relative to the stack spills for the function arguments. LLVM assumes that the first instruction with with a debug location is the end of the prologue. As LLVM does not currently offer front ends any direct control over the placement of the prologue end reordering the IR is the only mechanism available to fix argument values at function entry in the presence of MIR optimizations like SingleUseConsts. Fixes #128945
2024-09-13Auto merge of #130052 - khuey:clear-dilocation-after-const-emission, ↵bors-0/+72
r=michaelwoerister Don't leave debug locations for constants sitting on the builder indefinitely Because constants are currently emitted *before* the prologue, leaving the debug location on the IRBuilder spills onto other instructions in the prologue and messes up both line numbers as well as the point LLVM chooses to be the prologue end. Example LLVM IR (irrelevant IR elided): Before: ``` define internal { i64, i64 } `@_ZN3tmp3Foo18var_return_opt_try17he02116165b0fc08cE(ptr` align 8 %self) !dbg !347 { start: %self.dbg.spill = alloca [8 x i8], align 8 %_0 = alloca [16 x i8], align 8 %residual.dbg.spill = alloca [0 x i8], align 1 #dbg_declare(ptr %residual.dbg.spill, !353, !DIExpression(), !357) store ptr %self, ptr %self.dbg.spill, align 8, !dbg !357 #dbg_declare(ptr %self.dbg.spill, !350, !DIExpression(), !358) ``` After: ``` define internal { i64, i64 } `@_ZN3tmp3Foo18var_return_opt_try17h00b17d08874ddd90E(ptr` align 8 %self) !dbg !347 { start: %self.dbg.spill = alloca [8 x i8], align 8 %_0 = alloca [16 x i8], align 8 %residual.dbg.spill = alloca [0 x i8], align 1 #dbg_declare(ptr %residual.dbg.spill, !353, !DIExpression(), !357) store ptr %self, ptr %self.dbg.spill, align 8 #dbg_declare(ptr %self.dbg.spill, !350, !DIExpression(), !358) ``` Note in particular how !357 from %residual.dbg.spill's dbg_declare no longer falls through onto the store to %self.dbg.spill. This fixes argument values at entry when the constant is a ZST (e.g. `<Option as Try>::Residual`). This fixes #130003 (but note that it does *not* fix issues with argument values and non-ZST constants, which emit their own stores that have debug info on them, like #128945). r? `@michaelwoerister`
2024-09-09Ban non-array SIMDScott McMurray-32/+32
2024-09-06Don't leave debug locations for constants sitting on the builder indefinitely.Kyle Huey-0/+72
Because constants are currently emitted *before* the prologue, leaving the debug location on the IRBuilder spills onto other instructions in the prologue and messes up both line numbers as well as the point LLVM chooses to be the prologue end. Example LLVM IR (irrelevant IR elided): Before: define internal { i64, i64 } @_ZN3tmp3Foo18var_return_opt_try17he02116165b0fc08cE(ptr align 8 %self) !dbg !347 { start: %self.dbg.spill = alloca [8 x i8], align 8 %_0 = alloca [16 x i8], align 8 %residual.dbg.spill = alloca [0 x i8], align 1 #dbg_declare(ptr %residual.dbg.spill, !353, !DIExpression(), !357) store ptr %self, ptr %self.dbg.spill, align 8, !dbg !357 #dbg_declare(ptr %self.dbg.spill, !350, !DIExpression(), !358) After: define internal { i64, i64 } @_ZN3tmp3Foo18var_return_opt_try17h00b17d08874ddd90E(ptr align 8 %self) !dbg !347 { start: %self.dbg.spill = alloca [8 x i8], align 8 %_0 = alloca [16 x i8], align 8 %residual.dbg.spill = alloca [0 x i8], align 1 #dbg_declare(ptr %residual.dbg.spill, !353, !DIExpression(), !357) store ptr %self, ptr %self.dbg.spill, align 8 #dbg_declare(ptr %self.dbg.spill, !350, !DIExpression(), !358) Note in particular how !357 from %residual.dbg.spill's dbg_declare no longer falls through onto the store to %self.dbg.spill. This fixes argument values at entry when the constant is a ZST (e.g. <Option as Try>::Residual). This fixes #130003 (but note that it does *not* fix issues with argument values and non-ZST constants, which emit their own stores that have debug info on them, like #128945).
2024-09-01Upgrade CI's mingw-w64 toolchainMateusz Mikuła-0/+3
2024-08-27Make option-like-enum.rs UB-free and portableBen Kimock-25/+14
2024-08-21Rollup merge of #128627 - khuey:DUMMY_SP-line-no, r=nnethercoteMatthias Krüger-0/+45
Special case DUMMY_SP to emit line 0/column 0 locations on DWARF platforms. Line 0 has a special meaning in DWARF. From the version 5 spec: The compiler may emit the value 0 in cases where an instruction cannot be attributed to any source line. DUMMY_SP spans cannot be attributed to any line. However, because rustc internally stores line numbers starting at zero, lookup_debug_loc() adjusts every line number by one. Special casing DUMMY_SP to actually emit line 0 ensures rustc communicates to the debugger that there's no meaningful source code for this instruction, rather than telling the debugger to jump to line 1 randomly.
2024-08-19Add a test.Kyle Huey-0/+45
2024-08-18Fixup testsBen Kimock-13/+13
2024-08-18Convert lldbg- to lldb-Ben Kimock-716/+716
2024-08-18Delete lldbr annotationsBen Kimock-677/+0