From: Aleksandar Ristovski <aristovski@qnx.com>
Date: Mon, 16 Mar 2009 13:40:49 -0400
Hello,
When there is a hard-coded breakpoint in code, like in this
example (for x86):
#include <stdio.h>
int main()
{
__asm(" int $0x03\n");
printf("Hello World\n");
return 0;
}
gdb on linux will appear to work correctly.
Well, on Linux, that instruction will not be interpreted as a
permanent breakpoint, just like on QNX.
However, on systems that do not need pc adjustment after
break (like QNX) gdb will not be able to step over that
breakpoint unless user explicitly sets a breakpoint on top
of it.
The big question here is whether a breakpoint trap instruction should
always be interpreted as a permanent breakpoint in GDB or that it only
gets interpreted as such if you actually tell GDB about it. Up until
now, we've always done the latter. If you don't tell GDB, random
breakpoint trap instructions are handled as normal instructions and
you get to see whatever the architecture/OS does for these
instructions.