Author: tkreuzer
Date: Sat Jul 9 19:15:34 2011
New Revision: 52586
URL:
http://svn.reactos.org/svn/reactos?rev=52586&view=rev
Log:
[NTOSKRNL]
Update TRAP_ENTRY macro to generate debugging information. Now WinDbg knows how to deal
with the trap functions and also shows the user mode back traces.
Modified:
trunk/reactos/include/asm/asm.inc
trunk/reactos/include/reactos/asm.inc
trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S
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] Sat Jul 9 19:15:34 2011
@@ -32,16 +32,21 @@
/* To avoid reverse syntax we provide a new macro .PROC, replacing PROC... */
.PROC MACRO name
- name PROC FRAME
- _name:
+ _&name PROC
ENDM
#define FUNC .PROC
/* ... and .ENDP, replacing ENDP */
.ENDP MACRO name
- name ENDP
+ _&name ENDP
ENDM
#define ENDFUNC .ENDP
+
+/* check
http://msdn.microsoft.com/en-us/library/9c9k076y%28VS.80%29.aspx
+ and
http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx */
+FPO MACRO cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame
+ .FPO (cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame)
+ENDM
/* MASM doesn't have an ASCII macro */
.ASCII MACRO text:VARARG
@@ -184,7 +189,7 @@
/* To avoid reverse syntax we provide a new macro .PROC, replacing PROC... */
.macro .PROC name
.func \name
- \name:
+ _\name:
.cfi_startproc
.equ cfa_current_offset, -8
.endm
@@ -235,6 +240,12 @@
.macro .code
.text
+.endm
+
+/* check
http://msdn.microsoft.com/en-us/library/9c9k076y%28VS.80%29.aspx
+ and
http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx */
+.macro FPO cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame
+ /* dummy */
.endm
/* Macros for x64 stack unwind OPs */
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] Sat Jul 9 19:15:34 2011
@@ -41,6 +41,12 @@
name ENDP
ENDM
+/* check
http://msdn.microsoft.com/en-us/library/9c9k076y%28VS.80%29.aspx
+ and
http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx */
+FPO MACRO cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame
+ .FPO (cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame)
+ENDM
+
/* MASM doesn't have an ASCII macro */
.ASCII MACRO text
DB text
@@ -143,7 +149,7 @@
/* To avoid reverse syntax we provide a new macro .PROC, replacing PROC... */
.macro .PROC name
.func \name
- \name:
+ _\name:
.cfi_startproc
.equ cfa_current_offset, -8
.endm
@@ -190,6 +196,12 @@
.macro .code
.text
+.endm
+
+/* check
http://msdn.microsoft.com/en-us/library/9c9k076y%28VS.80%29.aspx
+ and
http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx */
+.macro FPO cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame
+ /* dummy */
.endm
/* Macros for x64 stack unwind OPs */
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] Sat Jul 9
19:15:34 2011
@@ -216,12 +216,21 @@
nop
ENDM
+#define FRAME_TRAP 1
+
MACRO(TRAP_ENTRY, Trap, Flags)
-EXTERN @&Trap&Handler@4 :PROC
+ EXTERN @&Trap&Handler@4 :PROC
PUBLIC _&Trap
- _&Trap:
- KiEnterTrap Flags
- KiCallHandler @&Trap&Handler@4
+ .PROC &Trap
+ /* Generate proper debugging symbols */
+ FPO 0, 0, 0, 0, 1, FRAME_TRAP
+
+ /* Common code to create the trap frame */
+ KiEnterTrap Flags
+
+ /* Call the C handler */
+ KiCallHandler @&Trap&Handler@4
+ .ENDP &Trap
ENDM
#define KI_RESTORE_EAX HEX(001)