[RFC] printing/setting flag register fields

Daniel Jacobowitz drow@false.org
Sun Sep 20 20:27:00 GMT 2009


On Sun, Sep 20, 2009 at 11:35:31AM -0700, Doug Evans wrote:
> Should TYPE_CODE_FLAGS be nuked?  I'm happy to do that instead if
> that's what folks want.  I like it, but if we made eflags a union of a
> struct and an int, then "set $eflags.ZF = 0" won't work.  Are folks
> happy with "set $eflags.bits.ZF = 0"?  "works for me".

IMO what we really want is the struct - but with a way to say "print
the whole word-sized struct as a single integer".  This is something I
need often.  I'd like to see "$eflags is 0x12f, which is the A B and C
bits", without GDB syntax getting in my way.

Yes, that's vague :-)

> But it could be done differently.  An off-the-cuff example is an
> option to ptype to print field offsets for structs in general.  [I'm
> assuming such a facility doesn't already exist.]  That would probably
> be more useful than always printing the offsets anyway.

I think such an option was submitted, once upon a time.  I don't know
what became of it.  I agree this would be more useful.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb-patches mailing list