Commit in reactos/ntoskrnl/ke/i386 on MAIN
syscall.S+26-11.12 -> 1.13
Allow GDB 6 to backtrace over a syscall

reactos/ntoskrnl/ke/i386
syscall.S 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- syscall.S	20 Jun 2003 16:21:11 -0000	1.12
+++ syscall.S	29 Mar 2004 22:29:34 -0000	1.13
@@ -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 <ddk/status.h>
 #include <internal/i386/segment.h>
 #include <internal/ps.h>
+#include <roscfg.h>
 
 #define KernelMode  (0)
 #define UserMode    (1)
@@ -92,9 +93,17 @@
 	   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 @@
 
 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_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
CVSspam 0.2.8