This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [RFC PATCH 0/3] Pretty-printing for errno
- From: Pedro Alves <palves at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>, Zack Weinberg <zackw at panix dot com>, libc-alpha at sourceware dot org, gdb at sourceware dot org
- Cc: joseph at codesourcery dot com, fweimer at redhat dot com, tom at tromey dot com, siddhesh at gotplt dot org
- Date: Thu, 29 Jun 2017 18:02:04 +0100
- Subject: Re: [RFC PATCH 0/3] Pretty-printing for errno
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CC71367AC8
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CC71367AC8
- References: <20170622224456.1358-1-zackw@panix.com> <b2e7bc3b-d914-37ec-0215-2937949a848c@redhat.com> <3a7946e9-d178-f878-9774-64ff44bcf5df@redhat.com>
On 06/29/2017 05:53 PM, Pedro Alves wrote:
> however, we'd need to still make "whatis" strip one level of
> typedefs when the argument is a type, somehow, because we now
> get this:
>
> (gdb) whatis zzz
> type = zzz
I suspect we can do that by making "whatis" look at the top of
the expression tree, see if it's an OP_TYPE:
(gdb) set debug expression 1
(gdb) whatis (zzz)0
...
Dump of expression @ 0x1bc6af0, after conversion to prefix form:
Expression: `(zzz) 0'
Language c, 8 elements, 16 bytes each.
0 UNOP_CAST_TYPE (
1 OP_TYPE Type @0x18e7920 (zzz))
4 OP_LONG Type @0x19a6650 (int), value 0 (0x0)
type = zzz
(gdb) whatis zzz
...
Dump of expression @ 0x1bc87b0, after conversion to prefix form:
Expression: `zzz'
Language c, 3 elements, 16 bytes each.
0 OP_TYPE Type @0x18e7920 (zzz)
type = zzz
(gdb) whatis z
...
Dump of expression @ 0x1bc6af0, after conversion to prefix form:
Expression: `z'
Language c, 4 elements, 16 bytes each.
0 OP_VAR_VALUE Block @0x19e8ee0, symbol @0x19e8e10 (z)
type = zzz
(gdb)
There may be a helper for this already somewhere. I've never dug
that much deeply into this area of the code.
Thanks,
Pedro Alves