On Wed, 16 May 2007 21:20:20 +1000 Keith Owens wrote:
> >4.  Is there a way to print (decode) the CPU flags register so that
> >I can see which bits (conditions) are set/clear?
> 
> No.  Feel free to write one for kdb, but I usually handle this sort of
> problem by taking the hex value and feeding it to an external script.
> Like this one for decoding the IA64 psr bits.

Does that mean that you usually use kdb over a serial line instead
of on the target system's keyboard+display?  (sounds like that to me,
since you feed psr bits to an external script, whereas I typically
don't use a serial line for kdb, so having flag-bit-decoding done
internally would make some sense)

Anyway, I took your ia64 psr bits script and modified it to decode
x86/x86-64 EFLAGS bits.  The eflags are fed to it on the command
line instead of via STDIN, and the output bit values are not shifted
right, but that didn't matter to me.  E.g.:

$ decode-x86flags 10296 246
flags: 0x10296 = PF [4] AF [10] SF [80] IF [200] RF [10000] 
flags: 0x246 = PF [4] ZF [40] IF [200]


It's attached, in case anyone cares for it.

Thanks.
---
~Randy


-- Binary/unsupported file stripped by Ecartis --
-- Type: application/octet-stream
-- File: decode-x86flags


---------------------------
Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.

Reply via email to