From 3c8dee1caac4d494b3741eb77376a1baf119ee38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Mon, 29 Mar 2004 22:29:34 +0000 Subject: [PATCH] Allow GDB 6 to backtrace over a syscall svn path=/trunk/; revision=8926 --- reactos/ntoskrnl/ke/i386/syscall.S | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/ke/i386/syscall.S b/reactos/ntoskrnl/ke/i386/syscall.S index a2cb72b16fd..9e4a53a6e12 100644 --- a/reactos/ntoskrnl/ke/i386/syscall.S +++ b/reactos/ntoskrnl/ke/i386/syscall.S @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: syscall.S,v 1.12 2003/06/20 16:21:11 ekohl Exp $ +/* $Id: syscall.S,v 1.13 2004/03/29 22:29:34 gvg Exp $ * * FILE: ntoskrnl/hal/x86/syscall.s * PURPOSE: 2E trap handler @@ -28,6 +28,7 @@ #include #include #include +#include #define KernelMode (0) #define UserMode (1) @@ -92,9 +93,17 @@ L3: pushl $0 /* XXX: TempCS */ pushl $0 /* XXX: DebugPointer */ pushl $0 /* XXX: DebugArgMark */ +#ifdef DBG + /* Trick gdb 6 into backtracing over the system call */ + movl 4(%ebp), %ebx + pushl %ebx /* DebugEIP */ + movl (%ebp), %ebx + pushl %ebx /* DebugEBP */ +#else movl 0x60(%esp), %ebx pushl %ebx /* DebugEIP */ pushl %ebp /* DebugEBP */ +#endif /* Load the segment registers */ movl $KERNEL_DS, %ebx @@ -134,6 +143,14 @@ L3: new_serviceInRange: +#ifdef DBG + /* GDB thinks the function starts here and + wants a standard prolog, so let's give it */ + pushl %ebp + movl %esp,%ebp + popl %ebp +#endif + /* Allocate room for argument list from kernel stack */ movl %es:_KeServiceDescriptorTable + 12, %ecx movl %es:(%ecx, %eax, 4), %ecx @@ -184,6 +201,14 @@ new_useShadowTable: new_shadowServiceInRange: +#ifdef DBG + /* GDB thinks the function starts here and + wants a standard prolog, so let's give it */ + pushl %ebp + movl %esp,%ebp + popl %ebp +#endif + /* Allocate room for argument list from kernel stack */ movl %es:_KeServiceDescriptorTableShadow + 28, %ecx movl %es:(%ecx, %eax, 4), %ecx