X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fptrace%2F_UPT_find_proc_info.c;h=b3209f451ea9f7113dd984145dadfeec0b642ade;hb=36981f1f5aac1c4e975a4a3d8cea68f1a4817b5c;hp=53dd1e7fcb7bbe663716d74ae1af909faf571556;hpb=0349587920c255c479240518d9c04581977144eb;p=platform%2Fupstream%2Flibunwind.git diff --git a/src/ptrace/_UPT_find_proc_info.c b/src/ptrace/_UPT_find_proc_info.c index 53dd1e7..b3209f4 100644 --- a/src/ptrace/_UPT_find_proc_info.c +++ b/src/ptrace/_UPT_find_proc_info.c @@ -1,6 +1,6 @@ /* libunwind - a platform-independent unwind library Copyright (C) 2003-2004 Hewlett-Packard Co - Contributed by David Mosberger-Tang + Contributed by David Mosberger-Tang This file is part of libunwind. @@ -91,7 +91,7 @@ get_unwind_info (struct elf_dyn_info *edi, pid_t pid, unw_addr_space_t as, unw_w int _UPT_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, - int need_unwind_info, void *arg) + int need_unwind_info, void *arg) { struct UPT_info *ui = arg; int ret = -UNW_ENOINFO; @@ -103,33 +103,37 @@ _UPT_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, if (ui->edi.ktab.format != -1) { /* The kernel unwind table resides in local memory, so we have - to use the local address space to search it. Since - _UPT_put_unwind_info() has no easy way of detecting this - case, we simply make a copy of the unwind-info, so - _UPT_put_unwind_info() can always free() the unwind-info - without ill effects. */ + to use the local address space to search it. Since + _UPT_put_unwind_info() has no easy way of detecting this + case, we simply make a copy of the unwind-info, so + _UPT_put_unwind_info() can always free() the unwind-info + without ill effects. */ ret = tdep_search_unwind_table (unw_local_addr_space, ip, &ui->edi.ktab, pi, - need_unwind_info, arg); + need_unwind_info, arg); if (ret >= 0) - { - if (!need_unwind_info) - pi->unwind_info = NULL; - else - { - void *mem = malloc (pi->unwind_info_size); - - if (!mem) - return -UNW_ENOMEM; - memcpy (mem, pi->unwind_info, pi->unwind_info_size); - pi->unwind_info = mem; - } - } + { + if (!need_unwind_info) + pi->unwind_info = NULL; + else + { + void *mem = malloc (pi->unwind_info_size); + + if (!mem) + return -UNW_ENOMEM; + memcpy (mem, pi->unwind_info, pi->unwind_info_size); + pi->unwind_info = mem; + } + } } #endif if (ret == -UNW_ENOINFO && ui->edi.di_cache.format != -1) ret = tdep_search_unwind_table (as, ip, &ui->edi.di_cache, - pi, need_unwind_info, arg); + pi, need_unwind_info, arg); + + if (ret == -UNW_ENOINFO && ui->edi.di_debug.format != -1) + ret = tdep_search_unwind_table (as, ip, &ui->edi.di_debug, pi, + need_unwind_info, arg); #if UNW_TARGET_ARM if (ret == -UNW_ENOINFO && ui->edi.di_arm.format != -1) @@ -137,9 +141,5 @@ _UPT_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, need_unwind_info, arg); #endif - if (ret == -UNW_ENOINFO && ui->edi.di_debug.format != -1) - ret = tdep_search_unwind_table (as, ip, &ui->edi.di_debug, pi, - need_unwind_info, arg); - return ret; }