instruction of the real code.
* i386-prologue.c (jump_at_beginning): New function.
+2004-04-27 Jerome Guitton <guitton@gnat.com>
+
+ * i386-prologue.exp: Add testcase for jump instruction as first
+ instruction of the real code.
+ * i386-prologue.c (jump_at_beginning): New function.
+
2004-04-28 Mark Kettenis <kettenis@gnu.org>
* gdb.base/call-sc.exp: Remove patterns to KFAIL PR gdb/1624 on
void gdb1253 (void);
void gdb1338 (void);
+void jump_at_beginning (void);
int
main (void)
{
gdb1253 ();
gdb1338 ();
+ jump_at_beginning ();
return 0;
}
" popl %esi\n"
" popl %edi\n"
" ret\n");
+
+/* 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");
gdb_test "info frame" \
".*Saved registers:.*ebx at.*esi at.*edi at.*eip at.*" \
"saved registers in gdb1338"
+
+# Testcase jump_at_beginning.
+gdb_test_multiple "break jump_at_beginning" \
+ "set breakpoint in jump_at_beginning" {
+ -re "Breakpoint \[0-9\]* at ($hex).*$gdb_prompt $" {
+ gdb_test "x/i $expect_out(1,string)" \
+ ".*<jump_at_beginning.*>:.*jmp.*" \
+ "check jump_at_beginning prologue end"
+ }
+ default {
+ fail "set breakpoint in jump_at_beginning"
+ }
+}