From: Mateusz Moscicki Date: Wed, 18 Nov 2020 11:52:06 +0000 (+0100) Subject: Merge branch 'upstream' into tizen X-Git-Tag: submit/tizen/20201120.151306~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F247943%2F1;p=platform%2Fupstream%2Flibunwind.git Merge branch 'upstream' into tizen Change-Id: I096f682ce2462ae947c230ccaea37e26c195fd77 --- c2399c9626da43ddc07c147db57f6759b2a019a7 diff --cc include/libunwind-aarch64.h index 360a053,85812e1..1e25c2a --- a/include/libunwind-aarch64.h +++ b/include/libunwind-aarch64.h @@@ -175,9 -175,31 +175,32 @@@ typedef ucontext_t unw_tdep_context_t #include "libunwind-common.h" #include "libunwind-dynamic.h" - #define unw_tdep_getcontext(uc) (getcontext (uc), 0) - #define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) + #define unw_tdep_getcontext(uc) (({ \ + unw_tdep_context_t *unw_ctx = (uc); \ + register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs; \ + __asm__ __volatile__ ( \ + "stp x0, x1, [%[base], #0]\n" \ + "stp x2, x3, [%[base], #16]\n" \ + "stp x4, x5, [%[base], #32]\n" \ + "stp x6, x7, [%[base], #48]\n" \ + "stp x8, x9, [%[base], #64]\n" \ + "stp x10, x11, [%[base], #80]\n" \ + "stp x12, x13, [%[base], #96]\n" \ + "stp x14, x13, [%[base], #112]\n" \ + "stp x16, x17, [%[base], #128]\n" \ + "stp x18, x19, [%[base], #144]\n" \ + "stp x20, x21, [%[base], #160]\n" \ + "stp x22, x23, [%[base], #176]\n" \ + "stp x24, x25, [%[base], #192]\n" \ + "stp x26, x27, [%[base], #208]\n" \ + "stp x28, x29, [%[base], #224]\n" \ + "str x30, [%[base], #240]\n" \ + "mov x1, sp\n" \ + "stp x1, x30, [%[base], #248]\n" \ + : [base] "+r" (unw_base) : : "x1", "memory"); \ + }), 0) + #define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) +#define _UPT_get_fpreg(fpreg, reg) &fpreg.vregs[reg] extern int unw_tdep_is_fpreg (int); diff --cc src/arm/Gtrace.c index 135563a,2f27752..7454428 --- a/src/arm/Gtrace.c +++ b/src/arm/Gtrace.c @@@ -513,6 -513,9 +513,7 @@@ tdep_trace (unw_cursor_t *cursor, void doesn't save the link register in the prologue, e.g. kill. */ if (likely(ret >= 0)) ACCESS_MEM_FAST(ret, c->validate, d, cfa + LINUX_SC_LR_OFF, lr); -#elif defined(__FreeBSD__) - printf("XXX\n"); + #endif /* Resume stack at signal restoration point. The stack is not necessarily continuous here, especially with sigaltstack(). */ @@@ -522,6 -525,10 +523,9 @@@ d->use_prev_instr = 0; break; + case UNW_ARM_FRAME_SYSCALL: - printf("XXX1\n"); + break; + default: /* We cannot trace through this frame, give up and tell the caller we had to stop. Data collected so far may still be diff --cc src/mips/unwind_i.h index 0000000,0000000..3382dcf new file mode 100644 --- /dev/null +++ b/src/mips/unwind_i.h @@@ -1,0 -1,0 +1,43 @@@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#ifndef unwind_i_h ++#define unwind_i_h ++ ++#include ++ ++#include ++ ++#include "libunwind_i.h" ++ ++#define mips_lock UNW_OBJ(lock) ++#define mips_local_resume UNW_OBJ(local_resume) ++#define mips_local_addr_space_init UNW_OBJ(local_addr_space_init) ++ ++extern int mips_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, ++ void *arg); ++ ++extern void mips_local_addr_space_init (void); ++ ++#endif /* unwind_i_h */ diff --cc src/tilegx/unwind_i.h index 0000000,0000000..9d41c90 new file mode 100644 --- /dev/null +++ b/src/tilegx/unwind_i.h @@@ -1,0 -1,0 +1,46 @@@ ++/* libunwind - a platform-independent unwind library ++ Copyright (C) 2008 CodeSourcery ++ ++This file is part of libunwind. ++ ++Permission is hereby granted, free of charge, to any person obtaining ++a copy of this software and associated documentation files (the ++"Software"), to deal in the Software without restriction, including ++without limitation the rights to use, copy, modify, merge, publish, ++distribute, sublicense, and/or sell copies of the Software, and to ++permit persons to whom the Software is furnished to do so, subject to ++the following conditions: ++ ++The above copyright notice and this permission notice shall be ++included in all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++#ifndef unwind_i_h ++#define unwind_i_h ++ ++#include ++#include ++ ++#include ++ ++#include "libunwind_i.h" ++ ++#define tilegx_local_resume UNW_OBJ(local_resume) ++#define tilegx_local_addr_space_init UNW_OBJ(local_addr_space_init) ++ ++extern int tilegx_local_resume (unw_addr_space_t as, ++ unw_cursor_t *cursor, ++ void *arg); ++#define tilegx_handle_signal_frame UNW_OBJ(handle_signal_frame) ++extern int tilegx_handle_signal_frame(unw_cursor_t *cursor); ++ ++extern void tilegx_local_addr_space_init (void); ++ ++#endif /* unwind_i_h */