Commit 0cb406ef authored by Alexandre Julliard's avatar Alexandre Julliard

msvcrt: Add call frame annotations in x86 assembly code.

parent e1f0a0db
......@@ -413,14 +413,22 @@ extern DWORD CDECL __CxxFrameHandler( PEXCEPTION_RECORD rec, EXCEPTION_REGISTRAT
PCONTEXT context, EXCEPTION_REGISTRATION_RECORD** dispatch );
__ASM_GLOBAL_FUNC( __CxxFrameHandler,
"pushl $0\n\t" /* nested_trylevel */
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"pushl $0\n\t" /* nested_frame */
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"pushl %eax\n\t" /* descr */
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"pushl 28(%esp)\n\t" /* dispatch */
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"pushl 28(%esp)\n\t" /* context */
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"pushl 28(%esp)\n\t" /* frame */
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"pushl 28(%esp)\n\t" /* rec */
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"call " __ASM_NAME("cxx_frame_handler") "\n\t"
"add $28,%esp\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset -28\n\t")
"ret" )
......
......@@ -117,14 +117,19 @@ static DWORD MSVCRT_nested_handler(PEXCEPTION_RECORD rec,
/* Provided for VC++ binary compatibility only */
__ASM_GLOBAL_FUNC(_EH_prolog,
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") /* skip ret addr */
"pushl $-1\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"pushl %eax\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"pushl %fs:0\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"movl %esp, %fs:0\n\t"
"movl 12(%esp), %eax\n\t"
"movl %ebp, 12(%esp)\n\t"
"leal 12(%esp), %ebp\n\t"
"pushl %eax\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"ret")
static void msvcrt_local_unwind2(MSVCRT_EXCEPTION_FRAME* frame, int trylevel, void *ebp)
......
......@@ -138,7 +138,10 @@ __ASM_GLOBAL_FUNC(_chkesp,
"jnz 1f\n\t"
"ret\n"
"1:\tpushl %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")
"subl $12,%esp\n\t"
"pushl %eax\n\t"
"pushl %ecx\n\t"
......@@ -148,6 +151,8 @@ __ASM_GLOBAL_FUNC(_chkesp,
"popl %ecx\n\t"
"popl %eax\n\t"
"leave\n\t"
__ASM_CFI(".cfi_def_cfa %esp,4\n\t")
__ASM_CFI(".cfi_same_value %ebp\n\t")
"ret")
void CDECL MSVCRT_chkesp_fail(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment