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