diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-12-11 17:50:12 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-12-11 18:49:04 -0800 |
| commit | 7a8e73662dd0847ee351a3cdcaf27b0be8299902 (patch) | |
| tree | bfa9403e403d1e418a8c0f9a3853333df2411d9e /src/rt/arch | |
| parent | 7bc34f63d85ee7d351b90320239fc48860f01da2 (diff) | |
| download | rust-7a8e73662dd0847ee351a3cdcaf27b0be8299902.tar.gz rust-7a8e73662dd0847ee351a3cdcaf27b0be8299902.zip | |
rt: Make unwinding through __morestack work on mac
Had to bump the min stack size in some of the tests from 256 bytes to 1024 bytes. Not sure why yet.
Diffstat (limited to 'src/rt/arch')
| -rw-r--r-- | src/rt/arch/i386/morestack.S | 12 | ||||
| -rw-r--r-- | src/rt/arch/x86_64/morestack.S | 12 |
2 files changed, 6 insertions, 18 deletions
diff --git a/src/rt/arch/i386/morestack.S b/src/rt/arch/i386/morestack.S index 23aa36353a1..b30a5af2152 100644 --- a/src/rt/arch/i386/morestack.S +++ b/src/rt/arch/i386/morestack.S @@ -47,17 +47,17 @@ #endif MORESTACK: -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) .cfi_startproc #endif pushl %ebp -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) .cfi_def_cfa_offset 8 .cfi_offset %ebp, -8 #endif movl %esp, %ebp -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) .cfi_def_cfa_register %ebp #endif @@ -69,7 +69,7 @@ MORESTACK: jz .L$bail // During unwinding we want to skip our caller. -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) // Don't understand this line. I think it means that // the next frame's pc is the return address of our caller. .cfi_offset 8, 8 @@ -134,7 +134,7 @@ MORESTACK: addl $16,%esp popl %ebp -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) .cfi_restore %ebp .cfi_def_cfa %esp, 4 #endif @@ -150,7 +150,7 @@ MORESTACK: jmpl *%edx -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) .cfi_endproc #endif diff --git a/src/rt/arch/x86_64/morestack.S b/src/rt/arch/x86_64/morestack.S index fafedb54418..6686071361b 100644 --- a/src/rt/arch/x86_64/morestack.S +++ b/src/rt/arch/x86_64/morestack.S @@ -50,30 +50,22 @@ #if defined(__linux__) || defined(__APPLE__) MORESTACK: -#if defined(__ELF__) .cfi_startproc -#endif // Set up a normal backtrace pushq %rbp -#if defined(__ELF__) .cfi_def_cfa_offset 16 .cfi_offset %rbp, -16 -#endif movq %rsp, %rbp -#if defined(__ELF__) .cfi_def_cfa_register %rbp -#endif // During unwinding we want to skip our caller since it's not // a complete frame and will make the unwinder sad -#if defined(__linux__) // Don't understand this line .cfi_offset 16, 0 // Tell the unwinding where to get the stack pointer for // our grandparent frame .cfi_offset %rsp, -24 -#endif // Save the grandparent stack pointer for the unwinder leaq 16(%rbp), %rax @@ -147,15 +139,11 @@ MORESTACK: addq $8, %rsp popq %rbp -#ifdef __linux__ .cfi_restore %rbp .cfi_def_cfa %rsp, 8 -#endif ret -#if defined(__ELF__) .cfi_endproc -#endif #else MORESTACK: |
