reset libunwind before init context in native stack trace

svn: r14262
This commit is contained in:
Matthew Flatt 2009-03-25 12:18:07 +00:00
parent 9f6c90c5e8
commit 15267c26b4

View File

@ -8436,16 +8436,6 @@ Scheme_Object *scheme_native_stack_trace(void)
check_stack();
#endif
#ifdef MZ_USE_DWARF_LIBUNWIND
unw_getcontext(&cx);
unw_init_local(&c, &cx);
use_unw = 1;
p = NULL;
#else
gs = (Get_Stack_Proc)get_stack_pointer_code;
p = gs();
#endif
stack_start = scheme_approx_sp();
if (stack_cache_stack_pos) {
@ -8462,6 +8452,16 @@ Scheme_Object *scheme_native_stack_trace(void)
unw_reset_bad_ptr_flag();
#endif
#ifdef MZ_USE_DWARF_LIBUNWIND
unw_getcontext(&cx);
unw_init_local(&c, &cx);
use_unw = 1;
p = NULL;
#else
gs = (Get_Stack_Proc)get_stack_pointer_code;
p = gs();
#endif
halfway = STK_DIFF(stack_end, (unsigned long)p) / 2;
if (halfway < CACHE_STACK_MIN_TRIGGER)
halfway = stack_end;