diff options
author | Mark Kettenis <kettenis@gnu.org> | 2004-04-29 16:24:01 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2004-04-29 16:24:01 +0000 |
commit | e63bbc887e4d3f7cd78ed15a1fe478e0a9eb4f8e (patch) | |
tree | adc48be6fa9b305c6fbbcfb3f743fd43384d7acf /gdb/i386-tdep.c | |
parent | fd35795f4f300f28d87bf6597961a389df8c1ae2 (diff) | |
download | gdb-e63bbc887e4d3f7cd78ed15a1fe478e0a9eb4f8e.zip gdb-e63bbc887e4d3f7cd78ed15a1fe478e0a9eb4f8e.tar.gz gdb-e63bbc887e4d3f7cd78ed15a1fe478e0a9eb4f8e.tar.bz2 |
Mark Kettenis <kettenis@gnu.org>
* i386-tdep.c (i386_skip_prologue): follow the last jump only if
the function begins with a branch instruction.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 8 |
1 files changed, 7 insertions, 1 deletions
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. */ |