Alexandre Julliard : rpcrt4: Add call frame annotations in x86 assembly code.

Alexandre Julliard julliard at winehq.org
Thu Jun 25 08:13:57 CDT 2009


Module: wine
Branch: master
Commit: b6efd13ef5c7f1b458c49aef3cb4e6a3bc6a46bd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b6efd13ef5c7f1b458c49aef3cb4e6a3bc6a46bd

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jun 25 11:51:30 2009 +0200

rpcrt4: Add call frame annotations in x86 assembly code.

---

 dlls/rpcrt4/cproxy.c       |    2 ++
 dlls/rpcrt4/ndr_stubless.c |   13 +++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/dlls/rpcrt4/cproxy.c b/dlls/rpcrt4/cproxy.c
index 0887aa2..9ce555f 100644
--- a/dlls/rpcrt4/cproxy.c
+++ b/dlls/rpcrt4/cproxy.c
@@ -76,8 +76,10 @@ struct thunk {
 extern void call_stubless_func(void);
 __ASM_GLOBAL_FUNC(call_stubless_func,
                   "pushl %esp\n\t"  /* pointer to index */
+                  __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
                   "call " __ASM_NAME("ObjectStubless") __ASM_STDCALL(4) "\n\t"
                   "popl %edx\n\t"  /* args size */
+                  __ASM_CFI(".cfi_adjust_cfa_offset -4\n\t")
                   "movl (%esp),%ecx\n\t"  /* return address */
                   "addl %edx,%esp\n\t"
                   "jmp *%ecx" );
diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c
index 6a3854e..8cb5f2b 100644
--- a/dlls/rpcrt4/ndr_stubless.c
+++ b/dlls/rpcrt4/ndr_stubless.c
@@ -867,9 +867,14 @@ __declspec(naked) LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigne
 LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char * args, unsigned int stack_size);
 __ASM_GLOBAL_FUNC(call_server_func,
     "pushl %ebp\n\t"
-    "movl %esp, %ebp\n\t"
+    __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
+    __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
+    "movl %esp,%ebp\n\t"
+    __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
     "pushl %edi\n\t"            /* Save registers */
+    __ASM_CFI(".cfi_rel_offset %edi,-4\n\t")
     "pushl %esi\n\t"
+    __ASM_CFI(".cfi_rel_offset %esi,-8\n\t")
     "movl 16(%ebp), %eax\n\t"   /* Get stack size */
     "subl %eax, %esp\n\t"       /* Make room in stack for arguments */
     "andl $~15, %esp\n\t"	/* Make sure stack has 16-byte alignment for Mac OS X */
@@ -882,9 +887,13 @@ __ASM_GLOBAL_FUNC(call_server_func,
     "call *8(%ebp)\n\t"         /* Call function */
     "leal -8(%ebp), %esp\n\t"   /* Restore stack */
     "popl %esi\n\t"             /* Restore registers */
+    __ASM_CFI(".cfi_same_value %esi\n\t")
     "popl %edi\n\t"
+    __ASM_CFI(".cfi_same_value %edi\n\t")
     "popl %ebp\n\t"
-    "ret\n" )
+    __ASM_CFI(".cfi_def_cfa %esp,4\n\t")
+    __ASM_CFI(".cfi_same_value %ebp\n\t")
+    "ret" )
 #else
 #warning call_server_func not implemented for your architecture
 LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char * args, unsigned short stack_size)




More information about the wine-cvs mailing list