Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/3 v4] gdb: Make printing enum types prettier
@ 2025-11-26 12:02 Daniel Knezevic
  2025-11-26 12:02 ` [PATCH 1/3] gdb: Move logic for printing enums to a helper function Daniel Knezevic
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Daniel Knezevic @ 2025-11-26 12:02 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey, Pedro Alves, Simon Marchi, Daniel Knezevic

This is v4 of:
  https://inbox.sourceware.org/gdb-patches/20251124132726.325366-1-daniel.knezevic@htecgroup.com/

Patch 1:
- A preparation patch, as suggested by Simon, that moves logic for printing
  enums to a helper function.

Patch 2:
- Updates tests to use multi_line as a preparation step for future changes
  related to enum printing.
  
Patch 3:
- Implements the new way of printing enums and updates tests using enums.
- I tried to reduce the number of print calls to minimum by using fprintf_styled
  function. When printing <variable name> = <value> two print calls are
  used. The reason for this is maintain printing in the right style (keep the
  same color scheme as before). The first fprintf_styled prints a colored
  (styled) variable name, then the gdb_printf prints out the value in default
  color.


Daniel Knezevic (3):
  gdb: Move logic for printing enums to a helper function
  gdb: Replace \r\n with multi_line to make tests more readable
  gdb: Make printing enum types prettier.

 gdb/c-typeprint.c                             | 151 +++++++-------
 gdb/testsuite/gdb.base/call-sc.exp            |  11 +-
 gdb/testsuite/gdb.base/ctf-ptype.exp          | 181 ++++++++++++++---
 gdb/testsuite/gdb.base/ptype.exp              | 186 +++++++++++++++---
 .../gdb.base/whatis-ptype-typedefs.exp        |   8 +-
 gdb/testsuite/gdb.cp/classes.exp              |  27 ++-
 gdb/testsuite/gdb.cp/empty-enum.exp           |  24 ++-
 gdb/testsuite/gdb.cp/enum-class.exp           |   6 +-
 gdb/testsuite/gdb.cp/nested-types.exp         |   6 +-
 gdb/testsuite/gdb.dwarf2/enum-type.exp        |  14 +-
 gdb/testsuite/gdb.xml/tdesc-regs.exp          |  39 +++-
 gdb/testsuite/lib/cp-support.exp              |  39 +++-
 12 files changed, 529 insertions(+), 163 deletions(-)

-- 
2.43.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-12-01 20:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-26 12:02 [PATCH 0/3 v4] gdb: Make printing enum types prettier Daniel Knezevic
2025-11-26 12:02 ` [PATCH 1/3] gdb: Move logic for printing enums to a helper function Daniel Knezevic
2025-11-26 12:03 ` [PATCH 2/3] gdb: Replace \r\n with multi_line to make tests more readable Daniel Knezevic
2025-11-26 12:43   ` Andreas Schwab
2025-11-26 12:03 ` [PATCH 3/3] gdb: Make printing enum types prettier Daniel Knezevic
2025-12-01 20:23 ` [PATCH 0/3 v4] " Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox