Author: tkreuzer
Date: Sun Jul 17 00:38:46 2011
New Revision: 52705
URL:
http://svn.reactos.org/svn/reactos?rev=52705&view=rev
Log:
[ASM]
Generate MSVC debugging info for KiUserExceptionDispatcher, KiIntSystemCall,
KiFastSystemCall, KiFastSystemCallRet, KiSystemService, KiFastCallEntry, all systemcall
stubs
Now usermode backtraces look as they should in WinDbg
Modified:
trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S
trunk/reactos/include/asm/asm.inc
trunk/reactos/include/asm/syscalls.inc
trunk/reactos/include/reactos/asm.inc
trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S
trunk/reactos/ntoskrnl/ke/i386/trap.s
Modified: trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/dispatch/i386/di…
==============================================================================
--- trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S [iso-8859-1] Sun Jul 17 00:38:46
2011
@@ -184,7 +184,8 @@
PUBLIC _KiUserExceptionDispatcher@8
-_KiUserExceptionDispatcher@8:
+.PROC KiUserExceptionDispatcher@8
+ FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Clear direction flag */
cld
@@ -240,9 +241,11 @@
call _RtlRaiseException@4
ret 8
+.ENDP KiUserExceptionDispatcher@8
PUBLIC _KiIntSystemCall@0
-_KiIntSystemCall@0:
+.PROC KiIntSystemCall@0
+ FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Set stack in EDX and do the interrupt */
lea edx, [esp+8]
@@ -251,21 +254,26 @@
/* Return to caller */
ret
+.ENDP KiIntSystemCall@0
PUBLIC _KiFastSystemCall@0
-_KiFastSystemCall@0:
+.PROC KiFastSystemCall@0
+ FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Put ESP in EDX and do the SYSENTER */
mov edx, esp
sysenter
+.ENDP KiFastSystemCall@0
PUBLIC _KiFastSystemCallRet@0
-_KiFastSystemCallRet@0:
+.PROC KiFastSystemCallRet@0
+ FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Just return to caller */
ret
+.ENDP KiFastSystemCallRet@0
PUBLIC _RtlpGetStackLimits@8
_RtlpGetStackLimits@8:
Modified: trunk/reactos/include/asm/asm.inc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/asm.inc?rev=52…
==============================================================================
--- trunk/reactos/include/asm/asm.inc [iso-8859-1] (original)
+++ trunk/reactos/include/asm/asm.inc [iso-8859-1] Sun Jul 17 00:38:46 2011
@@ -327,3 +327,10 @@
#define NUL "\0"
#endif
+
+/* Common definitions for FPO macro
+ see
http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx */
+#define FRAME_FPO 0
+#define FRAME_TRAP 1
+#define FRAME_TSS 2
+#define FRAME_NONFPO 3
Modified: trunk/reactos/include/asm/syscalls.inc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/syscalls.inc?r…
==============================================================================
--- trunk/reactos/include/asm/syscalls.inc [iso-8859-1] (original)
+++ trunk/reactos/include/asm/syscalls.inc [iso-8859-1] Sun Jul 17 00:38:46 2011
@@ -71,24 +71,42 @@
PUBLIC _&Name&@&Stackbytes
_&Name&@&Stackbytes:
ENDM
+MACRO(START_PROC, Name, Stackbytes)
+ PUBLIC _&Name&@&Stackbytes
+ .PROC &Name&@&Stackbytes
+ FPO 0, 0, 0, 0, 0, FRAME_FPO
+ENDM
+MACRO(END_PROC, Name, Stackbytes)
+ .ENDP &Name&@&Stackbytes
+ENDM
#else
MACRO(MAKE_LABEL, Name, Stackbytes)
PUBLIC &Name
&Name:
+ENDM
+MACRO(START_PROC, Name, Stackbytes)
+ PUBLIC &Name
+ .PROC &Name
+ FPO 0, 0, 0, 0, 0, FRAME_FPO
+ENDM
+MACRO(END_PROC, Name, Stackbytes)
+ .ENDP &Name
ENDM
#endif
MACRO(STUB_U, Name, ArgCount)
Stackbytes = 4 * &ArgCount
MAKE_LABEL Zw&Name, %Stackbytes
- MAKE_LABEL Nt&Name, %Stackbytes
+ START_PROC Nt&Name, %Stackbytes
STUBCODE_U SyscallId, %Stackbytes
+ END_PROC Nt&Name, %Stackbytes
SyscallId = SyscallId + 1
ENDM
MACRO(STUB_K, Name, ArgCount)
Stackbytes = 4 * &ArgCount
- MAKE_LABEL Zw&Name, %Stackbytes
+ START_PROC Zw&Name, %Stackbytes
STUBCODE_K SyscallId, %Stackbytes
+ END_PROC Zw&Name, %Stackbytes
SyscallId = SyscallId + 1
ENDM
Modified: trunk/reactos/include/reactos/asm.inc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/asm.inc?re…
==============================================================================
--- trunk/reactos/include/reactos/asm.inc [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/asm.inc [iso-8859-1] Sun Jul 17 00:38:46 2011
@@ -271,4 +271,11 @@
#endif
+/* Common definitions for FPO macro
+ see
http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx */
+#define FRAME_FPO 0
+#define FRAME_TRAP 1
+#define FRAME_TSS 2
+#define FRAME_NONFPO 3
+
#endif /* _ASM_INC_ */
Modified: trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S [iso-8859-1] Sun Jul 17
00:38:46 2011
@@ -216,8 +216,6 @@
nop
ENDM
-#define FRAME_TRAP 1
-
MACRO(TRAP_ENTRY, Trap, Flags)
EXTERN @&Trap&Handler@4 :PROC
PUBLIC _&Trap
Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] Sun Jul 17 00:38:46 2011
@@ -126,15 +126,19 @@
EXTERN @KiSystemServiceHandler@8:PROC
PUBLIC _KiSystemService
-_KiSystemService:
+.PROC KiSystemService
+ FPO 0, 0, 0, 0, 1, FRAME_TRAP
KiEnterTrap (KI_PUSH_FAKE_ERROR_CODE OR KI_NONVOLATILES_ONLY OR KI_DONT_SAVE_SEGS)
KiCallHandler @KiSystemServiceHandler@8
+.ENDP KiSystemService
EXTERN @KiFastCallEntryHandler@8:PROC
PUBLIC _KiFastCallEntry
-_KiFastCallEntry:
+.PROC KiFastCallEntry
+ FPO 0, 0, 0, 0, 1, FRAME_TRAP
KiEnterTrap (KI_FAST_SYSTEM_CALL OR KI_NONVOLATILES_ONLY OR KI_DONT_SAVE_SEGS)
KiCallHandler @KiFastCallEntryHandler@8
+.ENDP KiFastCallEntry
PUBLIC _KiStartUnexpectedRange@0
_KiStartUnexpectedRange@0: