Is it possible to make gdb show offsets as negative numbers during disassembly?
For instance, I'm working with a book that shows (from a supposed disassembly dump of their function):
0x08048394 : mov DWORD PTR [ebp-4], 0x0
But when I run this code and use the gdb disassemble command, I get:
0x08048394 : movl $0x0 0xfffffffc(%ebp)
I'm presumably using the same compiler and environment as the author (as it came as a virtual machine image on an included CD). So, why the difference in the way it is being displayed, and why the difference in the instructions? I compiled with the same options as the author did (simply gcc -g)
Thanks!
set disassembly-flavor intel
. Whether that will also use negative offsets for you, I do not know, but the two values are equivalent, since0xfffffffc
is 2's complement for-4
. – Jester