]> git.lizzy.rs Git - rust.git/commitdiff
rt: Rename asm_call_on_stack to __morestack
authorBrian Anderson <banderson@mozilla.com>
Tue, 20 Dec 2011 03:50:52 +0000 (19:50 -0800)
committerBrian Anderson <banderson@mozilla.com>
Tue, 20 Dec 2011 06:05:40 +0000 (22:05 -0800)
Newer gdb's will backtrace through functions named __morestack even
if they change the stack.

src/rt/arch/i386/ccall.S
src/rt/arch/i386/context.h
src/rt/arch/x86_64/ccall.S
src/rt/arch/x86_64/context.h
src/rt/rustrt.def.in

index 76edf84e8d044213627b08201538d206eee7c2c5..a8b89dc6b0f8bbc35bb871b219cd787443f3e4d1 100644 (file)
@@ -1,11 +1,19 @@
-    .text
+/*
+       The function for switching to the C stack.  It is called
+       __morestack because gdb allows any frame with that name to
+       move the stack pointer to a different stack, which it usually
+       considers an error.
+*/
+
+       .text
 
 #if defined(__APPLE__) || defined(_WIN32)
-.globl _asm_call_on_stack
-_asm_call_on_stack:
+.globl ___morestack
+___morestack:
 #else
-.globl asm_call_on_stack
-asm_call_on_stack:
+.globl __morestack
+.hidden __morestack
+__morestack:
 #endif
 
 #if defined(__linux__) || defined(__APPLE__)
index 03b97fa7b517774d61d3c268fc2f7a6ff5a989c5..13775f95510715e92172761b9619dfe6771885d3 100644 (file)
@@ -29,7 +29,7 @@ struct registers_t {
   uint32_t eip;
 };
 
-extern "C" void asm_call_on_stack(void *args, void *fn_ptr, uintptr_t stack_ptr);
+extern "C" void __morestack(void *args, void *fn_ptr, uintptr_t stack_ptr);
 
 class context {
 public:
@@ -57,7 +57,7 @@ public:
   }
 
   void call_shim_on_c_stack(void *args, void *fn_ptr) {
-      asm_call_on_stack(args, fn_ptr, regs.esp);
+      __morestack(args, fn_ptr, regs.esp);
   }
 };
 
index e74b8677a4a88b7aee595c22987a25d7012213c8..c208c7ae643370703eac28e8f03cd05961bd5d23 100644 (file)
@@ -1,3 +1,10 @@
+/*
+       The function for switching to the C stack.  It is called
+       __morestack because gdb allows any frame with that name to
+       move the stack pointer to a different stack, which it usually
+       considers an error.
+*/
+
 #include "regs.h"
 
 #define ARG0 RUSTRT_ARG0_S
         .text
 
 #if defined(__APPLE__) || defined(_WIN32)
-.globl _asm_call_on_stack
-_asm_call_on_stack:
+.globl ___morestack
+.private_extern MORESTACK
+___morestack:
 #else
-.globl asm_call_on_stack
-asm_call_on_stack:
+.globl __morestack
+.hidden __morestack
+__morestack:
 #endif
 
 #if defined(__linux__) || defined(__APPLE__)
index 59d7bfa51f33740ffe49f23014b8d31e69655621..75902fd79548545550d9149e7b799219747ea45e 100644 (file)
@@ -27,7 +27,7 @@ struct registers_t {
     uint64_t data[RUSTRT_MAX];
 };
 
-extern "C" void asm_call_on_stack(void *args, void *fn_ptr, uintptr_t stack_ptr);
+extern "C" void __morestack(void *args, void *fn_ptr, uintptr_t stack_ptr);
 
 class context {
 public:
@@ -55,7 +55,7 @@ public:
     }
 
     void call_shim_on_c_stack(void *args, void *fn_ptr) {
-        asm_call_on_stack(args, fn_ptr, regs.data[RUSTRT_RSP]);
+        __morestack(args, fn_ptr, regs.data[RUSTRT_RSP]);
     }
 };
 
index ff16cde5b1893571a5cd3f1b4bfb772281794787..8353483ebf243da3f06d91a1826855b19cde2cfe 100644 (file)
@@ -73,7 +73,6 @@ upcall_call_shim_on_c_stack
 upcall_new_stack
 upcall_del_stack
 upcall_reset_stack_limit
-asm_call_on_stack
 rust_uv_default_loop
 rust_uv_loop_new
 rust_uv_loop_delete