From f66b801a7591989f9daa08d7bbbc7190ef2aec23 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 17 Apr 2016 09:55:13 +0000 Subject: [PATCH] [NTOS:KE] - In debug builds, restore EBP early in KiSwitchThreads to get a sensible backtrace CORE-11123 svn path=/trunk/; revision=71175 --- reactos/ntoskrnl/ke/i386/ctxswitch.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reactos/ntoskrnl/ke/i386/ctxswitch.S b/reactos/ntoskrnl/ke/i386/ctxswitch.S index 7bd712eb634..bbeb462d11b 100644 --- a/reactos/ntoskrnl/ke/i386/ctxswitch.S +++ b/reactos/ntoskrnl/ke/i386/ctxswitch.S @@ -63,6 +63,10 @@ PUBLIC @KiSwitchThreads@8 @KiSwitchThreads@8: /* Load the new kernel stack and switch OS to new thread */ mov esp, edx +#if DBG + /* Restore the frame pointer early to get sensible backtraces */ + mov ebp, [esp+12] +#endif call @KiSwapContextExit@8 /* Now we're on the new thread. Return to the caller to restore registers */