mostang.com!davidm | 5109550 | 2003-03-11 01:11:18 +0000 | [diff] [blame] | 1 | /* libunwind - a platform-independent unwind library |
| 2 | Copyright (C) 2002 Hewlett-Packard Co |
| 3 | Contributed by David Mosberger-Tang <davidm@hpl.hp.com> |
| 4 | |
| 5 | This file is part of libunwind. |
| 6 | |
| 7 | Permission is hereby granted, free of charge, to any person obtaining |
| 8 | a copy of this software and associated documentation files (the |
| 9 | "Software"), to deal in the Software without restriction, including |
| 10 | without limitation the rights to use, copy, modify, merge, publish, |
| 11 | distribute, sublicense, and/or sell copies of the Software, and to |
| 12 | permit persons to whom the Software is furnished to do so, subject to |
| 13 | the following conditions: |
| 14 | |
| 15 | The above copyright notice and this permission notice shall be |
| 16 | included in all copies or substantial portions of the Software. |
| 17 | |
| 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
| 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
| 25 | |
| 26 | #ifndef TDEP_X86_H |
| 27 | #define TDEP_X86_H |
| 28 | |
| 29 | /* Target-dependent definitions that are internal to libunwind but need |
| 30 | to be shared with target-independent code. */ |
| 31 | |
| 32 | #include <stdlib.h> |
| 33 | #include <libunwind.h> |
| 34 | |
| 35 | enum x86_pregnum |
| 36 | { |
| 37 | X86_NUM_PREGS |
| 38 | }; |
| 39 | |
| 40 | struct x86_loc |
| 41 | { |
| 42 | unw_word_t val; |
| 43 | #ifndef UNW_LOCAL_ONLY |
| 44 | unw_word_t type; /* see X86_LOC_TYPE_* macros. */ |
| 45 | #endif |
| 46 | }; |
| 47 | |
| 48 | struct unw_addr_space |
| 49 | { |
| 50 | struct unw_accessors acc; |
| 51 | unw_caching_policy_t caching_policy; |
| 52 | uint32_t cache_generation; |
| 53 | unw_word_t dyn_generation; /* see dyn-common.h */ |
| 54 | unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ |
| 55 | }; |
| 56 | |
| 57 | struct cursor |
| 58 | { |
| 59 | unw_addr_space_t as; |
| 60 | void *as_arg; |
| 61 | |
| 62 | /* IP & SP cache: */ |
| 63 | unw_word_t eip; |
| 64 | unw_word_t esp; |
| 65 | |
| 66 | struct x86_loc eip_loc; |
| 67 | struct x86_loc ebp_loc; |
| 68 | }; |
| 69 | |
| 70 | /* Platforms that support UNW_INFO_FORMAT_TABLE need to define |
| 71 | tdep_search_unwind_table. */ |
| 72 | #define tdep_search_unwind_table(a,b,c,d,e,f) \ |
| 73 | UNW_ARCH_OBJ(search_unwind_table) (a,b,c,d,e,f) |
| 74 | #define tdep_find_proc_info(as,ip,pi,n,a) \ |
| 75 | UNW_ARCH_OBJ(find_proc_info) (as,ip,pi,n,a) |
| 76 | #define tdep_put_unwind_info(a,b,c) UNW_ARCH_OBJ(put_unwind_info)(a,b,c) |
| 77 | #define tdep_uc_addr(uc,reg) UNW_ARCH_OBJ(uc_addr)(uc,reg) |
hp.com!davidm | f9cc1e4 | 2003-03-29 07:32:50 +0000 | [diff] [blame^] | 78 | #define tdep_get_elf_image(a,b,c,d,e) UNW_ARCH_OBJ(get_elf_image) (a, b, c, \ |
| 79 | d, e) |
mostang.com!davidm | 5109550 | 2003-03-11 01:11:18 +0000 | [diff] [blame] | 80 | #define tdep_debug_level UNW_ARCH_OBJ(debug_level) |
| 81 | |
| 82 | extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, |
| 83 | unw_dyn_info_t *di, unw_proc_info_t *pi, |
| 84 | int need_unwind_info, void *arg); |
| 85 | extern int tdep_find_proc_info (unw_addr_space_t as, unw_word_t ip, |
| 86 | unw_proc_info_t *pi, int need_unwind_info, |
| 87 | void *arg); |
| 88 | extern void tdep_put_unwind_info (unw_addr_space_t as, |
| 89 | unw_proc_info_t *pi, void *arg); |
| 90 | extern void *tdep_uc_addr (ucontext_t *uc, int reg); |
hp.com!davidm | f9cc1e4 | 2003-03-29 07:32:50 +0000 | [diff] [blame^] | 91 | extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, |
| 92 | unsigned long *segbase, unsigned long *mapoff); |
mostang.com!davidm | 5109550 | 2003-03-11 01:11:18 +0000 | [diff] [blame] | 93 | extern int tdep_debug_level; |
| 94 | |
| 95 | #endif /* TDEP_X86_H */ |