From ea3b3225d8bdac8c89dcd3b0700ba3e0c02a96c2 Mon Sep 17 00:00:00 2001 From: "mostang.com!davidm" Date: Thu, 12 Dec 2002 09:17:41 +0000 Subject: [PATCH] (local_find_proc_info): New function. (remote_find_proc_info): Ditto. 2002/12/11 18:56:18-08:00 mostang.com!davidm Rename: src/ia64/Gfind_dynamic_proc_info.c -> src/Gfind_dynamic_proc_info.c (Logical change 1.30) --- src/Gfind_dynamic_proc_info.c | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/Gfind_dynamic_proc_info.c diff --git a/src/Gfind_dynamic_proc_info.c b/src/Gfind_dynamic_proc_info.c new file mode 100644 index 00000000..aabfb9bc --- /dev/null +++ b/src/Gfind_dynamic_proc_info.c @@ -0,0 +1,60 @@ +#include + +#include "internal.h" + +static inline int +local_find_proc_info (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, + int need_unwind_info, void *arg) +{ + unw_dyn_info_t *di; + + for (di = _U_dyn_info_list.first; di; di = di->next) + if (ip >= di->start_ip && ip < di->end_ip) + return unwi_extract_dynamic_proc_info (as, ip, pi, di, need_unwind_info, + arg); + return -UNW_ENOINFO; +} + +static inline int +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_word_t generation; + int ret; + + ret = unwi_dyn_remote_find_proc_info (as, ip, pi, &generation, + need_unwind_info, arg); + if (ret < 0) + return ret; + + /* Note: this can't go into dyn-remote.c because that file get's + compiled exactly once (there are no separate local/general + versions) and the call to unw_flush_cache() must evaluate to + either the local or generic version. */ + if (as->dyn_generation != generation) + { + unw_flush_cache (as, 0, 0); + as->dyn_generation = generation; + } + return 0; +} + +HIDDEN int +unwi_find_dynamic_proc_info (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, int need_unwind_info, + void *arg) +{ +#ifdef UNW_LOCAL_ONLY + return local_find_proc_info (as, ip, pi, need_unwind_info, arg); +#else +# ifdef UNW_REMOTE_ONLY + return remote_find_proc_info (as, ip, pi, need_unwind_info, arg); +# else + if (as == unw_local_addr_space) + return local_find_proc_info (as, ip, pi, need_unwind_info, arg); + else + return remote_find_proc_info (as, ip, pi, need_unwind_info, arg); +# endif +#endif +}