You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Debuginfo for adt::RawNullablePointer (and probably also adt::StructWrappedNullablePointer) enums is not correct if the pointer that doubles as discriminant is a fat pointer.
Steps to reproduce:
(1) Compile the following program with -g
fnmain(){let x = Some("abc");::std::io::println(x.unwrap());}
(2) Print the value of x in LLDB with pretty printers enabled:
Michaels-Mac-mini:option-fat-pointer mw$ rust-lldb ./main
Executing commands in '/tmp/rust-lldb-commands.66chQx'.
(lldb) command script import "/Users/mw/rust/x86_64-apple-darwin/stage1/lib/rustlib/etc/lldb_rust_formatters.py"
(lldb) type summary add --no-value --python-function lldb_rust_formatters.print_val -x ".*" --category Rust
(lldb) type category enable Rust
Current executable set to './main' (x86_64).
(lldb) b 4
Breakpoint 1: where = main`main::main + 88 at main.rs:4, address = 0x0000000100001878
(lldb) r
Process 26375 launched: './main' (x86_64)
Process 26375 stopped
* thread #1: tid = 0x202ad, 0x0000000100001878 main`main::main + 88 at main.rs:4, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0000000100001878 main`main::main + 88 at main.rs:4
1
2 fn main() {
3 let x = Some("abc");
-> 4 ::std::io::println(x.unwrap());
5 }
(lldb) p x
(core::option::Option<&str>) $0 = None
(lldb)
This should print Some(0x12345678) instead of None.
Maybe it's just the LLDB pretty printer that needs to be adapted.
The text was updated successfully, but these errors were encountered:
luqmana
changed the title
debuginfo: DWARF encoding of space-optimized enums no correct for fat pointers
debuginfo: DWARF encoding of space-optimized enums not correct for fat pointers
Dec 1, 2014
Debuginfo for
adt::RawNullablePointer
(and probably alsoadt::StructWrappedNullablePointer
) enums is not correct if the pointer that doubles as discriminant is a fat pointer.Steps to reproduce:
(1) Compile the following program with
-g
(2) Print the value of
x
in LLDB with pretty printers enabled:This should print
Some(0x12345678)
instead ofNone
.Maybe it's just the LLDB pretty printer that needs to be adapted.
The text was updated successfully, but these errors were encountered: