From e63bbc887e4d3f7cd78ed15a1fe478e0a9eb4f8e Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Thu, 29 Apr 2004 16:24:01 +0000 Subject: [PATCH] Mark Kettenis * i386-tdep.c (i386_skip_prologue): follow the last jump only if the function begins with a branch instruction. --- gdb/ChangeLog | 6 ++++++ gdb/i386-tdep.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f966fd9..fc8d338 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2004-04-19 Jerome Guitton + Mark Kettenis + + * i386-tdep.c (i386_skip_prologue): follow the last jump only if + the function begins with a branch instruction. + 2004-04-29 Mark Kettenis * i386-tdep.c: Fix spelling mistakes. diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 2ee8695..5e4eec9 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -750,7 +750,13 @@ i386_skip_prologue (CORE_ADDR start_pc) } } - return i386_follow_jump (pc); + /* If the function starts with a branch (to startup code at the end) + the last instruction should bring us back to the first + instruction of the real code. */ + if (i386_follow_jump (start_pc) != start_pc) + pc = i386_follow_jump (pc); + + return pc; } /* This function is 64-bit safe. */ -- 2.7.4