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 | 00ef249e28db4e60f6a6272c18d79bf53de0a18e (patch) | |
tree | aa8aac906bc9ab5caf55a350acf568ebc8aed028 /gdb/i386-tdep.c | |
parent | db095f7dc65be3a4704c6e989e67380cd6ac151e (diff) | |
download | gdb-00ef249e28db4e60f6a6272c18d79bf53de0a18e.tar.gz |
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 2ee86953cb3..5e4eec94daf 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. */ |