Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Flags fields in register xml descriptions are suboptimal: What to do?
@ 2016-02-04  0:08 Doug Evans
  2016-02-04 14:41 ` Yao Qi
  0 siblings, 1 reply; 4+ messages in thread
From: Doug Evans @ 2016-02-04  0:08 UTC (permalink / raw)
  To: gdb-patches

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.


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

end of thread, other threads:[~2016-02-04 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-04  0:08 Flags fields in register xml descriptions are suboptimal: What to do? Doug Evans
2016-02-04 14:41 ` Yao Qi
2016-02-04 15:11   ` Pedro Alves
2016-02-04 15:19   ` Pedro Alves

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