I've got an x86 assembler program which I'm debugging with gdb. Is there a way to print the status of the carry flag inside gdb with, like, "print $cf"?
You can use:
info registers eflags
to get the entire set of flags. You'll see a line like:
eflags 0x41 [ CF ZF ]
which means that the eflags
register is set to 0x41
, with the carry and zero flags set.
I check the EFLAGS register using
(gdb) p $eflags
$3 = [ PF ZF IF ]
where "p" is just short for the "print" command.
I also find it helpful to see the bits using "/t" ( also /x for hex, /d for decimal).
(gdb) p/t $eflags
$4 = 1001000110
You can then compare with the chart for the EFLAGS register.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With