From b88369b8314dc8e8fe617184b07527fb34b66f22 Mon Sep 17 00:00:00 2001 From: "hp.com!davidm" Date: Fri, 30 Jan 2004 00:01:24 +0000 Subject: [PATCH] Initial revision --- include/dwarf_i.h | 343 ----------------------- include/remote.h | 127 --------- src/ia64/Ginstall_cursor-ia64.S | 0 src/ia64/Linstall_cursor-ia64.S | 0 src/mi/Gdestroy_addr_space.c | 0 src/mi/Gdyn-extract.c | 0 src/mi/Gdyn-remote.c | 0 src/mi/Gfind_dynamic_proc_info.c | 0 src/mi/Gget_accessors.c | 0 src/mi/Gget_fpreg.c | 34 --- src/mi/Gget_proc_info_by_ip.c | 0 src/mi/Gget_proc_name.c | 0 src/mi/Gget_reg.c | 0 src/mi/Gput_dynamic_unwind_info.c | 0 src/mi/Gset_caching_policy.c | 0 src/mi/Gset_fpreg.c | 34 --- src/mi/Gset_reg.c | 0 src/mi/Ldestroy_addr_space.c | 5 - src/mi/Ldyn-extract.c | 0 src/mi/Ldyn-remote.c | 5 - src/mi/Lfind_dynamic_proc_info.c | 0 src/mi/Lget_accessors.c | 5 - src/mi/Lget_fpreg.c | 5 - src/mi/Lget_proc_info_by_ip.c | 0 src/mi/Lget_proc_name.c | 0 src/mi/Lget_reg.c | 5 - src/mi/Lput_dynamic_unwind_info.c | 0 src/mi/Lset_caching_policy.c | 5 - src/mi/Lset_fpreg.c | 5 - src/mi/Lset_reg.c | 5 - src/mi/dyn-cancel.c | 0 src/mi/dyn-info-list.c | 0 src/mi/dyn-register.c | 0 src/mi/flush_cache.c | 0 src/mi/init.c | 0 src/mi/mempool.c | 0 src/ptrace/_UPT_access_fpreg.c | 0 src/ptrace/_UPT_access_mem.c | 0 src/ptrace/_UPT_access_reg.c | 0 src/ptrace/_UPT_accessors.c | 0 src/ptrace/_UPT_create.c | 0 src/ptrace/_UPT_destroy.c | 0 src/ptrace/_UPT_find_proc_info.c | 0 src/ptrace/_UPT_get_dyn_info_list_addr.c | 0 src/ptrace/_UPT_get_proc_name.c | 0 src/ptrace/_UPT_internal.h | 0 src/ptrace/_UPT_put_unwind_info.c | 0 src/ptrace/_UPT_reg_offset.c | 0 src/ptrace/_UPT_resume.c | 0 src/unwind/Backtrace.c | 0 src/unwind/DeleteException.c | 0 src/unwind/FindEnclosingFunction.c | 0 src/unwind/ForcedUnwind.c | 0 src/unwind/GetBSP.c | 0 src/unwind/GetCFA.c | 0 src/unwind/GetDataRelBase.c | 0 src/unwind/GetGR.c | 0 src/unwind/GetIP.c | 0 src/unwind/GetLanguageSpecificData.c | 0 src/unwind/GetRegionStart.c | 0 src/unwind/GetTextRelBase.c | 0 src/unwind/RaiseException.c | 0 src/unwind/Resume.c | 0 src/unwind/Resume_or_Rethrow.c | 0 src/unwind/SetGR.c | 0 src/unwind/SetIP.c | 0 src/x86/Gget_save_loc-x86.c | 125 --------- src/x86/Lget_save_loc-x86.c | 5 - 68 files changed, 708 deletions(-) create mode 100644 src/ia64/Ginstall_cursor-ia64.S create mode 100644 src/ia64/Linstall_cursor-ia64.S create mode 100644 src/mi/Gdestroy_addr_space.c create mode 100644 src/mi/Gdyn-extract.c create mode 100644 src/mi/Gdyn-remote.c create mode 100644 src/mi/Gfind_dynamic_proc_info.c create mode 100644 src/mi/Gget_accessors.c create mode 100644 src/mi/Gget_proc_info_by_ip.c create mode 100644 src/mi/Gget_proc_name.c create mode 100644 src/mi/Gget_reg.c create mode 100644 src/mi/Gput_dynamic_unwind_info.c create mode 100644 src/mi/Gset_caching_policy.c create mode 100644 src/mi/Gset_reg.c create mode 100644 src/mi/Ldyn-extract.c create mode 100644 src/mi/Lfind_dynamic_proc_info.c create mode 100644 src/mi/Lget_proc_info_by_ip.c create mode 100644 src/mi/Lget_proc_name.c create mode 100644 src/mi/Lput_dynamic_unwind_info.c create mode 100644 src/mi/dyn-cancel.c create mode 100644 src/mi/dyn-info-list.c create mode 100644 src/mi/dyn-register.c create mode 100644 src/mi/flush_cache.c create mode 100644 src/mi/init.c create mode 100644 src/mi/mempool.c create mode 100644 src/ptrace/_UPT_access_fpreg.c create mode 100644 src/ptrace/_UPT_access_mem.c create mode 100644 src/ptrace/_UPT_access_reg.c create mode 100644 src/ptrace/_UPT_accessors.c create mode 100644 src/ptrace/_UPT_create.c create mode 100644 src/ptrace/_UPT_destroy.c create mode 100644 src/ptrace/_UPT_find_proc_info.c create mode 100644 src/ptrace/_UPT_get_dyn_info_list_addr.c create mode 100644 src/ptrace/_UPT_get_proc_name.c create mode 100644 src/ptrace/_UPT_internal.h create mode 100644 src/ptrace/_UPT_put_unwind_info.c create mode 100644 src/ptrace/_UPT_reg_offset.c create mode 100644 src/ptrace/_UPT_resume.c create mode 100644 src/unwind/Backtrace.c create mode 100644 src/unwind/DeleteException.c create mode 100644 src/unwind/FindEnclosingFunction.c create mode 100644 src/unwind/ForcedUnwind.c create mode 100644 src/unwind/GetBSP.c create mode 100644 src/unwind/GetCFA.c create mode 100644 src/unwind/GetDataRelBase.c create mode 100644 src/unwind/GetGR.c create mode 100644 src/unwind/GetIP.c create mode 100644 src/unwind/GetLanguageSpecificData.c create mode 100644 src/unwind/GetRegionStart.c create mode 100644 src/unwind/GetTextRelBase.c create mode 100644 src/unwind/RaiseException.c create mode 100644 src/unwind/Resume.c create mode 100644 src/unwind/Resume_or_Rethrow.c create mode 100644 src/unwind/SetGR.c create mode 100644 src/unwind/SetIP.c diff --git a/include/dwarf_i.h b/include/dwarf_i.h index 55320c2d..e69de29b 100644 --- a/include/dwarf_i.h +++ b/include/dwarf_i.h @@ -1,343 +0,0 @@ -#ifndef DWARF_I_H -#define DWARF_I_H - -/* This file contains definitions that cannot be used in code outside - of libunwind. In particular, most inline functions are here - because otherwise they'd generate unresolved references when the - files are compiled with inlining disabled. */ - -#include "dwarf.h" -#include "tdep.h" - -#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]; - -static inline unw_regnum_t -dwarf_to_unw_regnum (unw_word_t regnum) -{ - if (regnum <= DWARF_REGNUM_MAP_LENGTH) - return dwarf_to_unw_regnum_map[regnum]; - return 0; -} - -#ifdef UNW_LOCAL_ONLY - -/* 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 - { - int8_t s8; - int16_t s16; - int32_t s32; - int64_t s64; - uint8_t u8; - uint16_t u16; - uint32_t u32; - uint64_t u64; - unw_word_t w; - void *ptr; - } -dwarf_misaligned_value_t __attribute__ ((packed)); - -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; - - *val = mvp->s8; - *addr += sizeof (mvp->s8); - return 0; -} - -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; - - *val = mvp->s16; - *addr += sizeof (mvp->s16); - return 0; -} - -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; - - *val = mvp->s32; - *addr += sizeof (mvp->s32); - return 0; -} - -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; - - *val = mvp->s64; - *addr += sizeof (mvp->s64); - return 0; -} - -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; - - *val = mvp->u8; - *addr += sizeof (mvp->u8); - return 0; -} - -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; - - *val = mvp->u16; - *addr += sizeof (mvp->u16); - return 0; -} - -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; - - *val = mvp->u32; - *addr += sizeof (mvp->u32); - return 0; -} - -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; - - *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 -dwarf_readu8 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, - uint8_t *valp, void *arg) -{ - unw_word_t val, aligned_addr = *addr & -sizeof (unw_word_t); - unw_word_t off = *addr - aligned_addr; - int ret; - - *addr += 1; - ret = (*a->access_mem) (as, aligned_addr, &val, 0, arg); -#if __BYTE_ORDER == __LITTLE_ENDIAN - val >>= 8*off; -#else - val >>= 8*(sizeof (unw_word_t) - 1 - off); -#endif - *valp = (uint8_t) val; - return ret; -} - -static inline int -dwarf_readu16 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, - uint16_t *val, void *arg) -{ - uint8_t v0, v1; - int ret; - - if ((ret = dwarf_readu8 (as, a, addr, &v0, arg)) < 0 - || (ret = dwarf_readu8 (as, a, addr, &v1, arg)) < 0) - return ret; - - if (tdep_big_endian (as)) - *val = (uint16_t) v0 << 8 | v1; - else - *val = (uint16_t) v1 << 8 | v0; - return 0; -} - -static inline int -dwarf_readu32 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, - uint32_t *val, void *arg) -{ - uint16_t v0, v1; - int ret; - - if ((ret = dwarf_readu16 (as, a, addr, &v0, arg)) < 0 - || (ret = dwarf_readu16 (as, a, addr, &v1, arg)) < 0) - return ret; - - if (tdep_big_endian (as)) - *val = (uint32_t) v0 << 16 | v1; - else - *val = (uint32_t) v1 << 16 | v0; - return 0; -} - -static inline int -dwarf_readu64 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, - uint64_t *val, void *arg) -{ - uint32_t v0, v1; - int ret; - - if ((ret = dwarf_readu32 (as, a, addr, &v0, arg)) < 0 - || (ret = dwarf_readu32 (as, a, addr, &v1, arg)) < 0) - return ret; - - if (tdep_big_endian (as)) - *val = (uint64_t) v0 << 32 | v1; - else - *val = (uint64_t) v1 << 32 | v0; - return 0; -} - -static inline int -dwarf_reads8 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, - int8_t *val, void *arg) -{ - uint8_t uval; - int ret; - - if ((ret = dwarf_readu8 (as, a, addr, &uval, arg)) < 0) - return ret; - *val = (int8_t) uval; - return 0; -} - -static inline int -dwarf_reads16 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, - int16_t *val, void *arg) -{ - uint16_t uval; - int ret; - - if ((ret = dwarf_readu16 (as, a, addr, &uval, arg)) < 0) - return ret; - *val = (int16_t) uval; - return 0; -} - -static inline int -dwarf_reads32 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, - int32_t *val, void *arg) -{ - uint32_t uval; - int ret; - - if ((ret = dwarf_readu32 (as, a, addr, &uval, arg)) < 0) - return ret; - *val = (int32_t) uval; - return 0; -} - -static inline int -dwarf_reads64 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, - int64_t *val, void *arg) -{ - uint64_t uval; - int ret; - - if ((ret = dwarf_readu64 (as, a, addr, &uval, arg)) < 0) - return ret; - *val = (int64_t) uval; - 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) -{ - switch (sizeof (unw_word_t)) - { - case 4: - return dwarf_readu32 (as, a, addr, (uint32_t *) val, arg); - - case 8: - return dwarf_readu64 (as, a, addr, (uint64_t *) val, arg); - - default: - abort (); - } -} - -#endif /* !UNW_LOCAL_ONLY */ - -/* Read an unsigned "little-endian base 128" value. See Chapter 7.6 - of DWARF spec v3. */ - -static inline int -dwarf_read_uleb128 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, - unw_word_t *valp, void *arg) -{ - unw_word_t val = 0, shift = 0; - unsigned char byte; - int ret; - - do - { - if ((ret = dwarf_readu8 (as, a, addr, &byte, arg)) < 0) - return ret; - - val |= ((unw_word_t) byte & 0x7f) << shift; - shift += 7; - } - while (byte & 0x80); - - *valp = val; - return 0; -} - -/* Read a signed "little-endian base 128" value. See Chapter 7.6 of - DWARF spec v3. */ - -static inline int -dwarf_read_sleb128 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, - unw_word_t *valp, void *arg) -{ - unw_word_t val = 0, shift = 0; - unsigned char byte; - int ret; - - do - { - if ((ret = dwarf_readu8 (as, a, addr, &byte, arg)) < 0) - return ret; - - val |= ((unw_word_t) byte & 0x7f) << shift; - shift += 7; - } - while (byte & 0x80); - - if (shift < 8 * sizeof (unw_word_t) && (byte & 0x40) != 0) - /* sign-extend negative value */ - val |= ((unw_word_t) -1) << shift; - - *valp = val; - return 0; -} - -#endif /* DWARF_I_H */ diff --git a/include/remote.h b/include/remote.h index a5ecab95..e69de29b 100644 --- a/include/remote.h +++ b/include/remote.h @@ -1,127 +0,0 @@ -#ifndef REMOTE_H -#define REMOTE_H - -/* Helper functions for accessing (remote) memory. These functions - assume that all addresses are naturally aligned (e.g., 32-bit - quantity is stored at a 32-bit-aligned address. */ - -#ifdef UNW_LOCAL_ONLY - -static inline int -fetch8 (unw_addr_space_t as, unw_accessors_t *a, - unw_word_t *addr, int8_t *valp, void *arg) -{ - *valp = *(int8_t *) *addr; - *addr += 1; - return 0; -} - -static inline int -fetch16 (unw_addr_space_t as, unw_accessors_t *a, - unw_word_t *addr, int16_t *valp, void *arg) -{ - *valp = *(int16_t *) *addr; - *addr += 2; - return 0; -} - -static inline int -fetch32 (unw_addr_space_t as, unw_accessors_t *a, - unw_word_t *addr, int32_t *valp, void *arg) -{ - *valp = *(int32_t *) *addr; - *addr += 4; - return 0; -} - -static inline int -fetchw (unw_addr_space_t as, unw_accessors_t *a, - unw_word_t *addr, unw_word_t *valp, void *arg) -{ - *valp = *(unw_word_t *) *addr; - *addr += sizeof (unw_word_t); - return 0; -} - -#else /* !UNW_LOCAL_ONLY */ - -#define WSIZE (sizeof (unw_word_t)) - -static inline int -fetch8 (unw_addr_space_t as, unw_accessors_t *a, - unw_word_t *addr, int8_t *valp, void *arg) -{ - unw_word_t val, aligned_addr = *addr & -WSIZE, off = *addr - aligned_addr; - int ret; - - *addr += 1; - - ret = (*a->access_mem) (as, aligned_addr, &val, 0, arg); - -#if __BYTE_ORDER == __LITTLE_ENDIAN - val >>= 8*off; -#else - val >>= 8*(WSIZE - 1 - off); -#endif - *valp = val & 0xff; - return ret; -} - -static inline int -fetch16 (unw_addr_space_t as, unw_accessors_t *a, - unw_word_t *addr, int16_t *valp, void *arg) -{ - unw_word_t val, aligned_addr = *addr & -WSIZE, off = *addr - aligned_addr; - int ret; - - assert ((off & 0x1) == 0); - - *addr += 2; - - ret = (*a->access_mem) (as, aligned_addr, &val, 0, arg); - -#if __BYTE_ORDER == __LITTLE_ENDIAN - val >>= 8*off; -#else - val >>= 8*(WSIZE - 2 - off); -#endif - *valp = val & 0xffff; - return ret; -} - -static inline int -fetch32 (unw_addr_space_t as, unw_accessors_t *a, - unw_word_t *addr, int32_t *valp, void *arg) -{ - unw_word_t val, aligned_addr = *addr & -WSIZE, off = *addr - aligned_addr; - int ret; - - assert ((off & 0x3) == 0); - - *addr += 4; - - ret = (*a->access_mem) (as, aligned_addr, &val, 0, arg); - -#if __BYTE_ORDER == __LITTLE_ENDIAN - val >>= 8*off; -#else - val >>= 8*(WSIZE - 4 - off); -#endif - *valp = val & 0xffffffff; - return ret; -} - -static inline int -fetchw (unw_addr_space_t as, unw_accessors_t *a, - unw_word_t *addr, unw_word_t *valp, void *arg) -{ - int ret; - - ret = (*a->access_mem) (as, *addr, valp, 0, arg); - *addr += WSIZE; - return ret; -} - -#endif /* !UNW_LOCAL_ONLY */ - -#endif /* REMOTE_H */ diff --git a/src/ia64/Ginstall_cursor-ia64.S b/src/ia64/Ginstall_cursor-ia64.S new file mode 100644 index 00000000..e69de29b diff --git a/src/ia64/Linstall_cursor-ia64.S b/src/ia64/Linstall_cursor-ia64.S new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Gdestroy_addr_space.c b/src/mi/Gdestroy_addr_space.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Gdyn-extract.c b/src/mi/Gdyn-extract.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Gdyn-remote.c b/src/mi/Gdyn-remote.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Gfind_dynamic_proc_info.c b/src/mi/Gfind_dynamic_proc_info.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Gget_accessors.c b/src/mi/Gget_accessors.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Gget_fpreg.c b/src/mi/Gget_fpreg.c index 8ff69d23..e69de29b 100644 --- a/src/mi/Gget_fpreg.c +++ b/src/mi/Gget_fpreg.c @@ -1,34 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2004 Hewlett-Packard Co - Contributed by David Mosberger-Tang - -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. */ - -#include "tdep.h" - -PROTECTED int -unw_get_fpreg (unw_cursor_t *cursor, int regnum, unw_fpreg_t *valp) -{ - struct cursor *c = (struct cursor *) cursor; - - return tdep_access_fpreg (c, regnum, valp, 0); -} diff --git a/src/mi/Gget_proc_info_by_ip.c b/src/mi/Gget_proc_info_by_ip.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Gget_proc_name.c b/src/mi/Gget_proc_name.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Gget_reg.c b/src/mi/Gget_reg.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Gput_dynamic_unwind_info.c b/src/mi/Gput_dynamic_unwind_info.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Gset_caching_policy.c b/src/mi/Gset_caching_policy.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Gset_fpreg.c b/src/mi/Gset_fpreg.c index 05e1c16a..e69de29b 100644 --- a/src/mi/Gset_fpreg.c +++ b/src/mi/Gset_fpreg.c @@ -1,34 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2004 Hewlett-Packard Co - Contributed by David Mosberger-Tang - -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. */ - -#include "tdep.h" - -PROTECTED int -unw_set_fpreg (unw_cursor_t *cursor, int regnum, unw_fpreg_t val) -{ - struct cursor *c = (struct cursor *) cursor; - - return tdep_access_fpreg (c, regnum, &val, 1); -} diff --git a/src/mi/Gset_reg.c b/src/mi/Gset_reg.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Ldestroy_addr_space.c b/src/mi/Ldestroy_addr_space.c index 5bf9364b..e69de29b 100644 --- a/src/mi/Ldestroy_addr_space.c +++ b/src/mi/Ldestroy_addr_space.c @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Gdestroy_addr_space.c" -#endif diff --git a/src/mi/Ldyn-extract.c b/src/mi/Ldyn-extract.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Ldyn-remote.c b/src/mi/Ldyn-remote.c index 260722a0..e69de29b 100644 --- a/src/mi/Ldyn-remote.c +++ b/src/mi/Ldyn-remote.c @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Gdyn-remote.c" -#endif diff --git a/src/mi/Lfind_dynamic_proc_info.c b/src/mi/Lfind_dynamic_proc_info.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Lget_accessors.c b/src/mi/Lget_accessors.c index 555e37f3..e69de29b 100644 --- a/src/mi/Lget_accessors.c +++ b/src/mi/Lget_accessors.c @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Gget_accessors.c" -#endif diff --git a/src/mi/Lget_fpreg.c b/src/mi/Lget_fpreg.c index e3be4414..e69de29b 100644 --- a/src/mi/Lget_fpreg.c +++ b/src/mi/Lget_fpreg.c @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Gget_fpreg.c" -#endif diff --git a/src/mi/Lget_proc_info_by_ip.c b/src/mi/Lget_proc_info_by_ip.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Lget_proc_name.c b/src/mi/Lget_proc_name.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Lget_reg.c b/src/mi/Lget_reg.c index effe8a80..e69de29b 100644 --- a/src/mi/Lget_reg.c +++ b/src/mi/Lget_reg.c @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Gget_reg.c" -#endif diff --git a/src/mi/Lput_dynamic_unwind_info.c b/src/mi/Lput_dynamic_unwind_info.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/Lset_caching_policy.c b/src/mi/Lset_caching_policy.c index cc18816b..e69de29b 100644 --- a/src/mi/Lset_caching_policy.c +++ b/src/mi/Lset_caching_policy.c @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Gset_caching_policy.c" -#endif diff --git a/src/mi/Lset_fpreg.c b/src/mi/Lset_fpreg.c index 2497d404..e69de29b 100644 --- a/src/mi/Lset_fpreg.c +++ b/src/mi/Lset_fpreg.c @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Gset_fpreg.c" -#endif diff --git a/src/mi/Lset_reg.c b/src/mi/Lset_reg.c index c7a872b0..e69de29b 100644 --- a/src/mi/Lset_reg.c +++ b/src/mi/Lset_reg.c @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Gset_reg.c" -#endif diff --git a/src/mi/dyn-cancel.c b/src/mi/dyn-cancel.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/dyn-info-list.c b/src/mi/dyn-info-list.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/dyn-register.c b/src/mi/dyn-register.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/flush_cache.c b/src/mi/flush_cache.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/init.c b/src/mi/init.c new file mode 100644 index 00000000..e69de29b diff --git a/src/mi/mempool.c b/src/mi/mempool.c new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_access_fpreg.c b/src/ptrace/_UPT_access_fpreg.c new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_access_mem.c b/src/ptrace/_UPT_access_mem.c new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_access_reg.c b/src/ptrace/_UPT_access_reg.c new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_accessors.c b/src/ptrace/_UPT_accessors.c new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_create.c b/src/ptrace/_UPT_create.c new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_destroy.c b/src/ptrace/_UPT_destroy.c new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_find_proc_info.c b/src/ptrace/_UPT_find_proc_info.c new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_get_dyn_info_list_addr.c b/src/ptrace/_UPT_get_dyn_info_list_addr.c new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_get_proc_name.c b/src/ptrace/_UPT_get_proc_name.c new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_internal.h b/src/ptrace/_UPT_internal.h new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_put_unwind_info.c b/src/ptrace/_UPT_put_unwind_info.c new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_reg_offset.c b/src/ptrace/_UPT_reg_offset.c new file mode 100644 index 00000000..e69de29b diff --git a/src/ptrace/_UPT_resume.c b/src/ptrace/_UPT_resume.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/Backtrace.c b/src/unwind/Backtrace.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/DeleteException.c b/src/unwind/DeleteException.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/FindEnclosingFunction.c b/src/unwind/FindEnclosingFunction.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/ForcedUnwind.c b/src/unwind/ForcedUnwind.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/GetBSP.c b/src/unwind/GetBSP.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/GetCFA.c b/src/unwind/GetCFA.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/GetDataRelBase.c b/src/unwind/GetDataRelBase.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/GetGR.c b/src/unwind/GetGR.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/GetIP.c b/src/unwind/GetIP.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/GetLanguageSpecificData.c b/src/unwind/GetLanguageSpecificData.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/GetRegionStart.c b/src/unwind/GetRegionStart.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/GetTextRelBase.c b/src/unwind/GetTextRelBase.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/RaiseException.c b/src/unwind/RaiseException.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/Resume.c b/src/unwind/Resume.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/Resume_or_Rethrow.c b/src/unwind/Resume_or_Rethrow.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/SetGR.c b/src/unwind/SetGR.c new file mode 100644 index 00000000..e69de29b diff --git a/src/unwind/SetIP.c b/src/unwind/SetIP.c new file mode 100644 index 00000000..e69de29b diff --git a/src/x86/Gget_save_loc-x86.c b/src/x86/Gget_save_loc-x86.c index 1bd3560c..e69de29b 100644 --- a/src/x86/Gget_save_loc-x86.c +++ b/src/x86/Gget_save_loc-x86.c @@ -1,125 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2004 Hewlett-Packard Co - Contributed by David Mosberger-Tang - -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. */ - -#include "unwind_i.h" - -PROTECTED int -unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) -{ - struct cursor *c = (struct cursor *) cursor; - dwarf_loc_t loc; - - loc = DWARF_NULL_LOC; /* default to "not saved" */ - - switch (reg) - { - case UNW_X86_EIP: loc = c->dwarf.loc[EIP]; break; - case UNW_X86_CFA: break; - case UNW_X86_EAX: loc = c->dwarf.loc[EAX]; break; - case UNW_X86_ECX: loc = c->dwarf.loc[ECX]; break; - case UNW_X86_EDX: loc = c->dwarf.loc[EDX]; break; - case UNW_X86_EBX: loc = c->dwarf.loc[EBX]; break; - case UNW_X86_ESP: loc = c->dwarf.loc[ESP]; break; - case UNW_X86_EBP: loc = c->dwarf.loc[EBP]; break; - case UNW_X86_ESI: loc = c->dwarf.loc[ESI]; break; - case UNW_X86_EDI: loc = c->dwarf.loc[EDI]; break; - case UNW_X86_EFLAGS: loc = c->dwarf.loc[EFLAGS]; break; - case UNW_X86_TRAPNO: loc = c->dwarf.loc[TRAPNO]; break; - case UNW_X86_ST0: loc = c->dwarf.loc[ST0]; break; - - case UNW_X86_FCW: - case UNW_X86_FSW: - case UNW_X86_FTW: - case UNW_X86_FOP: - case UNW_X86_FCS: - case UNW_X86_FIP: - case UNW_X86_FEA: - case UNW_X86_FDS: - case UNW_X86_MXCSR: - case UNW_X86_GS: - case UNW_X86_FS: - case UNW_X86_ES: - case UNW_X86_DS: - case UNW_X86_SS: - case UNW_X86_CS: - case UNW_X86_TSS: - case UNW_X86_LDT: - loc = x86_scratch_loc (c, reg); - break; - - /* stacked fp registers */ - case UNW_X86_ST1: - case UNW_X86_ST2: - case UNW_X86_ST3: - case UNW_X86_ST4: - case UNW_X86_ST5: - case UNW_X86_ST6: - case UNW_X86_ST7: - /* SSE fp registers */ - case UNW_X86_XMM0_lo: - case UNW_X86_XMM0_hi: - case UNW_X86_XMM1_lo: - case UNW_X86_XMM1_hi: - case UNW_X86_XMM2_lo: - case UNW_X86_XMM2_hi: - case UNW_X86_XMM3_lo: - case UNW_X86_XMM3_hi: - case UNW_X86_XMM4_lo: - case UNW_X86_XMM4_hi: - case UNW_X86_XMM5_lo: - case UNW_X86_XMM5_hi: - case UNW_X86_XMM6_lo: - case UNW_X86_XMM6_hi: - case UNW_X86_XMM7_lo: - case UNW_X86_XMM7_hi: - loc = x86_scratch_loc (c, reg); - break; - - default: - break; - } - - memset (sloc, 0, sizeof (sloc)); - - if (DWARF_IS_NULL_LOC (loc)) - { - sloc->type = UNW_SLT_NONE; - return 0; - } - -#if !defined(UNW_LOCAL_ONLY) - if (DWARF_IS_REG_LOC (loc)) - { - sloc->type = UNW_SLT_REG; - sloc->u.regnum = DWARF_GET_LOC (loc); - } - else -#endif - { - sloc->type = UNW_SLT_MEMORY; - sloc->u.addr = DWARF_GET_LOC (loc); - } - return 0; -} diff --git a/src/x86/Lget_save_loc-x86.c b/src/x86/Lget_save_loc-x86.c index 46b6d3ed..e69de29b 100644 --- a/src/x86/Lget_save_loc-x86.c +++ b/src/x86/Lget_save_loc-x86.c @@ -1,5 +0,0 @@ -#define UNW_LOCAL_ONLY -#include -#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) -#include "Gget_save_loc-x86.c" -#endif