[PATCH] gdb: Add a new function to display binary output by groups

Enze Li lienze2010@hotmail.com
Tue Nov 17 01:55:11 GMT 2020


Hi Andrew,

Thank you very much for your suggestion. I'll try to improve it.

Thanks,
Enze

On 11/16/2020 6:14 PM, Andrew Burgess wrote:
> * Enze Li via Gdb-patches <gdb-patches@sourceware.org> [2020-11-16 16:07:18 +0800]:
>
>> The new function(print_binary_chars_group) could display binary output
>> by groups when executing the print command with the "m" option, each
>> group has 4 bits.
> This would need adding to the documentation in gdb/doc/gdb.texinfo, as
> well as to the help text for 'x' (gdb/printcmd.c).  It would probably
> need adding to NEWS too.  Finally you should definitely add tests to
> cover the new functionality.
>
> That said, I wonder if a whole new format option is the right way to
> go?  Would a new option 'set print binary-groups on|off' would be just
> as good?
>
> My thinking is that this feels like something that a user would pick
> the one they prefer, and stick with that, not something where the user
> would be constantly switching formats for each print command?  And if
> you really do need the other format for a one shot command, there's
> always the `with .... ` syntax to allow that.
>
> Just a thought...
>
> Thanks,
> Andrew


More information about the Gdb-patches mailing list