From 681307ff21f0b2c81898ba5d1ffd7c9ce94bf1e9 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 19 Aug 2010 09:03:36 +0000 Subject: [PATCH 1/1] [NTOSKRNL] Fix handling of next instruction in kdbg. Patch by Daniel Zimmermann, modified by Aleksey Bragin See issue #4457 for more details. svn path=/trunk/; revision=48566 --- reactos/ntoskrnl/kdbg/kdb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/kdbg/kdb.c b/reactos/ntoskrnl/kdbg/kdb.c index 30eb071c2d1..683904433c3 100644 --- a/reactos/ntoskrnl/kdbg/kdb.c +++ b/reactos/ntoskrnl/kdbg/kdb.c @@ -1413,6 +1413,8 @@ KdbEnterDebuggerException( /* Delete the temporary breakpoint which was used to step over or into the instruction. */ KdbpDeleteBreakPoint(-1, BreakPoint); + TrapFrame->Eip--; + if (--KdbNumSingleSteps > 0) { if ((KdbSingleStepOver && !KdbpStepOverInstruction(TrapFrame->Eip)) || @@ -1681,8 +1683,11 @@ continue_execution: /* Clear dr6 status flags. */ TrapFrame->Dr6 &= ~0x0000e00f; - /* Skip the current instruction */ - Context->Eip++; + if (!KdbEnteredOnSingleStep && KdbSingleStepOver) + { + /* Skip the current instruction */ + Context->Eip++; + } } return ContinueType; -- 2.17.1