about summary refs log tree commit diff
path: root/src/rt/arch
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-12-17 13:51:35 -0800
committerBrian Anderson <banderson@mozilla.com>2011-12-17 14:10:44 -0800
commit471b4d6e58baba9ee880c8c8f4183bcf363708cf (patch)
treeb24a5ac47efe8983b848991d699869305c199a10 /src/rt/arch
parent7da8ab8fab81781665fd38299645dc74a6d5ddd2 (diff)
downloadrust-471b4d6e58baba9ee880c8c8f4183bcf363708cf.tar.gz
rust-471b4d6e58baba9ee880c8c8f4183bcf363708cf.zip
rt: Use a DWARF CFI scheme that works on mac in __morestack
Diffstat (limited to 'src/rt/arch')
-rw-r--r--src/rt/arch/i386/morestack.S16
-rw-r--r--src/rt/arch/x86_64/morestack.S14
2 files changed, 6 insertions, 24 deletions
diff --git a/src/rt/arch/i386/morestack.S b/src/rt/arch/i386/morestack.S
index 6d67984c91b..6e53ef850a0 100644
--- a/src/rt/arch/i386/morestack.S
+++ b/src/rt/arch/i386/morestack.S
@@ -53,8 +53,8 @@ MORESTACK:
 
 	pushl %ebp
 #if defined(__linux__) || defined(__APPLE__)
-	.cfi_def_cfa_offset 8
-	.cfi_offset %ebp, -8
+	.cfi_def_cfa_offset 20
+	.cfi_offset %ebp, -20
 #endif
 	movl %esp, %ebp
 #if defined(__linux__) || defined(__APPLE__)
@@ -79,16 +79,6 @@ MORESTACK:
 	testl %eax,%eax
 	jz .L$bail
 
-	// During unwinding we want to skip our caller.
-#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
-	// The next frame's esp is stored at our CFA - 12
-	// (by the code below)
-	.cfi_offset %esp, -12
-#endif
-
 	// Save the the correct %esp value for our grandparent frame,
 	// for the unwinder
 	leal 20(%ebp), %eax
@@ -156,7 +146,7 @@ MORESTACK:
 	popl %ebp
 #if defined(__linux__) || defined(__APPLE__)
 	.cfi_restore %ebp
-	.cfi_def_cfa %esp, 4
+	.cfi_def_cfa %esp, 16
 #endif
 	retl $8
 
diff --git a/src/rt/arch/x86_64/morestack.S b/src/rt/arch/x86_64/morestack.S
index 369e4a340e0..5378a1dcc60 100644
--- a/src/rt/arch/x86_64/morestack.S
+++ b/src/rt/arch/x86_64/morestack.S
@@ -54,19 +54,11 @@ MORESTACK:
 	
 	// Set up a normal backtrace
 	pushq %rbp
-	.cfi_def_cfa_offset 16
-	.cfi_offset %rbp, -16
+	.cfi_def_cfa_offset 24
+	.cfi_offset %rbp, -24
 	movq %rsp, %rbp
 	.cfi_def_cfa_register %rbp
 
-	// During unwinding we want to skip our caller since it's not
-	// a complete frame and will make the unwinder sad
-	// 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
-
 	// Save the grandparent stack pointer for the unwinder
 	leaq 24(%rbp), %rax
 	pushq %rax
@@ -140,7 +132,7 @@ MORESTACK:
 	addq $8, %rsp
 	popq %rbp
 	.cfi_restore %rbp
-	.cfi_def_cfa %rsp, 8
+	.cfi_def_cfa %rsp, 16
 	ret
 	
 	.cfi_endproc