Subject: bug#59730: gdb-mi.el: Local variables reordering

From: Eli Zaretskii <[email-masked]>
Date: Thu, 01 Dec 2022 17:44:44 +0200

> From: Gustaf Waldemarson <[email-masked]>
> Date: Wed, 30 Nov 2022 23:09:14 +0100
> 
> In summary, this patch does this: In gdb-mi.el mode, for local C/C++ variables that were previously written
> out:
> 
> - | type | name | value|
> 
> Now write them out as:
> 
> - | name | type | value |
> 
> Additionally, cap the string length of the name and type to `gdb-locals-max-name-length` and
> `gdb-locals-max-type-length` respectively (new custom variables with a default set to 20). I also changed the
> table to always left-align the values when we're printing the locals.
> 
> Turns out it was really easy to fix, but I may have missed some subtleties, so feel free to give it a look or
> start a discussion whether this is a good idea or not. I personally prefer it this way since it is much easier
> and faster to see the values of individual variables, especially when the type-info get very long.

First, if the problem is that the type names are long, maybe it will be
enough to truncate them without changing the order?

Also, latest version of GDB allow control on which types get shown in full
and which are shown as <...> -- did you try to use that GDB option to make
the display more easily readable?

And wouldn't it be better to truncate the string with
truncate-string-to-width or with string-truncate-left instead?

And finally, when the type is truncated, would it be possible to add a
tooltip with the full name of the type, so that users who need that could
hover the mouse above the truncated type and see it in full?

Thanks.