-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)O-windowsOperating system: WindowsOperating system: Windows
Description
Compiling the following program with the MSVC toolchain and the running it in the MSVC debugger shows that there is some problem with inspecting values of type i8
and u8
(this was originally found while investigating #36503):
fn main() {
let value_i8: i8 = -1;
let value_i16: i16 = -2;
let value_i32: i32 = -3;
let value_i64: i64 = -4;
let value_u8: u8 = 1;
let value_u16: u16 = 2;
let value_u32: u32 = 3;
let value_u64: u64 = 4;
let value_f32: f32 = 5.;
let value_f64: f64 = 6.;
let slice_u8: &[u8] = &[1,2,3];
let slice_i8: &[i8] = &[1,2,3];
let slice_u16: &[u16] = &[1,2,3];
let slice_i16: &[i16] = &[1,2,3];
// Without these, the values would be optimized away
println!("{} {} {} {}", value_i8, value_i16, value_i32, value_i64);
println!("{} {} {} {}", value_u8, value_u16, value_u32, value_u64);
println!("{} {}", value_f32, value_f64);
println!("{:?} {:?} {:?} {:?}", slice_u8, slice_i8, slice_u16, slice_i16);
}
The screenshot shows that the problem also appears for &[u8]
and &[i8]
, where the debugger can't show the pointer (data_ptr
).
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)O-windowsOperating system: WindowsOperating system: Windows