public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Jose Flavio Aguilar Paulino <jflavio@br.ibm.com>
To: Frysk <frysk@sourceware.org>
Subject: New Libunwind for Power Fix
Date: Thu, 11 Oct 2007 16:36:00 -0000	[thread overview]
Message-ID: <1192120504.12765.2.camel@kandinsky.prado> (raw)

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

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

[-- Attachment #2: frysk_libunwind_4_power --]
[-- Type: text/x-patch, Size: 7365 bytes --]

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 <jan.kratochvil@redhat.com>
+
+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 <libunwind.h>
+#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

             reply	other threads:[~2007-10-11 16:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-11 16:36 Jose Flavio Aguilar Paulino [this message]
2007-10-13 14:19 ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1192120504.12765.2.camel@kandinsky.prado \
    --to=jflavio@br.ibm.com \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).