2003-08-10 11:55:58 +00:00
|
|
|
void gdb1253 (void);
|
2003-08-17 23:18:31 +00:00
|
|
|
void gdb1338 (void);
|
2004-04-29 18:05:31 +00:00
|
|
|
void jump_at_beginning (void);
|
2003-08-10 11:55:58 +00:00
|
|
|
|
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
gdb1253 ();
|
2003-08-17 23:18:31 +00:00
|
|
|
gdb1338 ();
|
2004-04-29 18:05:31 +00:00
|
|
|
jump_at_beginning ();
|
2003-08-10 11:55:58 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-08-17 23:18:31 +00:00
|
|
|
/* Relevant part of the prologue from symtab/1253. */
|
2003-08-10 11:55:58 +00:00
|
|
|
|
|
|
|
asm(".text\n"
|
|
|
|
" .align 8\n"
|
|
|
|
"gdb1253:\n"
|
|
|
|
" pushl %ebp\n"
|
|
|
|
" xorl %ecx, %ecx\n"
|
|
|
|
" movl %esp, %ebp\n"
|
|
|
|
" pushl %edi\n"
|
|
|
|
" int $0x03\n"
|
|
|
|
" leave\n"
|
|
|
|
" ret\n");
|
2003-08-17 23:18:31 +00:00
|
|
|
|
|
|
|
/* Relevant part of the prologue from backtrace/1338. */
|
|
|
|
|
|
|
|
asm(".text\n"
|
|
|
|
" .align 8\n"
|
|
|
|
"gdb1338:\n"
|
|
|
|
" pushl %edi\n"
|
|
|
|
" pushl %esi\n"
|
|
|
|
" pushl %ebx\n"
|
|
|
|
" int $0x03\n"
|
|
|
|
" popl %ebx\n"
|
|
|
|
" popl %esi\n"
|
|
|
|
" popl %edi\n"
|
|
|
|
" ret\n");
|
2004-04-29 18:05:31 +00:00
|
|
|
|
|
|
|
/* The purpose of this function is to verify that, during prologue
|
|
|
|
skip, GDB does not follow a jump at the beginnning of the "real"
|
|
|
|
code. */
|
|
|
|
|
|
|
|
asm(".text\n"
|
|
|
|
" .align 8\n"
|
|
|
|
"jump_at_beginning:\n"
|
|
|
|
" pushl %ebp\n"
|
|
|
|
" movl %esp,%ebp\n"
|
|
|
|
" jmp .gdbjump\n"
|
|
|
|
" nop\n"
|
|
|
|
".gdbjump:\n"
|
|
|
|
" movl %ebp,%esp\n"
|
|
|
|
" popl %ebp\n"
|
|
|
|
" ret\n");
|