This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Implement pahole-like 'ptype /o' option
On Monday, November 27 2017, Tom Tromey wrote:
>>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
>
> Sergio> I think for 'ptype /o' the best would be to stick with 2 levels, because
> Sergio> otherwise the output gets too messed up. But I've been thinking about
> Sergio> sending another patch to enable the multi-level ptype anyway.
>
> I see what you mean, though I wonder if it's better to just overflow and
> let users with deeply-nested types just widen their terminals.
OK, so your idea is to always "un-nest" structures/unions when doing
'ptype /o' (just like pahole.py does). That works for me, but I'd like
to hear other opinions as well.
> Alternatively the code could wrap_here() at strategic points.
Yeah, I'll see if I can do that, but I don't know.
>>> ... though the old code's output is kind of confusing, restarting the
>>> offset at 0 in the embedded struct.
>
> Sergio> The way my code is written, it also restarts the offset at 0. Do you
> Sergio> think it'd be better to keep using the offset from the outter struct?
>
> I am not 100% certain but I tend to think it's more understandable to
> have the offsets refer to the outermost structure.
OK, that can be arranged :-).
Thanks,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/