Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Knezevic <daniel.knezevic@htecgroup.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: Tom Tromey <tom@tromey.com>, Pedro Alves <pedro@palves.net>,
	Simon Marchi <simark@simark.ca>,
	Daniel Knezevic <daniel.knezevic@htecgroup.com>
Subject: [PATCH 0/3 v4] gdb: Make printing enum types prettier
Date: Wed, 26 Nov 2025 12:02:55 +0000	[thread overview]
Message-ID: <20251126120210.919813-1-daniel.knezevic@htecgroup.com> (raw)

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

             reply	other threads:[~2025-11-26 12:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26 12:02 Daniel Knezevic [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251126120210.919813-1-daniel.knezevic@htecgroup.com \
    --to=daniel.knezevic@htecgroup.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --cc=simark@simark.ca \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox