2004-04-19 Jerome Guitton * i386-tdep.c (i386_skip_prologue): follow the last jump only if the function begins with a branch instruction. Index: i386-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-tdep.c,v retrieving revision 1.187 diff -u -p -r1.187 i386-tdep.c --- i386-tdep.c 18 Apr 2004 18:38:04 -0000 1.187 +++ i386-tdep.c 19 Apr 2004 17:08:36 -0000 @@ -750,7 +750,15 @@ i386_skip_prologue (CORE_ADDR start_pc) } } - return i386_follow_jump (pc); + /* If the first instruction of the function is a branch, then the + setup sequence is at the end of the function and the instruction + at pc is branch back to the start. In this case, follow the + jump. */ + + if (i386_follow_jump (start_pc) != start_pc) + return i386_follow_jump (pc); + else + return pc; } /* This function is 64-bit safe. */