[PATCH] Implement pahole-like 'ptype /o' option

Tom Tromey tom@tromey.com
Mon Nov 27 22:20:00 GMT 2017


>>>>> "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.

Alternatively the code could wrap_here() at strategic points.

>> ... 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.

Tom



More information about the Gdb-patches mailing list