Open
Description
It would be nice if rust-gdb
/etc. could pretty-print the inner value of Rc
and Arc
. Right now you only get the raw details, like:
(gdb) p foo
$1 = Rc<i32> = {ptr = NonNull<alloc::rc::RcBox<i32>> = {
pointer = NonZero<*const alloc::rc::RcBox<i32>> = {0x555555783a40}},
phantom = PhantomData<i32>}
Getting the actual value requires manual field access, foo.ptr.pointer.0.value
, which could also change if Rc
internals change.
Maybe this could be approached as more general Deref
support, so you could p *foo
here, but right now that just says "Attempt to take contents of a non-pointer value."