From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24936 invoked by alias); 11 Oct 2007 16:36:17 -0000 Received: (qmail 24786 invoked by uid 22791); 11 Oct 2007 16:36:16 -0000 X-Spam-Status: No, hits=0.2 required=5.0 tests=AWL,BAYES_50,DK_POLICY_SIGNSOME,DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: sourceware.org Received: from igw1.br.ibm.com (HELO igw1.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 11 Oct 2007 16:36:12 +0000 Received: from mailhub1.br.ibm.com (mailhub1 [9.18.232.109]) by igw1.br.ibm.com (Postfix) with ESMTP id 0D64B32C049 for ; Thu, 11 Oct 2007 13:17:14 -0300 (BRT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l9BGa8N83166306 for ; Thu, 11 Oct 2007 13:36:08 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l9BGa81G002681 for ; Thu, 11 Oct 2007 13:36:08 -0300 Received: from [9.67.90.246] (wecm-9-67-90-246.wecm.ibm.com [9.67.90.246]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l9BGa4H9002563 for ; Thu, 11 Oct 2007 13:36:06 -0300 Subject: New Libunwind for Power Fix From: Jose Flavio Aguilar Paulino To: Frysk Content-Type: multipart/mixed; boundary="=-RdIkLL5Krl5yIwPRdTu3" Date: Thu, 11 Oct 2007 16:36:00 -0000 Message-Id: <1192120504.12765.2.camel@kandinsky.prado> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 X-Virus-Checked: Checked by ClamAV on sourceware.org Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q4/txt/msg00042.txt.bz2 --=-RdIkLL5Krl5yIwPRdTu3 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 322 This patch fix the libunwind that was recently imported. Through this libunwind can properly compile for Power64 and Power32. It's necessary run autoreconf in libunwind. best regards, -- Jose Flavio Aguilar Paulino (jflavio@br.ibm.com) System / Software Engineer Toolchain Team LTC, Linux Technology Center IBM Brazil --=-RdIkLL5Krl5yIwPRdTu3 Content-Disposition: attachment; filename=frysk_libunwind_4_power Content-Type: text/x-patch; name=frysk_libunwind_4_power; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 7365 Index: frysk/frysk-imports/libunwind/include/tdep-ppc32/libunwind_i.h =================================================================== --- frysk.orig/frysk-imports/libunwind/include/tdep-ppc32/libunwind_i.h +++ frysk/frysk-imports/libunwind/include/tdep-ppc32/libunwind_i.h @@ -255,6 +255,7 @@ dwarf_put (struct dwarf_cursor *c, dwarf #define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) #define tdep_access_reg UNW_OBJ(access_reg) #define tdep_access_fpreg UNW_OBJ(access_fpreg) +#define tdep_fetch_proc_info_post UNW_OBJ(fetch_proc_info_post) #define tdep_get_func_addr UNW_OBJ(get_func_addr) #ifdef UNW_LOCAL_ONLY @@ -287,8 +288,10 @@ extern int tdep_search_unwind_table (unw unw_proc_info_t * pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t * uc, int reg); -extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, - unsigned long *segbase, unsigned long *mapoff); +extern int tdep_get_elf_image (unw_addr_space_t as, struct elf_image *ei, + pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + void *arg); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t * valp, int write); extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, Index: frysk/frysk-imports/libunwind/include/tdep-ppc64/libunwind_i.h =================================================================== --- frysk.orig/frysk-imports/libunwind/include/tdep-ppc64/libunwind_i.h +++ frysk/frysk-imports/libunwind/include/tdep-ppc64/libunwind_i.h @@ -255,6 +255,7 @@ dwarf_put (struct dwarf_cursor *c, dwarf #define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) #define tdep_access_reg UNW_OBJ(access_reg) #define tdep_access_fpreg UNW_OBJ(access_fpreg) +#define tdep_fetch_proc_info_post UNW_OBJ(fetch_proc_info_post) #define tdep_get_func_addr UNW_OBJ(get_func_addr) #ifdef UNW_LOCAL_ONLY @@ -287,8 +288,9 @@ extern int tdep_search_unwind_table (unw unw_proc_info_t * pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t * uc, int reg); -extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, - unsigned long *segbase, unsigned long *mapoff); +extern int tdep_get_elf_image (unw_addr_space_t as, struct elf_image *ei, pid_t pid, + unw_word_t ip, unsigned long *segbase, + unsigned long *mapoff, void *arg); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t * valp, int write); extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, Index: frysk/frysk-imports/libunwind/src/Makefile.am =================================================================== --- frysk.orig/frysk-imports/libunwind/src/Makefile.am +++ frysk/frysk-imports/libunwind/src/Makefile.am @@ -207,12 +207,14 @@ libunwind_x86_64_la_SOURCES_x86_64 = $(l # The list of local files that go to Power 64 and 32: libunwind_la_SOURCES_ppc = ppc/Lcreate_addr_space.c \ ppc/Lget_proc_info.c ppc/Lget_save_loc.c ppc/Linit_local.c \ - ppc/Linit_remote.c ppc/Lis_signal_frame.c + ppc/Linit_remote.c ppc/Lis_signal_frame.c \ + ppc/Lfetch_proc_info_post.c # The list of generic files that go to Power 64 and 32: libunwind_ppc_la_SOURCES_ppc_generic = ppc/Gcreate_addr_space.c \ ppc/Gget_proc_info.c ppc/Gget_save_loc.c ppc/Ginit_local.c \ - ppc/Ginit_remote.c ppc/Gis_signal_frame.c + ppc/Ginit_remote.c ppc/Gis_signal_frame.c \ + ppc/Gfetch_proc_info_post.c # The list of files that go both into libunwind and libunwind-ppc32: libunwind_la_SOURCES_ppc32_common = $(libunwind_la_SOURCES_common) \ Index: frysk/frysk-imports/libunwind/src/ppc/Gfetch_proc_info_post.c =================================================================== --- /dev/null +++ frysk/frysk-imports/libunwind/src/ppc/Gfetch_proc_info_post.c @@ -0,0 +1,51 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2006 Hewlett-Packard Development Company, L.P. + Contributed by Jan Kratochvil + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +HIDDEN int +tdep_fetch_proc_info_post (struct dwarf_cursor *c, unw_word_t ip, int need_unwind_info) +{ + struct cursor *cursor = (struct cursor *) c; + + /* Should happen only if `!need_unwind_info'. */ + if (!c->pi_valid) + return 0; + /* Should happen only if `!need_unwind_info'. */ + if (!c->pi.unwind_info) + return 0; + + /* Reset the value for this frame. */ + cursor->sigcontext_format = PPC_SCF_NONE; + + /* Normal non-signal frames case. */ + if (!((struct dwarf_cie_info *) c->pi.unwind_info)->signal_frame) + return 0; + + cursor->sigcontext_format = PPC_SCF_LINUX_RT_SIGFRAME; + cursor->sigcontext_addr = c->cfa + 4; + + return 0; +} Index: frysk/frysk-imports/libunwind/src/ppc/Lfetch_proc_info_post.c =================================================================== --- /dev/null +++ frysk/frysk-imports/libunwind/src/ppc/Lfetch_proc_info_post.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gfetch_proc_info_post.c" +#endif Index: frysk/frysk-imports/libunwind/src/ppc32/Ginit.c =================================================================== --- frysk.orig/frysk-imports/libunwind/src/ppc32/Ginit.c +++ frysk/frysk-imports/libunwind/src/ppc32/Ginit.c @@ -199,7 +199,7 @@ get_static_proc_name (unw_addr_space_t a char *buf, size_t buf_len, unw_word_t *offp, void *arg) { - return _Uelf32_get_proc_name (as, getpid (), ip, buf, buf_len, offp); + return _Uelf32_get_proc_name (as, getpid (), ip, buf, buf_len, offp, arg); } HIDDEN void Index: frysk/frysk-imports/libunwind/src/ppc64/Ginit.c =================================================================== --- frysk.orig/frysk-imports/libunwind/src/ppc64/Ginit.c +++ frysk/frysk-imports/libunwind/src/ppc64/Ginit.c @@ -208,7 +208,7 @@ get_static_proc_name (unw_addr_space_t a char *buf, size_t buf_len, unw_word_t *offp, void *arg) { - return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp); + return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp, arg); } HIDDEN void --=-RdIkLL5Krl5yIwPRdTu3--