This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Flags fields in register xml descriptions are suboptimal: What to do?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]