On 10 August 2012 20:49, Tom Tromey wrote:
> A user reported on irc that the std::unique_ptr pretty-printer yields
> bad results.  For example:
>
> (gdb) p uptr
> $1 = std::tuple containing = {
>   [1] = ,
>   [2] = {
>     <std::default_delete<datum>> = {<No data fields>}, <No data fields>}
> }
>
> This omits the actual pointer and prints some useless stuff instead.
>
> This patch fixes the printer and adds a test.
> The new output looks like this:
>
> $11 = std::unique_ptr containing (datum *) 0x6067d0
>
> Let me know what you think.

It's inconsistent with the other printers in that it prints the stored
type, unlike e.g. std::vector<int> which just says "std::vector of
length ..." but I think that's an improvement.

Personally I'd prefer the element_type as part of the type, e.g.
"std::unique_ptr<datum> = 0x6067d0" but that would be even more
inconsistent!

OK for trunk, thanks.

Reply via email to