Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ezra Sitorus <ezra.sitorus@arm.com>
To: Andrew Burgess <aburgess@redhat.com>
Cc: <gdb-patches@sourceware.org>, <luis.machado.foss@gmail.com>,
	<pedro@palves.net>
Subject: Re: [RFC PATCH] gdb/py: Add pretty printer for __mfp8 for aarch64
Date: Tue, 18 Nov 2025 18:37:48 +0000	[thread overview]
Message-ID: <aRy8_CctnQJ9TYLs@D2G2X7XGD1> (raw)
In-Reply-To: <87wm3ntgd9.fsf@redhat.com>

Hi - thanks for the comments!

> Pretty printers are usually defined alongside the library that adds the
> types that need pretty printing.  But (from a quick google search) it
> would seem that these types are ARM extensions to the C language, and so
> are present in most/all C compilers for ARM targets?
> 
> Given that adding pretty printers to GDB is unusual, I think it is worth
> including a justification for why the pretty printers should be added
> here, and not with the compiler.

My motivation for this is so that GDB can debug FP8 programs from any
compiler for AArch64. Whether or not to add to GDB was previously 
discussed in another approach I had for this:
https://inbox.sourceware.org/gdb-patches/c2a26a71-f618-47f6-9985-132c146dedab@gmail.com/

On Fri, Oct 17, 2025 at 11:20:48AM +0100, Luis wrote:
> Right, these pretty printers usually go with whoever is producing/using such
> types. So libraries/compilers etc.
>
> With that said, we could also have a set of pretty-printers in gdb as well
> as reference implementation.

Is there a case then for adding this pretty printer for GDB? I understand
that there are no other pretty printers included in GDB, and I don't have
any objection if it's added to GCC only. Perhaps both?

> I think you ideally want these to be automatically registered, just how
> compiler pretty printers would be automatically loaded.
> 
> You should investigate the 'new_objfile' event.  But I'm not certain how
> you're going to decide if the pretty printer should be registered or
> not as you'll only want to register this for suitable AArch64 inferiors
> I guess.  Maybe there's something that could be done via the program
> space? 
> 
I'll take a look at that. As for deciding which inferiors are suitable, my
thinking is that it would be included for all AArch64 inferiors. In the same
way that the BF16 format is included in the V-registers, but not every target
would support BF16. What do you think?

> My concern is that if these printers don't auto-register then users
> aren't going to know this feature exists.

Is adding to the documentation and news section enough?

Thanks,
Ezra

  reply	other threads:[~2025-11-18 18:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-18 14:14 Ezra.Sitorus
2025-11-18 17:12 ` Andrew Burgess
2025-11-18 18:37   ` Ezra Sitorus [this message]
2025-11-26 16:08   ` Ezra Sitorus
2025-11-18 18:42 ` Tom Tromey
2025-11-19 13:12   ` Ezra Sitorus
2025-11-19 15:58     ` Tom Tromey
2025-11-19 21:28       ` Ezra Sitorus
2025-12-16 16:39       ` Ezra Sitorus

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=aRy8_CctnQJ9TYLs@D2G2X7XGD1 \
    --to=ezra.sitorus@arm.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado.foss@gmail.com \
    --cc=pedro@palves.net \
    /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