Add Natvis visualiser and debuginfo tests for f128 - #161777
Conversation
b68bc57 to
e9dc1bb
Compare
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
cc MSVC target maintainers: @ChrisDenton @dpaoliello @Fulgen301 @lambdageek @sivadeilra @wesleywiser |
|
(Given this touches debuginfo tests this should probably get a |
|
@bors try jobs=x86_64-msvc-,i686-msvc-,aarch64-msvc-,aarch64-apple- |
1 similar comment
|
@bors try jobs=x86_64-msvc-,i686-msvc-,aarch64-msvc-,aarch64-apple- |
This comment has been minimized.
This comment has been minimized.
Add Natvis visualiser and debuginfo tests for `f128` try-job: x86_64-msvc-* try-job: i686-msvc-* try-job: aarch64-msvc-* try-job: aarch64-apple-*
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 816a2f0 failed: CI. Failed jobs:
|
e9dc1bb to
19f719c
Compare
|
According to the table on Wikipedia, there isn't any Xcode versions yet with LLDB 22 or later, so I've ignored the |
|
@bors try jobs=x86_64-msvc-,i686-msvc-,aarch64-msvc-,aarch64-apple- |
This comment has been minimized.
This comment has been minimized.
Add Natvis visualiser and debuginfo tests for `f128` try-job: x86_64-msvc-* try-job: i686-msvc-* try-job: aarch64-msvc-* try-job: aarch64-apple-*
|
@rustbot review |
This comment has been minimized.
This comment has been minimized.
|
This pull request was unapproved. This PR was contained in a rollup (#162973), which was unapproved. |
167c7bd to
b7bad07
Compare
|
This PR was contained in a rollup (#162973), which was closed. |
|
Test fails locally on @bors try jobs=test-i686-gnu-nopt-1 |
This comment has been minimized.
This comment has been minimized.
Add Natvis visualiser and debuginfo tests for `f128` try-job: test-i686-gnu-nopt-1
|
@rustbot review |
|
@bors r+ |
Add Natvis visualiser and debuginfo tests for `f128`
To render f128s in debuggers on MSVC targets, this PR changes the compiler to output `f128`s as `struct f128 { low_bits: u64, high_bits: u64 }`, and includes a Natvis visualiser that displays the float in hexdecimal format (similar to the `LowerHex` impl in rust-lang#160626), as unlike `f16` there's no larger supported float format to convert to and trying to write a float to decimal string converter in Natvis didn't seem practical. gdb, lldb and cdb tests are also included for `f128`, although gdb does not yet correctly identify the float format.
I did consider also displaying a `double` approximation of the `f128` (as the debugger will convert that to a decimal string) but decided against it as `f64` has a significantly smaller exponent range too (meaning very large or small `f128`s couldn't have an approximation anyway) and `cdb` and `WinDbg` both seem to round all floating-point numbers to 6 decimal places, meaning the displayed number is (double) rounded even further than `f64` precision and is useless for tiny values.
Closes rust-lang#121837
Tracking issue: rust-lang#116909
Rollup of 18 pull requests Successful merges: - #162499 (`rustc_codegen_gcc` subtree update) - #161424 (implement `VaArgSafe` for `f128`) - #161777 (Add Natvis visualiser and debuginfo tests for `f128`) - #162506 (Avoid suggesting imports of traits declared inside fn bodies) - #162591 (Move parse error recovery for expression operators "out of line" & refactor in the area) - #162669 ([rustdoc] Correctly handle intra-doc links on inlined same item with different names) - #162733 (Add useful APIs to `Unique(Arc|Rc)`) - #162913 (Refactor LivenessResults into LivenessComputation, without typeck) - #162950 (More AST lowering cleanups) - #162964 (Update `browser-ui-test` version to `0.25.2`) - #162979 (mark `f128` as reliable on `powerpc64` with `+vsx`) - #161743 (Add performance notes for the floating-point round method) - #162797 (yeet AliasConstKind::opt_def_id) - #162836 (Ping T-libs-ping instead of T-libs-fcp for backports) - #162873 (Adjust `bug!`/`span_bug!` emission) - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt) - #162956 (Add missing `#[repr(C)]` in UI, codegen and assembly tests) - #162981 (rustc-dev-guide subtree update) Failed merges: - #162177 (Properly implement the gpu-kernel ABI for amdgpu)
Rollup of 18 pull requests Successful merges: - #162499 (`rustc_codegen_gcc` subtree update) - #161424 (implement `VaArgSafe` for `f128`) - #161777 (Add Natvis visualiser and debuginfo tests for `f128`) - #162506 (Avoid suggesting imports of traits declared inside fn bodies) - #162591 (Move parse error recovery for expression operators "out of line" & refactor in the area) - #162669 ([rustdoc] Correctly handle intra-doc links on inlined same item with different names) - #162733 (Add useful APIs to `Unique(Arc|Rc)`) - #162913 (Refactor LivenessResults into LivenessComputation, without typeck) - #162950 (More AST lowering cleanups) - #162964 (Update `browser-ui-test` version to `0.25.2`) - #162979 (mark `f128` as reliable on `powerpc64` with `+vsx`) - #161743 (Add performance notes for the floating-point round method) - #162797 (yeet AliasConstKind::opt_def_id) - #162836 (Ping T-libs-ping instead of T-libs-fcp for backports) - #162873 (Adjust `bug!`/`span_bug!` emission) - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt) - #162956 (Add missing `#[repr(C)]` in UI, codegen and assembly tests) - #162981 (rustc-dev-guide subtree update) Failed merges: - #162177 (Properly implement the gpu-kernel ABI for amdgpu)
Add Natvis visualiser and debuginfo tests for `f128`
To render f128s in debuggers on MSVC targets, this PR changes the compiler to output `f128`s as `struct f128 { low_bits: u64, high_bits: u64 }`, and includes a Natvis visualiser that displays the float in hexdecimal format (similar to the `LowerHex` impl in rust-lang#160626), as unlike `f16` there's no larger supported float format to convert to and trying to write a float to decimal string converter in Natvis didn't seem practical. gdb, lldb and cdb tests are also included for `f128`, although gdb does not yet correctly identify the float format.
I did consider also displaying a `double` approximation of the `f128` (as the debugger will convert that to a decimal string) but decided against it as `f64` has a significantly smaller exponent range too (meaning very large or small `f128`s couldn't have an approximation anyway) and `cdb` and `WinDbg` both seem to round all floating-point numbers to 6 decimal places, meaning the displayed number is (double) rounded even further than `f64` precision and is useless for tiny values.
Closes rust-lang#121837
Tracking issue: rust-lang#116909
…uwer Rollup of 22 pull requests Successful merges: - #163001 (Temporarily disable `test-x86_64-fuchsia`) - #162880 (Mini optimization in `rustc_hir_typeck::upvar::restrict_precision_for_drop_types`) - #161424 (implement `VaArgSafe` for `f128`) - #161777 (Add Natvis visualiser and debuginfo tests for `f128`) - #162506 (Avoid suggesting imports of traits declared inside fn bodies) - #162591 (Move parse error recovery for expression operators "out of line" & refactor in the area) - #162669 ([rustdoc] Correctly handle intra-doc links on inlined same item with different names) - #162733 (Add useful APIs to `Unique(Arc|Rc)`) - #162913 (Refactor LivenessResults into LivenessComputation, without typeck) - #162924 (Remove applying inline attributes at the callsite) - #162940 (Use spawned `SBDebugger` instance) - #162950 (More AST lowering cleanups) - #162964 (Update `browser-ui-test` version to `0.25.2`) - #162979 (mark `f128` as reliable on `powerpc64` with `+vsx`) - #161743 (Add performance notes for the floating-point round method) - #162797 (yeet AliasConstKind::opt_def_id) - #162836 (Ping T-libs-ping instead of T-libs-fcp for backports) - #162873 (Adjust `bug!`/`span_bug!` emission) - #162956 (Add missing `#[repr(C)]` in UI, codegen and assembly tests) - #162971 (libtest harness: avoid 'extern crate test' with custom runner) - #162981 (rustc-dev-guide subtree update) - #162985 (Error on invalid placements for unstable attributes)
Rollup merge of #161777 - beetrees:f128-debuginfo, r=JohnTitor Add Natvis visualiser and debuginfo tests for `f128` To render f128s in debuggers on MSVC targets, this PR changes the compiler to output `f128`s as `struct f128 { low_bits: u64, high_bits: u64 }`, and includes a Natvis visualiser that displays the float in hexdecimal format (similar to the `LowerHex` impl in #160626), as unlike `f16` there's no larger supported float format to convert to and trying to write a float to decimal string converter in Natvis didn't seem practical. gdb, lldb and cdb tests are also included for `f128`, although gdb does not yet correctly identify the float format. I did consider also displaying a `double` approximation of the `f128` (as the debugger will convert that to a decimal string) but decided against it as `f64` has a significantly smaller exponent range too (meaning very large or small `f128`s couldn't have an approximation anyway) and `cdb` and `WinDbg` both seem to round all floating-point numbers to 6 decimal places, meaning the displayed number is (double) rounded even further than `f64` precision and is useless for tiny values. Closes #121837 Tracking issue: #116909
…uwer Rollup of 22 pull requests Successful merges: - rust-lang/rust#163001 (Temporarily disable `test-x86_64-fuchsia`) - rust-lang/rust#162880 (Mini optimization in `rustc_hir_typeck::upvar::restrict_precision_for_drop_types`) - rust-lang/rust#161424 (implement `VaArgSafe` for `f128`) - rust-lang/rust#161777 (Add Natvis visualiser and debuginfo tests for `f128`) - rust-lang/rust#162506 (Avoid suggesting imports of traits declared inside fn bodies) - rust-lang/rust#162591 (Move parse error recovery for expression operators "out of line" & refactor in the area) - rust-lang/rust#162669 ([rustdoc] Correctly handle intra-doc links on inlined same item with different names) - rust-lang/rust#162733 (Add useful APIs to `Unique(Arc|Rc)`) - rust-lang/rust#162913 (Refactor LivenessResults into LivenessComputation, without typeck) - rust-lang/rust#162924 (Remove applying inline attributes at the callsite) - rust-lang/rust#162940 (Use spawned `SBDebugger` instance) - rust-lang/rust#162950 (More AST lowering cleanups) - rust-lang/rust#162964 (Update `browser-ui-test` version to `0.25.2`) - rust-lang/rust#162979 (mark `f128` as reliable on `powerpc64` with `+vsx`) - rust-lang/rust#161743 (Add performance notes for the floating-point round method) - rust-lang/rust#162797 (yeet AliasConstKind::opt_def_id) - rust-lang/rust#162836 (Ping T-libs-ping instead of T-libs-fcp for backports) - rust-lang/rust#162873 (Adjust `bug!`/`span_bug!` emission) - rust-lang/rust#162956 (Add missing `#[repr(C)]` in UI, codegen and assembly tests) - rust-lang/rust#162971 (libtest harness: avoid 'extern crate test' with custom runner) - rust-lang/rust#162981 (rustc-dev-guide subtree update) - rust-lang/rust#162985 (Error on invalid placements for unstable attributes)
View all comments
To render f128s in debuggers on MSVC targets, this PR changes the compiler to output
f128s asstruct f128 { low_bits: u64, high_bits: u64 }, and includes a Natvis visualiser that displays the float in hexdecimal format (similar to theLowerHeximpl in #160626), as unlikef16there's no larger supported float format to convert to and trying to write a float to decimal string converter in Natvis didn't seem practical. gdb, lldb and cdb tests are also included forf128, although gdb does not yet correctly identify the float format.I did consider also displaying a
doubleapproximation of thef128(as the debugger will convert that to a decimal string) but decided against it asf64has a significantly smaller exponent range too (meaning very large or smallf128s couldn't have an approximation anyway) andcdbandWinDbgboth seem to round all floating-point numbers to 6 decimal places, meaning the displayed number is (double) rounded even further thanf64precision and is useless for tiny values.Closes #121837
Tracking issue: #116909