From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9395 invoked by alias); 5 Feb 2008 21:08:37 -0000 Received: (qmail 9249 invoked by uid 9112); 5 Feb 2008 21:08:26 -0000 Date: Tue, 05 Feb 2008 21:08:00 -0000 Message-ID: <20080205210826.9234.qmail@sourceware.org> From: mark@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Merge commit 'origin' X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 154edcc30cc41ec5a2bb973ea632351cb67603b5 X-Git-Newrev: 5aeecb313a635e3523458519d0a741b36edd7fdc Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q1/txt/msg00155.txt.bz2 The branch, master has been updated via 5aeecb313a635e3523458519d0a741b36edd7fdc (commit) via 2f60bbf93d87b6e0cd7ea05bc826e104868f6aae (commit) via e865a5692d1da0739b37a8be1d4bd185e7707a20 (commit) from 154edcc30cc41ec5a2bb973ea632351cb67603b5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 5aeecb313a635e3523458519d0a741b36edd7fdc Merge: 2f60bbf93d87b6e0cd7ea05bc826e104868f6aae 154edcc30cc41ec5a2bb973ea632351cb67603b5 Author: Mark Wielaard Date: Tue Feb 5 22:06:26 2008 +0100 Merge commit 'origin' commit 2f60bbf93d87b6e0cd7ea05bc826e104868f6aae Merge: 7c08b13dc4b83fc468190c889ba3de2f7d8e83f7 e865a5692d1da0739b37a8be1d4bd185e7707a20 Author: Mark Wielaard Date: Tue Feb 5 21:48:54 2008 +0100 Merge branch 'vendor/LIBUNWIND' Conflicts: frysk-imports/libunwind/Makefile.in frysk-imports/libunwind/aclocal.m4 frysk-imports/libunwind/configure frysk-imports/libunwind/configure.in frysk-imports/libunwind/doc/Makefile.in frysk-imports/libunwind/src/Makefile.in frysk-imports/libunwind/src/dwarf/Gfde.c frysk-imports/libunwind/src/dwarf/Gfind_proc_info-lsb.c frysk-imports/libunwind/src/mi/Gget_reg.c frysk-imports/libunwind/tests/Makefile.in ----------------------------------------------------------------------- Summary of changes: frysk-imports/libunwind/Makefile.am | 8 + frysk-imports/libunwind/configure.in | 5 + frysk-imports/libunwind/include/dwarf.h | 19 +- frysk-imports/libunwind/include/dwarf_i.h | 72 ++- frysk-imports/libunwind/include/libunwind-arm.h | 298 ++++++++ .../{libunwind-x86_64.h => libunwind-mips.h} | 128 +++-- frysk-imports/libunwind/include/remote.h | 8 +- .../include/{tdep-x86 => tdep-arm}/dwarf-config.h | 15 +- .../include/{tdep-x86 => tdep-arm}/jmpbuf.h | 5 +- .../include/{tdep-x86 => tdep-arm}/libunwind_i.h | 28 +- .../libunwind/include/tdep-hppa/libunwind_i.h | 1 + .../{tdep-x86_64 => tdep-mips}/dwarf-config.h | 23 +- .../include/{tdep-x86 => tdep-mips}/jmpbuf.h | 5 +- .../include/{tdep-x86 => tdep-mips}/libunwind_i.h | 103 ++- .../libunwind/include/tdep-ppc32/libunwind_i.h | 1 + .../libunwind/include/tdep-ppc64/libunwind_i.h | 1 + .../libunwind/include/tdep-x86/libunwind_i.h | 1 + .../libunwind/include/tdep-x86_64/libunwind_i.h | 1 + frysk-imports/libunwind/src/Makefile.am | 118 +++- .../src/{hppa => arm}/Gcreate_addr_space.c | 15 +- .../libunwind/src/{ia64 => arm}/Gget_proc_info.c | 11 +- .../libunwind/src/{hppa => arm}/Gget_save_loc.c | 28 +- .../libunwind/src/{hppa => arm}/Gglobal.c | 21 +- frysk-imports/libunwind/src/{x86 => arm}/Ginit.c | 42 +- .../libunwind/src/{hppa => arm}/Ginit_local.c | 3 +- .../libunwind/src/{hppa => arm}/Ginit_remote.c | 3 +- .../_UPT_destroy.c => arm/Gis_signal_frame.c} | 15 +- frysk-imports/libunwind/src/{ppc32 => arm}/Gregs.c | 67 +- .../src/{ia64/Gget_proc_info.c => arm/Gresume.c} | 27 +- .../src/{ia64/Gget_proc_info.c => arm/Gstep.c} | 22 +- .../src/{hppa => arm}/Lcreate_addr_space.c | 0 .../libunwind/src/{hppa => arm}/Lget_proc_info.c | 0 .../libunwind/src/{hppa => arm}/Lget_save_loc.c | 0 .../libunwind/src/{hppa => arm}/Lglobal.c | 0 frysk-imports/libunwind/src/{hppa => arm}/Linit.c | 0 .../libunwind/src/{hppa => arm}/Linit_local.c | 0 .../libunwind/src/{hppa => arm}/Linit_remote.c | 0 .../libunwind/src/{hppa => arm}/Lis_signal_frame.c | 0 frysk-imports/libunwind/src/{hppa => arm}/Lregs.c | 0 .../libunwind/src/{hppa => arm}/Lresume.c | 0 frysk-imports/libunwind/src/{dwarf => arm}/Lstep.c | 0 frysk-imports/libunwind/src/arm/gen-offsets.c | 54 ++ .../arm/getcontext.S} | 59 +- frysk-imports/libunwind/src/{x86 => arm}/init.h | 42 +- .../libunwind/src/{x86_64 => arm}/is_fpreg.c | 19 +- frysk-imports/libunwind/src/arm/offsets.h | 36 + frysk-imports/libunwind/src/arm/regname.c | 90 +++ frysk-imports/libunwind/src/arm/siglongjmp.S | 8 + .../src/{mi/dyn-info-list.c => arm/unwind_i.h} | 21 +- frysk-imports/libunwind/src/dwarf/Gexpr.c | 60 ++- frysk-imports/libunwind/src/dwarf/Gfde.c | 73 ++- .../libunwind/src/dwarf/Gfind_proc_info-lsb.c | 734 +++++++++++++++++--- frysk-imports/libunwind/src/dwarf/Gpe.c | 2 + .../libunwind/src/mi/Gfind_dynamic_proc_info.c | 2 +- frysk-imports/libunwind/src/mi/Gget_reg.c | 4 +- frysk-imports/libunwind/src/mi/backtrace.c | 2 +- frysk-imports/libunwind/src/mi/dyn-info-list.c | 2 +- frysk-imports/libunwind/src/mi/flush_cache.c | 14 + .../src/{ia64 => mips}/Gcreate_addr_space.c | 28 +- .../libunwind/src/{ia64 => mips}/Gget_proc_info.c | 11 +- .../libunwind/src/{x86_64 => mips}/Gget_save_loc.c | 48 +- .../libunwind/src/{hppa => mips}/Gglobal.c | 21 +- frysk-imports/libunwind/src/{x86 => mips}/Ginit.c | 87 ++-- .../libunwind/src/{hppa => mips}/Ginit_local.c | 3 +- .../libunwind/src/{hppa => mips}/Ginit_remote.c | 3 +- .../_UPT_destroy.c => mips/Gis_signal_frame.c} | 15 +- .../libunwind/src/{ppc32 => mips}/Gregs.c | 85 ++- .../src/{ia64/Gget_proc_info.c => mips/Gresume.c} | 27 +- .../src/{ia64/Gget_proc_info.c => mips/Gstep.c} | 22 +- .../src/{hppa => mips}/Lcreate_addr_space.c | 0 .../libunwind/src/{hppa => mips}/Lget_proc_info.c | 0 .../libunwind/src/{hppa => mips}/Lget_save_loc.c | 0 .../libunwind/src/{hppa => mips}/Lglobal.c | 0 frysk-imports/libunwind/src/{hppa => mips}/Linit.c | 0 .../libunwind/src/{hppa => mips}/Linit_local.c | 0 .../libunwind/src/{hppa => mips}/Linit_remote.c | 0 .../src/{hppa => mips}/Lis_signal_frame.c | 0 frysk-imports/libunwind/src/{hppa => mips}/Lregs.c | 0 .../libunwind/src/{hppa => mips}/Lresume.c | 0 .../libunwind/src/{dwarf => mips}/Lstep.c | 0 .../src/{ptrace/_UPT_destroy.c => mips/elfxx.c} | 11 +- frysk-imports/libunwind/src/mips/gen-offsets.c | 30 + .../src/{ia64/siglongjmp.S => mips/getcontext.S} | 102 ++-- frysk-imports/libunwind/src/{hppa => mips}/init.h | 23 +- .../libunwind/src/{ppc32 => mips}/is_fpreg.c | 11 +- frysk-imports/libunwind/src/mips/offsets.h | 39 + .../libunwind/src/{x86_64 => mips}/regname.c | 30 +- frysk-imports/libunwind/src/mips/siglongjmp.S | 8 + .../libunwind/src/{x86 => mips}/unwind_i.h | 24 +- .../libunwind/src/ptrace/_UPT_reg_offset.c | 2 + frysk-imports/libunwind/src/setjmp/longjmp.c | 2 +- frysk-imports/libunwind/src/setjmp/siglongjmp.c | 2 +- .../libunwind/src/unwind/FindEnclosingFunction.c | 5 +- .../libunwind/src/unwind/RaiseException.c | 2 +- .../libunwind/src/unwind/unwind-internal.h | 2 +- frysk-imports/libunwind/src/x86/Gget_save_loc.c | 8 + 96 files changed, 2227 insertions(+), 740 deletions(-) create mode 100644 frysk-imports/libunwind/include/libunwind-arm.h copy frysk-imports/libunwind/include/{libunwind-x86_64.h => libunwind-mips.h} (53%) copy frysk-imports/libunwind/include/{tdep-x86 => tdep-arm}/dwarf-config.h (80%) copy frysk-imports/libunwind/include/{tdep-x86 => tdep-arm}/jmpbuf.h (93%) copy frysk-imports/libunwind/include/{tdep-x86 => tdep-arm}/libunwind_i.h (92%) copy frysk-imports/libunwind/include/{tdep-x86_64 => tdep-mips}/dwarf-config.h (74%) copy frysk-imports/libunwind/include/{tdep-x86 => tdep-mips}/jmpbuf.h (93%) copy frysk-imports/libunwind/include/{tdep-x86 => tdep-mips}/libunwind_i.h (78%) copy frysk-imports/libunwind/src/{hppa => arm}/Gcreate_addr_space.c (81%) copy frysk-imports/libunwind/src/{ia64 => arm}/Gget_proc_info.c (86%) copy frysk-imports/libunwind/src/{hppa => arm}/Gget_save_loc.c (78%) copy frysk-imports/libunwind/src/{hppa => arm}/Gglobal.c (76%) copy frysk-imports/libunwind/src/{x86 => arm}/Ginit.c (77%) copy frysk-imports/libunwind/src/{hppa => arm}/Ginit_local.c (96%) copy frysk-imports/libunwind/src/{hppa => arm}/Ginit_remote.c (93%) copy frysk-imports/libunwind/src/{ptrace/_UPT_destroy.c => arm/Gis_signal_frame.c} (83%) copy frysk-imports/libunwind/src/{ppc32 => arm}/Gregs.c (63%) copy frysk-imports/libunwind/src/{ia64/Gget_proc_info.c => arm/Gresume.c} (79%) copy frysk-imports/libunwind/src/{ia64/Gget_proc_info.c => arm/Gstep.c} (75%) copy frysk-imports/libunwind/src/{hppa => arm}/Lcreate_addr_space.c (100%) copy frysk-imports/libunwind/src/{hppa => arm}/Lget_proc_info.c (100%) copy frysk-imports/libunwind/src/{hppa => arm}/Lget_save_loc.c (100%) copy frysk-imports/libunwind/src/{hppa => arm}/Lglobal.c (100%) copy frysk-imports/libunwind/src/{hppa => arm}/Linit.c (100%) copy frysk-imports/libunwind/src/{hppa => arm}/Linit_local.c (100%) copy frysk-imports/libunwind/src/{hppa => arm}/Linit_remote.c (100%) copy frysk-imports/libunwind/src/{hppa => arm}/Lis_signal_frame.c (100%) copy frysk-imports/libunwind/src/{hppa => arm}/Lregs.c (100%) copy frysk-imports/libunwind/src/{hppa => arm}/Lresume.c (100%) copy frysk-imports/libunwind/src/{dwarf => arm}/Lstep.c (100%) create mode 100644 frysk-imports/libunwind/src/arm/gen-offsets.c copy frysk-imports/libunwind/{tests/ia64-test-readonly-asm.S => src/arm/getcontext.S} (57%) copy frysk-imports/libunwind/src/{x86 => arm}/init.h (54%) copy frysk-imports/libunwind/src/{x86_64 => arm}/is_fpreg.c (69%) create mode 100644 frysk-imports/libunwind/src/arm/offsets.h create mode 100644 frysk-imports/libunwind/src/arm/regname.c create mode 100644 frysk-imports/libunwind/src/arm/siglongjmp.S copy frysk-imports/libunwind/src/{mi/dyn-info-list.c => arm/unwind_i.h} (80%) copy frysk-imports/libunwind/src/{ia64 => mips}/Gcreate_addr_space.c (87%) copy frysk-imports/libunwind/src/{ia64 => mips}/Gget_proc_info.c (86%) copy frysk-imports/libunwind/src/{x86_64 => mips}/Gget_save_loc.c (68%) copy frysk-imports/libunwind/src/{hppa => mips}/Gglobal.c (75%) copy frysk-imports/libunwind/src/{x86 => mips}/Ginit.c (67%) copy frysk-imports/libunwind/src/{hppa => mips}/Ginit_local.c (96%) copy frysk-imports/libunwind/src/{hppa => mips}/Ginit_remote.c (93%) copy frysk-imports/libunwind/src/{ptrace/_UPT_destroy.c => mips/Gis_signal_frame.c} (83%) copy frysk-imports/libunwind/src/{ppc32 => mips}/Gregs.c (58%) copy frysk-imports/libunwind/src/{ia64/Gget_proc_info.c => mips/Gresume.c} (79%) copy frysk-imports/libunwind/src/{ia64/Gget_proc_info.c => mips/Gstep.c} (75%) copy frysk-imports/libunwind/src/{hppa => mips}/Lcreate_addr_space.c (100%) copy frysk-imports/libunwind/src/{hppa => mips}/Lget_proc_info.c (100%) copy frysk-imports/libunwind/src/{hppa => mips}/Lget_save_loc.c (100%) copy frysk-imports/libunwind/src/{hppa => mips}/Lglobal.c (100%) copy frysk-imports/libunwind/src/{hppa => mips}/Linit.c (100%) copy frysk-imports/libunwind/src/{hppa => mips}/Linit_local.c (100%) copy frysk-imports/libunwind/src/{hppa => mips}/Linit_remote.c (100%) copy frysk-imports/libunwind/src/{hppa => mips}/Lis_signal_frame.c (100%) copy frysk-imports/libunwind/src/{hppa => mips}/Lregs.c (100%) copy frysk-imports/libunwind/src/{hppa => mips}/Lresume.c (100%) copy frysk-imports/libunwind/src/{dwarf => mips}/Lstep.c (100%) copy frysk-imports/libunwind/src/{ptrace/_UPT_destroy.c => mips/elfxx.c} (87%) create mode 100644 frysk-imports/libunwind/src/mips/gen-offsets.c copy frysk-imports/libunwind/src/{ia64/siglongjmp.S => mips/getcontext.S} (54%) copy frysk-imports/libunwind/src/{hppa => mips}/init.h (74%) copy frysk-imports/libunwind/src/{ppc32 => mips}/is_fpreg.c (84%) create mode 100644 frysk-imports/libunwind/src/mips/offsets.h copy frysk-imports/libunwind/src/{x86_64 => mips}/regname.c (79%) create mode 100644 frysk-imports/libunwind/src/mips/siglongjmp.S copy frysk-imports/libunwind/src/{x86 => mips}/unwind_i.h (81%) mode change 100644 => 100755 frysk-imports/libunwind/tests/perf-startup First 500 lines of diff: diff --git a/frysk-imports/libunwind/Makefile.am b/frysk-imports/libunwind/Makefile.am index a46075b..e31e23e 100644 --- a/frysk-imports/libunwind/Makefile.am +++ b/frysk-imports/libunwind/Makefile.am @@ -1,9 +1,15 @@ +if ARCH_ARM +include_HEADERS_tdep = include/libunwind-arm.h +else if ARCH_IA64 include_HEADERS_tdep = include/libunwind-ia64.h else if ARCH_HPPA include_HEADERS_tdep = include/libunwind-hppa.h else +if ARCH_MIPS +include_HEADERS_tdep = include/libunwind-mips.h +else if ARCH_X86 include_HEADERS_tdep = include/libunwind-x86.h else @@ -19,8 +25,10 @@ endif # ARCH_PPC64 endif # ARCH_PPC32 endif # ARCH_X86_64 endif # ARCH_X86 +endif # ARCH_MIPS endif # ARCH_HPPA endif # ARCH_IA64 +endif # ARCH_ARM include_HEADERS_common = $(include_HEADERS_tdep) \ include/libunwind-dynamic.h include/libunwind-ptrace.h diff --git a/frysk-imports/libunwind/configure.in b/frysk-imports/libunwind/configure.in index 28ed2b2..26e256d 100644 --- a/frysk-imports/libunwind/configure.in +++ b/frysk-imports/libunwind/configure.in @@ -98,19 +98,24 @@ AM_CONDITIONAL(USE_ALTIVEC, test x$use_altivec = xhas_altivec) get_arch() { case "$1" in + arm*) echo arm;; i?86) echo x86;; hppa*) echo hppa;; + mips*) echo mips;; powerpc64) echo "ppc64";; *) echo $1;; esac } build_arch=`get_arch $build_cpu` +host_arch=`get_arch $host_cpu` target_arch=`get_arch $target_cpu` AM_CONDITIONAL(REMOTE_ONLY, test x$frysk_local = xyes) +AM_CONDITIONAL(ARCH_ARM, test x$target_arch = xarm) AM_CONDITIONAL(ARCH_IA64, test x$target_arch = xia64) AM_CONDITIONAL(ARCH_HPPA, test x$target_arch = xhppa) +AM_CONDITIONAL(ARCH_MIPS, test x$target_arch = xmips) AM_CONDITIONAL(ARCH_X86, test x$target_arch = xx86) AM_CONDITIONAL(ARCH_X86_64, test x$target_arch = xx86_64) AM_CONDITIONAL(ARCH_PPC32, test x$target_arch = xppc32) diff --git a/frysk-imports/libunwind/include/dwarf.h b/frysk-imports/libunwind/include/dwarf.h index 3a17c87..61e5823 100644 --- a/frysk-imports/libunwind/include/dwarf.h +++ b/frysk-imports/libunwind/include/dwarf.h @@ -335,6 +335,23 @@ struct dwarf_rs_cache dwarf_reg_state_t buckets[DWARF_UNW_CACHE_SIZE]; }; +/* A list of descriptors for loaded .debug_frame sections. */ + +struct unw_debug_frame_list + { + /* The start (inclusive) and end (exclusive) of the described region. */ + unw_word_t start; + unw_word_t end; + /* The debug frame itself. */ + char *debug_frame; + size_t debug_frame_size; + /* Index (for binary search). */ + struct table_entry *index; + size_t index_size; + /* Pointer to next descriptor. */ + struct unw_debug_frame_list *next; + }; + /* Convenience macros: */ #define dwarf_init UNW_ARCH_OBJ (dwarf_init) #define dwarf_find_proc_info UNW_OBJ (dwarf_find_proc_info) @@ -366,10 +383,10 @@ extern int dwarf_eval_expr (struct dwarf_cursor *c, unw_word_t *addr, int *is_register); extern int dwarf_extract_proc_info_from_fde (unw_addr_space_t as, unw_accessors_t *a, - unw_word_t table_start, unw_word_t *fde_addr, unw_proc_info_t *pi, int need_unwind_info, + unw_word_t base, void *arg); extern int dwarf_find_save_locs (struct dwarf_cursor *c); extern int dwarf_create_state_record (struct dwarf_cursor *c, diff --git a/frysk-imports/libunwind/include/dwarf_i.h b/frysk-imports/libunwind/include/dwarf_i.h index 5b78dc0..d01eab8 100644 --- a/frysk-imports/libunwind/include/dwarf_i.h +++ b/frysk-imports/libunwind/include/dwarf_i.h @@ -9,6 +9,12 @@ #include "dwarf.h" #include "libunwind_i.h" +/* Unless we are told otherwise, assume that a "machine address" is + the size of an unw_word_t. */ +#ifndef dwarf_addr_size +# define dwarf_addr_size(as) (sizeof (unw_word_t)) +#endif + #define dwarf_to_unw_regnum_map UNW_OBJ (dwarf_to_unw_regnum_map) extern uint8_t dwarf_to_unw_regnum_map[DWARF_REGNUM_MAP_LENGTH]; @@ -22,7 +28,7 @@ extern uint8_t dwarf_to_unw_regnum_map[DWARF_REGNUM_MAP_LENGTH]; /* In the local-only case, we can let the compiler directly access memory and don't need to worry about differing byte-order. */ -typedef union +typedef union __attribute__ ((packed)) { int8_t s8; int16_t s16; @@ -32,16 +38,15 @@ typedef union uint16_t u16; uint32_t u32; uint64_t u64; - unw_word_t w; void *ptr; } -dwarf_misaligned_value_t __attribute__ ((packed)); +dwarf_misaligned_value_t; static inline int dwarf_reads8 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, int8_t *val, void *arg) { - dwarf_misaligned_value_t *mvp = (void *) *addr; + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; *val = mvp->s8; *addr += sizeof (mvp->s8); @@ -52,7 +57,7 @@ static inline int dwarf_reads16 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, int16_t *val, void *arg) { - dwarf_misaligned_value_t *mvp = (void *) *addr; + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; *val = mvp->s16; *addr += sizeof (mvp->s16); @@ -63,7 +68,7 @@ static inline int dwarf_reads32 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, int32_t *val, void *arg) { - dwarf_misaligned_value_t *mvp = (void *) *addr; + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; *val = mvp->s32; *addr += sizeof (mvp->s32); @@ -74,7 +79,7 @@ static inline int dwarf_reads64 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, int64_t *val, void *arg) { - dwarf_misaligned_value_t *mvp = (void *) *addr; + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; *val = mvp->s64; *addr += sizeof (mvp->s64); @@ -85,7 +90,7 @@ static inline int dwarf_readu8 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, uint8_t *val, void *arg) { - dwarf_misaligned_value_t *mvp = (void *) *addr; + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; *val = mvp->u8; *addr += sizeof (mvp->u8); @@ -96,7 +101,7 @@ static inline int dwarf_readu16 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, uint16_t *val, void *arg) { - dwarf_misaligned_value_t *mvp = (void *) *addr; + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; *val = mvp->u16; *addr += sizeof (mvp->u16); @@ -107,7 +112,7 @@ static inline int dwarf_readu32 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, uint32_t *val, void *arg) { - dwarf_misaligned_value_t *mvp = (void *) *addr; + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; *val = mvp->u32; *addr += sizeof (mvp->u32); @@ -118,24 +123,13 @@ static inline int dwarf_readu64 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, uint64_t *val, void *arg) { - dwarf_misaligned_value_t *mvp = (void *) *addr; + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; *val = mvp->u64; *addr += sizeof (mvp->u64); return 0; } -static inline int -dwarf_readw (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, - unw_word_t *val, void *arg) -{ - dwarf_misaligned_value_t *mvp = (void *) *addr; - - *val = mvp->w; - *addr += sizeof (mvp->w); - return 0; -} - #else /* !UNW_LOCAL_ONLY */ static inline int @@ -263,25 +257,37 @@ dwarf_reads64 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, return 0; } +#endif /* !UNW_LOCAL_ONLY */ + static inline int dwarf_readw (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, unw_word_t *val, void *arg) { - switch (sizeof (unw_word_t)) + uint32_t u32; + uint64_t u64; + int ret; + + switch (dwarf_addr_size (as)) { case 4: - return dwarf_readu32 (as, a, addr, (uint32_t *) val, arg); + ret = dwarf_readu32 (as, a, addr, &u32, arg); + if (ret < 0) + return ret; + *val = u32; + return ret; case 8: - return dwarf_readu64 (as, a, addr, (uint64_t *) val, arg); + ret = dwarf_readu64 (as, a, addr, &u64, arg); + if (ret < 0) + return ret; + *val = u64; + return ret; default: abort (); } } -#endif /* !UNW_LOCAL_ONLY */ - /* Read an unsigned "little-endian base 128" value. See Chapter 7.6 of DWARF spec v3. */ @@ -360,7 +366,8 @@ dwarf_read_encoded_pointer_inlined (unw_addr_space_t as, unw_accessors_t *a, } else if (encoding == DW_EH_PE_aligned) { - *addr = (initial_addr + sizeof (unw_word_t) - 1) & -sizeof (unw_word_t); + int size = dwarf_addr_size (as); + *addr = (initial_addr + size - 1) & -size; return dwarf_readw (as, a, addr, valp, arg); } @@ -459,6 +466,15 @@ dwarf_read_encoded_pointer_inlined (unw_addr_space_t as, unw_accessors_t *a, return -UNW_EINVAL; } + /* Trim off any extra bits. Assume that sign extension isn't + required; the only place it is needed is MIPS kernel space + addresses. */ + if (sizeof (val) > dwarf_addr_size (as)) + { + assert (dwarf_addr_size (as) == 4); + val = (uint32_t) val; + } + if (encoding & DW_EH_PE_indirect) { unw_word_t indirect_addr = val; diff --git a/frysk-imports/libunwind/include/libunwind-arm.h b/frysk-imports/libunwind/include/libunwind-arm.h new file mode 100644 index 0000000..492331e --- /dev/null +++ b/frysk-imports/libunwind/include/libunwind-arm.h @@ -0,0 +1,298 @@ +/* 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 LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include + +#define UNW_TARGET arm +#define UNW_TARGET_ARM 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* This needs to be big enough to accommodate "struct cursor", while + leaving some slack for future expansion. Changing this value will + require recompiling all users of this library. Stack allocation is + relatively cheap and unwind-state copying is relatively rare, so we + want to err on making it rather too big than too small. */ + +/* FIXME for ARM. Too big? What do other things use for similar tasks? */ +#define UNW_TDEP_CURSOR_LEN 4096 + +typedef uint32_t unw_word_t; +typedef int32_t unw_sword_t; + +typedef long double unw_tdep_fpreg_t; + +typedef enum + { + UNW_ARM_R0, + UNW_ARM_R1, + UNW_ARM_R2, + UNW_ARM_R3, + UNW_ARM_R4, + UNW_ARM_R5, + UNW_ARM_R6, + UNW_ARM_R7, + UNW_ARM_R8, + UNW_ARM_R9, + UNW_ARM_R10, + UNW_ARM_R11, + UNW_ARM_R12, + UNW_ARM_R13, + UNW_ARM_R14, + UNW_ARM_R15, + + /* VFPv2 s0-s31 (obsolescent numberings). */ + UNW_ARM_S0 = 64, + UNW_ARM_S1, + UNW_ARM_S2, + UNW_ARM_S3, + UNW_ARM_S4, + UNW_ARM_S5, + UNW_ARM_S6, + UNW_ARM_S7, + UNW_ARM_S8, + UNW_ARM_S9, + UNW_ARM_S10, + UNW_ARM_S11, + UNW_ARM_S12, + UNW_ARM_S13, + UNW_ARM_S14, + UNW_ARM_S15, + UNW_ARM_S16, + UNW_ARM_S17, + UNW_ARM_S18, + UNW_ARM_S19, + UNW_ARM_S20, + UNW_ARM_S21, + UNW_ARM_S22, + UNW_ARM_S23, + UNW_ARM_S24, + UNW_ARM_S25, + UNW_ARM_S26, + UNW_ARM_S27, + UNW_ARM_S28, + UNW_ARM_S29, + UNW_ARM_S30, + UNW_ARM_S31, + + /* FPA register numberings. */ + UNW_ARM_F0 = 96, + UNW_ARM_F1, + UNW_ARM_F2, + UNW_ARM_F3, + UNW_ARM_F4, + UNW_ARM_F5, + UNW_ARM_F6, + UNW_ARM_F7, + + /* iWMMXt GR register numberings. */ + UNW_ARM_wCGR0 = 104, + UNW_ARM_wCGR1, + UNW_ARM_wCGR2, + UNW_ARM_wCGR3, + UNW_ARM_wCGR4, + UNW_ARM_wCGR5, + UNW_ARM_wCGR6, + UNW_ARM_wCGR7, + + /* iWMMXt register numberings. */ + UNW_ARM_wR0 = 112, + UNW_ARM_wR1, + UNW_ARM_wR2, + UNW_ARM_wR3, + UNW_ARM_wR4, + UNW_ARM_wR5, + UNW_ARM_wR6, + UNW_ARM_wR7, + UNW_ARM_wR8, + UNW_ARM_wR9, + UNW_ARM_wR10, + UNW_ARM_wR11, + UNW_ARM_wR12, + UNW_ARM_wR13, + UNW_ARM_wR14, + UNW_ARM_wR15, + + /* Two-byte encodings from here on. */ + + /* SPSR. */ + UNW_ARM_SPSR = 128, + UNW_ARM_SPSR_FIQ, + UNW_ARM_SPSR_IRQ, + UNW_ARM_SPSR_ABT, + UNW_ARM_SPSR_UND, + UNW_ARM_SPSR_SVC, + + /* User mode registers. */ + UNW_ARM_R8_USR = 144, + UNW_ARM_R9_USR, + UNW_ARM_R10_USR, + UNW_ARM_R11_USR, + UNW_ARM_R12_USR, + UNW_ARM_R13_USR, + UNW_ARM_R14_USR, + + /* FIQ registers. */ + UNW_ARM_R8_FIQ = 151, + UNW_ARM_R9_FIQ, + UNW_ARM_R10_FIQ, + UNW_ARM_R11_FIQ, + UNW_ARM_R12_FIQ, + UNW_ARM_R13_FIQ, + UNW_ARM_R14_FIQ, + + /* IRQ registers. */ + UNW_ARM_R13_IRQ = 158, + UNW_ARM_R14_IRQ, + + /* ABT registers. */ + UNW_ARM_R13_ABT = 160, + UNW_ARM_R14_ABT, + + /* UND registers. */ + UNW_ARM_R13_UND = 162, + UNW_ARM_R14_UND, + + /* SVC registers. */ + UNW_ARM_R13_SVC = 164, + UNW_ARM_R14_SVC, + + /* iWMMXt control registers. */ + UNW_ARM_wC0 = 192, + UNW_ARM_wC1, + UNW_ARM_wC2, + UNW_ARM_wC3, + UNW_ARM_wC4, + UNW_ARM_wC5, + UNW_ARM_wC6, + UNW_ARM_wC7, + + /* VFPv3/Neon 64-bit registers. */ + UNW_ARM_D0 = 256, hooks/post-receive -- frysk system monitor/debugger