Module: wine Branch: master Commit: c047d6ddbd550d8e73e6289a11a2d89c72ab1ee5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c047d6ddbd550d8e73e6289a11...
Author: Eric Pouech eric.pouech@orange.fr Date: Mon Jan 2 20:58:23 2012 +0100
winedbg: In x86_64 backend, now recognize 'rep ret' as a valid function return instruction.
---
programs/winedbg/be_x86_64.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/programs/winedbg/be_x86_64.c b/programs/winedbg/be_x86_64.c index 253b4ac..7dbd301 100644 --- a/programs/winedbg/be_x86_64.c +++ b/programs/winedbg/be_x86_64.c @@ -300,7 +300,15 @@ static unsigned be_x86_64_is_step_over_insn(const void* insn) static unsigned be_x86_64_is_function_return(const void* insn) { BYTE c; - return dbg_read_memory(insn, &c, sizeof(c)) && ((c == 0xC2) || (c == 0xC3)); + + /* sigh... amd64 for prefetch optimization requires 'rep ret' in some cases */ + if (!dbg_read_memory(insn, &c, sizeof(c))) return FALSE; + if (c == 0xF3) /* REP */ + { + insn = (const char*)insn + 1; + if (!dbg_read_memory(insn, &c, sizeof(c))) return FALSE; + } + return c == 0xC2 /* ret */ || c == 0xC3 /* ret NN */; }
static unsigned be_x86_64_is_break_insn(const void* insn)