From patchwork Thu Oct 27 08:38:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken Werner X-Patchwork-Id: 4849 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 95F5123E0C for ; Thu, 27 Oct 2011 08:38:15 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 7DD48A18321 for ; Thu, 27 Oct 2011 08:38:15 +0000 (UTC) Received: by faan26 with SMTP id n26so3464822faa.11 for ; Thu, 27 Oct 2011 01:38:15 -0700 (PDT) Received: by 10.223.16.82 with SMTP id n18mr65214077faa.2.1319704695201; Thu, 27 Oct 2011 01:38:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.1.71 with SMTP id 7cs37906lak; Thu, 27 Oct 2011 01:38:14 -0700 (PDT) Received: by 10.213.26.19 with SMTP id b19mr2690222ebc.90.1319704694517; Thu, 27 Oct 2011 01:38:14 -0700 (PDT) Received: from mtagate7.uk.ibm.com (mtagate7.uk.ibm.com. [194.196.100.167]) by mx.google.com with ESMTPS id c7si1337378eei.166.2011.10.27.01.38.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Oct 2011 01:38:14 -0700 (PDT) Received-SPF: neutral (google.com: 194.196.100.167 is neither permitted nor denied by best guess record for domain of ken.werner@linaro.org) client-ip=194.196.100.167; Authentication-Results: mx.google.com; spf=neutral (google.com: 194.196.100.167 is neither permitted nor denied by best guess record for domain of ken.werner@linaro.org) smtp.mail=ken.werner@linaro.org Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p9R8cDGn030019 for ; Thu, 27 Oct 2011 08:38:13 GMT Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9R8cD2E2027564 for ; Thu, 27 Oct 2011 09:38:13 +0100 Received: from d06av11.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9R8cDeO018269 for ; Thu, 27 Oct 2011 02:38:13 -0600 Received: from kiste.boeblingen.de.ibm.com (dyn-9-152-224-38.boeblingen.de.ibm.com [9.152.224.38]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p9R8cCbB018201; Thu, 27 Oct 2011 02:38:13 -0600 From: Ken Werner To: libunwind-devel@nongnu.org Subject: [PATCH 2/6] UNW_REMOTE_ONLY fixes Date: Thu, 27 Oct 2011 10:38:08 +0200 Message-Id: <1319704692-4464-3-git-send-email-ken.werner@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1319704692-4464-1-git-send-email-ken.werner@linaro.org> References: <1319704692-4464-1-git-send-email-ken.werner@linaro.org> Exclude because it is only required for local unwinding when iterating over the program headers. Have the following DWARF related functions available in case of UNW_REMOTE_ONLY because they are used by libunwind-ptrace: dwarf_find_debug_frame locate_debug_info find_binary_for_address load_debug_frame debug_frame_tab_new debug_frame_tab_append debug_frame_tab_shrink debug_frame_tab_compare Signed-off-by: Ken Werner --- include/dwarf.h | 4 ++++ src/dwarf/Gfind_proc_info-lsb.c | 3 +++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/include/dwarf.h b/include/dwarf.h index 1d4f5df..cdf9f24 100644 --- a/include/dwarf.h +++ b/include/dwarf.h @@ -39,7 +39,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ struct dwarf_cursor; /* forward-declaration */ #include "dwarf-config.h" +#ifndef UNW_REMOTE_ONLY #include +#endif #include /* DWARF expression opcodes. */ @@ -378,10 +380,12 @@ struct dwarf_callback_data #define dwarf_step UNW_OBJ (dwarf_step) extern int dwarf_init (void); +#ifndef UNW_REMOTE_ONLY extern int dwarf_callback (struct dl_phdr_info *info, size_t size, void *ptr); extern int dwarf_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, int need_unwind_info, void *arg); +#endif /* !UNW_REMOTE_ONLY */ extern int dwarf_find_debug_frame (int found, unw_dyn_info_t *di_debug, struct dl_phdr_info *info, unw_word_t ip); extern int dwarf_search_unwind_table (unw_addr_space_t as, diff --git a/src/dwarf/Gfind_proc_info-lsb.c b/src/dwarf/Gfind_proc_info-lsb.c index 22899d8..77d1c00 100644 --- a/src/dwarf/Gfind_proc_info-lsb.c +++ b/src/dwarf/Gfind_proc_info-lsb.c @@ -79,6 +79,7 @@ linear_search (unw_addr_space_t as, unw_word_t ip, } return -UNW_ENOINFO; } +#endif /* !UNW_REMOTE_ONLY */ #ifdef CONFIG_DEBUG_FRAME /* Load .debug_frame section from FILE. Allocates and returns space @@ -555,6 +556,8 @@ dwarf_find_debug_frame (int found, unw_dyn_info_t *di_debug, #endif /* CONFIG_DEBUG_FRAME */ +#ifndef UNW_REMOTE_ONLY + /* ptr is a pointer to a dwarf_callback_data structure and, on entry, member ip contains the instruction-pointer we're looking for. */