From 69bb29ced960e9e126d82c67c446645588b2f195 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 25 Jun 2009 12:02:59 +0200 Subject: [PATCH] kernel32: Add call frame annotations in x86 assembly code. --- dlls/kernel32/relay16.c | 49 ++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/dlls/kernel32/relay16.c b/dlls/kernel32/relay16.c index a2a550cc23f..b3ac234af33 100644 --- a/dlls/kernel32/relay16.c +++ b/dlls/kernel32/relay16.c @@ -283,26 +283,35 @@ static const CALLFROM16 *get_entry_point( STACK16FRAME *frame, LPSTR module, LPS extern int call_entry_point( void *func, int nb_args, const int *args ); __ASM_GLOBAL_FUNC( call_entry_point, - "\tpushl %ebp\n" - "\tmovl %esp,%ebp\n" - "\tpushl %esi\n" - "\tpushl %edi\n" - "\tmovl 12(%ebp),%edx\n" - "\tshll $2,%edx\n" - "\tjz 1f\n" - "\tsubl %edx,%esp\n" - "\tandl $~15,%esp\n" - "\tmovl 12(%ebp),%ecx\n" - "\tmovl 16(%ebp),%esi\n" - "\tmovl %esp,%edi\n" - "\tcld\n" - "\trep; movsl\n" - "1:\tcall *8(%ebp)\n" - "\tleal -8(%ebp),%esp\n" - "\tpopl %edi\n" - "\tpopl %esi\n" - "\tpopl %ebp\n" - "\tret" ) + "pushl %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 %esi\n\t" + __ASM_CFI(".cfi_rel_offset %esi,-4\n\t") + "pushl %edi\n\t" + __ASM_CFI(".cfi_rel_offset %edi,-8\n\t") + "movl 12(%ebp),%edx\n\t" + "shll $2,%edx\n\t" + "jz 1f\n\t" + "subl %edx,%esp\n\t" + "andl $~15,%esp\n\t" + "movl 12(%ebp),%ecx\n\t" + "movl 16(%ebp),%esi\n\t" + "movl %esp,%edi\n\t" + "cld\n\t" + "rep; movsl\n" + "1:\tcall *8(%ebp)\n\t" + "leal -8(%ebp),%esp\n\t" + "popl %edi\n\t" + __ASM_CFI(".cfi_same_value %edi\n\t") + "popl %esi\n\t" + __ASM_CFI(".cfi_same_value %esi\n\t") + "popl %ebp\n\t" + __ASM_CFI(".cfi_def_cfa %esp,4\n\t") + __ASM_CFI(".cfi_same_value %ebp\n\t") + "ret" ) /***********************************************************************