gdbinit/Gdbinit — pull request #10 by StalkR (2013-05-31 19:58:07+00:00)
Title: fix $eflags invalid cast because now an internal type

Hello,

I encountered a strange bug with gdb 7.4 while displaying the regs:
RAX: 0x00007FFFE7F73F60 RBX: 0x000000C20004B0E0 RBP: 0x0000000000000040 RSP: 0x00007FFFE7F73EE0 Error while running hook_stop: Invalid cast.

Under gdb 7.3 it works fine:
gdb$ print $eflags
$1 = [ IF ]
gdb$ print ($eflags >> 0xB) & 1
$2 = 0x0

However under gdb 7.4.1-debian:
gdb$ print ($eflags >> 0xB) & 1
Invalid cast.

Making sure that $eflags is interpreted as an uint solves the problem:
gdb$ print ((unsigned int)$eflags >> 0xB) & 1
$4 = 0x0

Proposed patch replaces $eflags with (unsigned int)$eflags everywhere.
It now works on 7.4 as well as the old ones.

Cheers,
StalkR