GDB没有显示EFlags助记符



我目前正在使用GDB和NASM进行汇编编程。

不幸的是,我无法在GDB中看到EFlags寄存器助记符(ZF, AF, PF等)。

显示的是十进制值:eflags 0x246 582

我确信我可以将十进制转换为二进制并自己计算标志,但这对于每个人似乎都有的功能来说似乎是很多工作?

操作系统:Mountain Lion 10.8.2

GDB Version:

GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Thu Nov 15 10:42:43 UTC 2012)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".

您的gdb版本太旧了。如果它没有实现该功能,下面是我用来打印eflags内容的gdb函数:

define eflags
    printf "     OF <%d>  DF <%d>  IF <%d>  TF <%d>",
           (($eflags >> 0xB) & 1), (($eflags >> 0xA) & 1), 
           (($eflags >> 9) & 1), (($eflags >> 8) & 1)
    printf "  SF <%d>  ZF <%d>  AF <%d>  PF <%d>  CF <%d>n",
           (($eflags >> 7) & 1), (($eflags >> 6) & 1),
           (($eflags >> 4) & 1), (($eflags >> 2) & 1), ($eflags & 1)
    printf "     ID <%d>  VIP <%d> VIF <%d> AC <%d>",
           (($eflags >> 0x15) & 1), (($eflags >> 0x14) & 1), 
           (($eflags >> 0x13) & 1), (($eflags >> 0x12) & 1)
    printf "  VM <%d>  RF <%d>  NT <%d>  IOPL <%d>n",
           (($eflags >> 0x11) & 1), (($eflags >> 0x10) & 1),
           (($eflags >> 0xE) & 1), (($eflags >> 0xC) & 3)
end
document eflags
Print EFLAGS register. (x86)
end

查看集合标志:

info registers eflags

相关内容

  • 没有找到相关文章

最新更新