mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-25 00:27:39 +01:00
ALIAS unwind_get_accessors
This commit is contained in:
parent
c73a0f4d4e
commit
43934dae83
26 changed files with 40 additions and 32 deletions
|
@ -224,6 +224,7 @@ unw_save_loc_t;
|
|||
#define unw_create_addr_space UNW_OBJ(create_addr_space)
|
||||
#define unw_destroy_addr_space UNW_OBJ(destroy_addr_space)
|
||||
#define unw_get_accessors UNW_ARCH_OBJ(get_accessors)
|
||||
#define unw_get_accessors_int UNW_ARCH_OBJ(get_accessors_int)
|
||||
#define unw_init_local UNW_OBJ(init_local)
|
||||
#define unw_init_local2 UNW_OBJ(init_local2)
|
||||
#define unw_init_remote UNW_OBJ(init_remote)
|
||||
|
@ -250,6 +251,7 @@ unw_save_loc_t;
|
|||
extern unw_addr_space_t unw_create_addr_space (unw_accessors_t *, int);
|
||||
extern void unw_destroy_addr_space (unw_addr_space_t);
|
||||
extern unw_accessors_t *unw_get_accessors (unw_addr_space_t);
|
||||
extern unw_accessors_t *unw_get_accessors_int (unw_addr_space_t);
|
||||
extern void unw_flush_cache (unw_addr_space_t, unw_word_t, unw_word_t);
|
||||
extern int unw_set_caching_policy (unw_addr_space_t, unw_caching_policy_t);
|
||||
extern int unw_set_cache_size (unw_addr_space_t, size_t, int);
|
||||
|
|
|
@ -43,7 +43,7 @@ unw_is_signal_frame (unw_cursor_t *cursor)
|
|||
int ret;
|
||||
|
||||
as = c->dwarf.as;
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
arg = c->dwarf.as_arg;
|
||||
|
||||
ip = c->dwarf.ip;
|
||||
|
|
|
@ -39,7 +39,7 @@ is_plt_entry (struct dwarf_cursor *c)
|
|||
unw_accessors_t *a;
|
||||
int ret;
|
||||
|
||||
a = unw_get_accessors (c->as);
|
||||
a = unw_get_accessors_int (c->as);
|
||||
if ((ret = (*a->access_mem) (c->as, c->ip, &w0, 0, c->as_arg)) < 0
|
||||
|| (ret = (*a->access_mem) (c->as, c->ip + 8, &w1, 0, c->as_arg)) < 0)
|
||||
return 0;
|
||||
|
|
|
@ -102,7 +102,7 @@ unw_is_signal_frame (unw_cursor_t *cursor)
|
|||
int ret;
|
||||
|
||||
as = c->dwarf.as;
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
arg = c->dwarf.as_arg;
|
||||
|
||||
ip = c->dwarf.ip;
|
||||
|
|
|
@ -160,7 +160,7 @@ unw_is_signal_frame (unw_cursor_t *cursor)
|
|||
int ret;
|
||||
|
||||
as = c->dwarf.as;
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
arg = c->dwarf.as_arg;
|
||||
|
||||
/* The least bit denotes thumb/arm mode. Do not read there. */
|
||||
|
|
|
@ -196,7 +196,7 @@ dwarf_stack_aligned(struct dwarf_cursor *c, unw_word_t cfa_addr,
|
|||
uint8_t opcode;
|
||||
unw_word_t operand1;
|
||||
|
||||
a = unw_get_accessors (c->as);
|
||||
a = unw_get_accessors_int (c->as);
|
||||
arg = c->as_arg;
|
||||
|
||||
ret = dwarf_read_uleb128(c->as, a, &rbp_addr, &len, arg);
|
||||
|
@ -281,7 +281,7 @@ do { \
|
|||
|
||||
as = c->as;
|
||||
arg = c->as_arg;
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
end_addr = *addr + len;
|
||||
*is_register = 0;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ linear_search (unw_addr_space_t as, unw_word_t ip,
|
|||
unw_word_t fde_count,
|
||||
unw_proc_info_t *pi, int need_unwind_info, void *arg)
|
||||
{
|
||||
unw_accessors_t *a = unw_get_accessors (unw_local_addr_space);
|
||||
unw_accessors_t *a = unw_get_accessors_int (unw_local_addr_space);
|
||||
unw_word_t i = 0, fde_addr, addr = eh_frame_start;
|
||||
int ret;
|
||||
|
||||
|
@ -316,7 +316,7 @@ dwarf_find_debug_frame (int found, unw_dyn_info_t *di_debug, unw_word_t ip,
|
|||
{
|
||||
addr = (unw_word_t) (uintptr_t) buf;
|
||||
|
||||
a = unw_get_accessors (unw_local_addr_space);
|
||||
a = unw_get_accessors_int (unw_local_addr_space);
|
||||
|
||||
/* Find all FDE entries in debug_frame, and make into a sorted
|
||||
index. */
|
||||
|
@ -586,7 +586,7 @@ dwarf_callback (struct dl_phdr_info *info, size_t size, void *ptr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
a = unw_get_accessors (unw_local_addr_space);
|
||||
a = unw_get_accessors_int (unw_local_addr_space);
|
||||
addr = (unw_word_t) (uintptr_t) (&hdr->eh_frame);
|
||||
|
||||
/* (Optionally) read eh_frame_ptr: */
|
||||
|
@ -764,7 +764,7 @@ remote_lookup (unw_addr_space_t as,
|
|||
struct table_entry *e, int32_t *last_ip_offset, void *arg)
|
||||
{
|
||||
unsigned long table_len = table_size / sizeof (struct table_entry);
|
||||
unw_accessors_t *a = unw_get_accessors (as);
|
||||
unw_accessors_t *a = unw_get_accessors_int (as);
|
||||
unsigned long lo, hi, mid;
|
||||
unw_word_t e_addr = 0;
|
||||
int32_t start = 0;
|
||||
|
@ -848,7 +848,7 @@ dwarf_search_unwind_table (unw_addr_space_t as, unw_word_t ip,
|
|||
#endif
|
||||
}
|
||||
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
|
||||
segbase = di->u.rti.segbase;
|
||||
if (di->format == UNW_INFO_FORMAT_IP_OFFSET) {
|
||||
|
|
|
@ -138,7 +138,7 @@ dwarf_find_unwind_table (struct elf_dyn_info *edi, unw_addr_space_t as,
|
|||
return -UNW_ENOINFO;
|
||||
}
|
||||
|
||||
a = unw_get_accessors (unw_local_addr_space);
|
||||
a = unw_get_accessors_int (unw_local_addr_space);
|
||||
addr = to_unw_word (&hdr->eh_frame);
|
||||
|
||||
/* Fill in a dummy proc_info structure. We just need to fill in
|
||||
|
|
|
@ -109,7 +109,7 @@ run_cfi_program (struct dwarf_cursor *c, dwarf_state_record_t *sr,
|
|||
as = c->as;
|
||||
arg = c->as_arg;
|
||||
}
|
||||
unw_accessors_t *a = unw_get_accessors (as);
|
||||
unw_accessors_t *a = unw_get_accessors_int (as);
|
||||
int ret = 0;
|
||||
|
||||
while (*ip <= end_ip && *addr < end_addr && ret >= 0)
|
||||
|
@ -773,7 +773,7 @@ apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs)
|
|||
|
||||
as = c->as;
|
||||
arg = c->as_arg;
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
|
||||
/* Evaluate the CFA first, because it may be referred to by other
|
||||
expressions. */
|
||||
|
|
|
@ -37,7 +37,7 @@ unw_is_signal_frame (unw_cursor_t *cursor)
|
|||
int ret;
|
||||
|
||||
as = c->dwarf.as;
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
arg = c->dwarf.as_arg;
|
||||
|
||||
/* Check if IP points at sigreturn() sequence. On Linux, this normally is:
|
||||
|
|
|
@ -25,6 +25,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|||
|
||||
#include "unwind_i.h"
|
||||
|
||||
HIDDEN ALIAS(unw_get_accessors) unw_accessors_t *
|
||||
unw_get_accessors_int (unw_addr_space_t as);
|
||||
|
||||
unw_accessors_t *
|
||||
unw_get_accessors (unw_addr_space_t as)
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@ is_local_addr_space (unw_addr_space_t as)
|
|||
static inline int
|
||||
read_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *valp, void *arg)
|
||||
{
|
||||
unw_accessors_t *a = unw_get_accessors (as);
|
||||
unw_accessors_t *a = unw_get_accessors_int (as);
|
||||
|
||||
return (*a->access_mem) (as, addr, valp, 0, arg);
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ remote_lookup (unw_addr_space_t as,
|
|||
struct ia64_table_entry *e, void *arg)
|
||||
{
|
||||
unw_word_t e_addr = 0, start_offset, end_offset, info_offset;
|
||||
unw_accessors_t *a = unw_get_accessors (as);
|
||||
unw_accessors_t *a = unw_get_accessors_int (as);
|
||||
unsigned long lo, hi, mid;
|
||||
int ret;
|
||||
|
||||
|
@ -165,7 +165,7 @@ _Uia64_find_dyn_list (unw_addr_space_t as, unw_dyn_info_t *di, void *arg)
|
|||
|
||||
case UNW_INFO_FORMAT_REMOTE_TABLE:
|
||||
{
|
||||
unw_accessors_t *a = unw_get_accessors (as);
|
||||
unw_accessors_t *a = unw_get_accessors_int (as);
|
||||
unw_word_t e_addr = di->u.rti.table_data;
|
||||
|
||||
table_size = di->u.rti.table_len * sizeof (unw_word_t);
|
||||
|
|
|
@ -205,7 +205,7 @@ unwi_dyn_remote_find_proc_info (unw_addr_space_t as, unw_word_t ip,
|
|||
unw_proc_info_t *pi,
|
||||
int need_unwind_info, void *arg)
|
||||
{
|
||||
unw_accessors_t *a = unw_get_accessors (as);
|
||||
unw_accessors_t *a = unw_get_accessors_int (as);
|
||||
unw_word_t dyn_list_addr, addr, next_addr, gen1, gen2, start_ip, end_ip;
|
||||
unw_dyn_info_t *di = NULL;
|
||||
int ret;
|
||||
|
@ -311,7 +311,7 @@ unwi_dyn_validate_cache (unw_addr_space_t as, void *arg)
|
|||
in the cache. */
|
||||
return 0;
|
||||
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
addr = as->dyn_info_list_addr;
|
||||
|
||||
if (fetchw (as, a, &addr, &gen, arg) < 0)
|
||||
|
|
|
@ -25,6 +25,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|||
|
||||
#include "libunwind_i.h"
|
||||
|
||||
HIDDEN ALIAS(unw_get_accessors) unw_accessors_t *
|
||||
unw_get_accessors_int (unw_addr_space_t as);
|
||||
|
||||
unw_accessors_t *
|
||||
unw_get_accessors (unw_addr_space_t as)
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ int
|
|||
unw_get_proc_info_by_ip (unw_addr_space_t as, unw_word_t ip,
|
||||
unw_proc_info_t *pi, void *as_arg)
|
||||
{
|
||||
unw_accessors_t *a = unw_get_accessors (as);
|
||||
unw_accessors_t *a = unw_get_accessors_int (as);
|
||||
int ret;
|
||||
|
||||
ret = unwi_find_dynamic_proc_info (as, ip, pi, 0, as_arg);
|
||||
|
|
|
@ -49,7 +49,7 @@ static inline int
|
|||
get_proc_name (unw_addr_space_t as, unw_word_t ip,
|
||||
char *buf, size_t buf_len, unw_word_t *offp, void *arg)
|
||||
{
|
||||
unw_accessors_t *a = unw_get_accessors (as);
|
||||
unw_accessors_t *a = unw_get_accessors_int (as);
|
||||
unw_proc_info_t pi;
|
||||
int ret;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ unw_is_signal_frame (unw_cursor_t *cursor)
|
|||
int ret;
|
||||
|
||||
as = c->dwarf.as;
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
arg = c->dwarf.as_arg;
|
||||
|
||||
ip = c->dwarf.ip;
|
||||
|
|
|
@ -56,7 +56,7 @@ unw_is_signal_frame (unw_cursor_t * cursor)
|
|||
consecutive 32-bit words, so the second 8-byte word needs to be
|
||||
shifted right by 32 bits (think big-endian) */
|
||||
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
if ((ret = (*a->access_mem) (as, ip, &w0, 0, arg)) < 0
|
||||
|| (ret = (*a->access_mem) (as, ip + 8, &w1, 0, arg)) < 0)
|
||||
return 0;
|
||||
|
|
|
@ -448,7 +448,7 @@ unw_step (unw_cursor_t * cursor)
|
|||
{
|
||||
unw_word_t ip = c->dwarf.ip;
|
||||
unw_addr_space_t as = c->dwarf.as;
|
||||
unw_accessors_t *a = unw_get_accessors (as);
|
||||
unw_accessors_t *a = unw_get_accessors_int (as);
|
||||
void *arg = c->dwarf.as_arg;
|
||||
uint32_t toc_save = (as->abi == UNW_PPC64_ABI_ELFv2)? 24 : 40;
|
||||
int32_t inst;
|
||||
|
|
|
@ -36,7 +36,7 @@ tdep_get_func_addr (unw_addr_space_t as, unw_word_t addr,
|
|||
unw_accessors_t *a;
|
||||
int ret;
|
||||
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
/* Entry-point is stored in the 1st word of the function descriptor.
|
||||
In case that changes in the future, we'd have to update the line
|
||||
below and read the word at addr + offset: */
|
||||
|
|
|
@ -75,7 +75,7 @@ unw_is_signal_frame (unw_cursor_t *cursor)
|
|||
int ret;
|
||||
|
||||
as = c->dwarf.as;
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
arg = c->dwarf.as_arg;
|
||||
|
||||
ip = c->dwarf.ip;
|
||||
|
|
|
@ -51,7 +51,7 @@ unw_is_signal_frame (unw_cursor_t *cursor)
|
|||
int ret;
|
||||
|
||||
as = c->dwarf.as;
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
arg = c->dwarf.as_arg;
|
||||
|
||||
ip = c->dwarf.ip;
|
||||
|
|
|
@ -46,7 +46,7 @@ unw_is_signal_frame (unw_cursor_t *cursor)
|
|||
int ret;
|
||||
|
||||
as = c->dwarf.as;
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
arg = c->dwarf.as_arg;
|
||||
|
||||
/* Check if EIP points at sigreturn() sequence. It can be:
|
||||
|
|
|
@ -39,7 +39,7 @@ unw_is_signal_frame (unw_cursor_t *cursor)
|
|||
int ret;
|
||||
|
||||
as = c->dwarf.as;
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
arg = c->dwarf.as_arg;
|
||||
|
||||
/* Check if EIP points at sigreturn() sequence. On Linux, this is:
|
||||
|
|
|
@ -45,7 +45,7 @@ unw_is_signal_frame (unw_cursor_t *cursor)
|
|||
int ret;
|
||||
|
||||
as = c->dwarf.as;
|
||||
a = unw_get_accessors (as);
|
||||
a = unw_get_accessors_int (as);
|
||||
arg = c->dwarf.as_arg;
|
||||
|
||||
/* Check if RIP points at sigreturn sequence.
|
||||
|
|
|
@ -39,7 +39,7 @@ is_plt_entry (struct dwarf_cursor *c)
|
|||
unw_accessors_t *a;
|
||||
int ret;
|
||||
|
||||
a = unw_get_accessors (c->as);
|
||||
a = unw_get_accessors_int (c->as);
|
||||
if ((ret = (*a->access_mem) (c->as, c->ip, &w0, 0, c->as_arg)) < 0
|
||||
|| (ret = (*a->access_mem) (c->as, c->ip + 8, &w1, 0, c->as_arg)) < 0)
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue