Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: gdb-patches@sourceware.org
Subject: Flags fields in register xml descriptions are suboptimal: What to do?
Date: Thu, 04 Feb 2016 00:08:00 -0000	[thread overview]
Message-ID: <001a1135ed32b4c71c052ae6879a@google.com> (raw)

Hi.

I'm thinking about making "cpsr" in the aarch64 port
pretty-print better, like how we print eflags for x86.

However, there is a problem (I think - maybe there's an alternative
I'm missing).

Some fields are more than one bit (e.g., EL), so what to do?

AFAICT "flags" fields in register xml descriptions have a pretty hardwired
assumption that every field is one bit. There is code that loops over the
fields assuming each field's number is also its bit position.
Bleah!

I could use a struct, but it won't, I think(!), give me a mechanism
to print the kind of output I want. E.g.,

(gdb) i r cpsr
cpsr 0xa0000020 123456 [ Z N EL=1 ]

[Obviously I just made integer values up.]

Question: What do people think of allowing the "flags" type in register xml
descriptions to support fields larger than one bit?
Such fields would print as NAME=value (or some such).

---

Also, I'd like to print flags even if they're zero. E.g.,

(gdb) i r cpsr
cpsr 0xa0000020 123456 [ Z !C N !V EL=1 ... ]

or some such.
IOW, instead of not printing fields that are zero/false/off,
print them as "!FIELD".
That'll change x86 eflags printing and maybe some won't like that.
I could make it some kind of option, but it feels like featuritis.


             reply	other threads:[~2016-02-04  0:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04  0:08 Doug Evans [this message]
2016-02-04 14:41 ` Yao Qi
2016-02-04 15:11   ` Pedro Alves
2016-02-04 15:19   ` Pedro Alves

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=001a1135ed32b4c71c052ae6879a@google.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /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