[PATCH] Handle void results as unformatted prints

Simon Marchi simark@simark.ca
Fri Oct 9 03:40:47 GMT 2020


On 2020-10-08 4:56 p.m., Hannes Domani via Gdb-patches wrote:
> When printing void results without any format letter, they are output
> as expected:
> (gdb) p $abcd
> $1 = void
> (gdb) p (void)10
> $2 = void
>
> But if any format letter (besides s) is used, it always outputs zero:
> (gdb) p/x $abcd
> $3 = 0x0
> (gdb) p/x (void)10
> $4 = 0x0

Thanks, this is, OK.  Although, for completeness in your test, can you
also add test to print a convenience variable that doesn't exist, as you
have shown above (the first "p $abcd")?

Simon


More information about the Gdb-patches mailing list