rt: Rename asm_call_on_stack to __morestack

Newer gdb's will backtrace through functions named __morestack even
if they change the stack.
This commit is contained in:
Brian Anderson 2011-12-19 19:50:52 -08:00
parent f302b79d61
commit 05bf105c90
5 changed files with 30 additions and 14 deletions

View 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__)

View 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);
}
};

View 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
@ -7,11 +14,13 @@
.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__)

View 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]);
}
};

View 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