Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Steve Ellcey <sje@cup.hp.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 6/8] port GDB to ia64-hpux (native).
Date: Fri, 17 Jun 2011 16:30:00 -0000	[thread overview]
Message-ID: <20110617163006.GD5944@adacore.com> (raw)
In-Reply-To: <1299173882.30497.114.camel@hpsje.cup.hp.com>

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

[putting gdb-patches back, in case it's useful to someone else]

Steve,

> > What I will do as soon as I have a moment is double-check that I didn't
> > make a mistake somewhere, or forgot something. That would definitely
> > explain the problems you are having. We'll get to the bottom of this!

I tried taking a look at what might be causing you some trouble.
I can see some differences between our GDB and the FSF GDB, but
nothing like what you are seeing.

I did have a hard time getting libunwind to be activated, though,
and that failure is silently activated, or not.  That's why I took
the bull by the horn, and decided to make that unconditional:
http://www.sourceware.org/ml/gdb-patches/2011-06/msg00234.html

As I said before, the system libunwind is not performing as well
as GNU libunwind does. I use libunwind-0.98.5, not the latest
version. Either version will need to be patched, but I'm attaching
the patch I use with 0.98.5. I also sent some patches to the
libunwind mailing list for the HEAD, but I haven't had time
to test.

That's really as far as I can spend on this, as I've already spent
8 times the 2 hours I wanted to dedicate.  There are a few fixes
I should track down at some point that will further improve the
results. But at least I'm satisfied that I didn't miss anything
in my patches...

-- 
Joel

[-- Attachment #2: libunwind-0.98.5.tar.gz.diff --]
[-- Type: text/x-diff, Size: 5625 bytes --]

2008-10-02  Joel Brobecker  <brobecker@adacore.com>

        On ia64-hpux version 11.31, there is no <sys/ptrace.h> anymore.

        * configure.in: Add check for sys/ptrace.h.
        * configure, include/config.h.in: Regenerate.
        * src/ptrace/_UPT_internal.h: Include sys/ptrace.h only when
        available. Also, include <sys/ptrace.h> AFTER including
        "internal.h".  Otherwise, "config.h" hasn't been included yet,
        and thus HAVE_SYS_PTRACE_H was not defined.

2005-09-02  Joel Brobecker  <brobecker@adacore.com>

        * Ginit.c (tdep_uc_addr): New function. Needed to avoid a link failure.

2005-09-02  Joel Brobecker  <brobecker@adacore.com>

        This patches fixes a problem on ia64-hpux when trying to build
        this package using GCC 3.4.4. The makefile was incorrectly using
        -lgcc instead of -lgcc_s to build the libunwind shared library.
        libtool noticed that libgcc does not exist in a shared library
        version, and hence removed it from the list of dependencies (after
        printing a warning). This adds the missing dependency back, so
        that another program dlopen()'ing it doesn't fail due to unresolved
        symbols.
        * configure.in (LIBCRTS): Use -lgcc_s instead of -lgcc when needed.
        * configure: Regenerate.

Index: configure
===================================================================
--- configure	(revision 131627)
+++ configure	(revision 131628)
@@ -20870,6 +20870,16 @@ rm -f conftest.err conftest.$ac_objext c
 if test x$GCC = xyes -a x$intel_compiler != xyes; then
   CFLAGS="${CFLAGS} -Wall -Wsign-compare"
   LIBCRTS="-lgcc"
+
+  # What we really want to do is link our libraries against is the shared
+  # version of libgcc.  Unfortunately, this library may either be named
+  # libgcc or libgcc_s.  Try to see if GCC recognizes libgcc_s, in which
+  # case we should be linking against libgcc_s.
+  libgcc_s_so=libgcc_s.so
+  libgcc_s_path=`$CC -print-file-name=$libgcc_s_so`
+  if test x$libgcc_s_path != x$libgcc_s_so; then
+    LIBCRTS="-lgcc_s"
+  fi
 fi
 
 CCASFLAGS="${CCASFLAGS} ${CPPFLAGS}"

Index: configure.in
===================================================================
--- configure.in	(revision 131627)
+++ configure.in	(revision 131628)
@@ -103,6 +103,16 @@ AC_TRY_COMPILE([], [#ifndef __INTEL_COMP
 if test x$GCC = xyes -a x$intel_compiler != xyes; then
   CFLAGS="${CFLAGS} -Wall -Wsign-compare"
   LIBCRTS="-lgcc"
+
+  # What we really want to do is link our libraries against is the shared
+  # version of libgcc.  Unfortunately, this library may either be named
+  # libgcc or libgcc_s.  Try to see if GCC recognizes libgcc_s, in which
+  # case we should be linking against libgcc_s.
+  libgcc_s_so=libgcc_s.so
+  libgcc_s_path=`$CC -print-file-name=$libgcc_s_so`
+  if test x$libgcc_s_path != x$libgcc_s_so; then
+    LIBCRTS="-lgcc_s"
+  fi
 fi
 
 CCASFLAGS="${CCASFLAGS} ${CPPFLAGS}"

Index: src/ia64/Ginit.c
===================================================================
--- src/ia64/Ginit.c	(revision 131628)
+++ src/ia64/Ginit.c	(revision 131629)
@@ -82,6 +82,17 @@ PROTECTED unw_addr_space_t unw_local_add
 
 #ifdef HAVE_SYS_UC_ACCESS_H
 
+void *
+tdep_uc_addr (ucontext_t *uc, int reg, uint8_t *nat_bitnr)
+{
+  /* brobecker/2005-09-01: I couldn't find a way of implementing this
+     on ia64-hpux, as the uc structure is opaque.  The OS provides
+     ways to get the values themselves, but not their address. However,
+     I haven't seen this procedure being used at all so far, so we'll
+     just return NULL for now.  */
+  return NULL;
+}
+
 #else /* !HAVE_SYS_UC_ACCESS_H */
 
 HIDDEN void *

Index: configure
===================================================================
--- configure	(revision 135785)
+++ configure	(revision 136181)
@@ -19740,7 +19740,7 @@ fi
 
 
 for ac_header in asm/ptrace_offsets.h endian.h execinfo.h ia64intrin.h \
-		 sys/uc_access.h unistd.h signal.h
+		 sys/uc_access.h unistd.h signal.h sys/ptrace.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
Index: include/config.h.in
===================================================================
--- include/config.h.in	(revision 135785)
+++ include/config.h.in	(revision 136181)
@@ -60,6 +60,9 @@
 /* Define to 1 if `dlpi_subs' is member of `struct dl_phdr_info'. */
 #undef HAVE_STRUCT_DL_PHDR_INFO_DLPI_SUBS
 
+/* Define to 1 if you have the <sys/ptrace.h> header file. */
+#undef HAVE_SYS_PTRACE_H
+
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
Index: configure.in
===================================================================
--- configure.in	(revision 135785)
+++ configure.in	(revision 136181)
@@ -28,7 +28,7 @@ CHECK_ATOMIC_OPS
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS(asm/ptrace_offsets.h endian.h execinfo.h ia64intrin.h \
-		 sys/uc_access.h unistd.h signal.h)
+		 sys/uc_access.h unistd.h signal.h sys/ptrace.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
Index: src/ptrace/_UPT_internal.h
===================================================================
--- src/ptrace/_UPT_internal.h	(revision 135785)
+++ src/ptrace/_UPT_internal.h	(revision 136181)
@@ -32,11 +32,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <sys/ptrace.h>
-
 #include "internal.h"
 #include "tdep.h"
 
+#ifdef HAVE_SYS_PTRACE_H
+#include <sys/ptrace.h>
+#endif
+
 struct UPT_info
   {
     pid_t pid;		/* the process-id of the child we're unwinding */

  parent reply	other threads:[~2011-06-17 16:30 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-28  4:43 Porting GDB to ia64-hpux Joel Brobecker
2010-12-28  4:43 ` [PATCH 1/8] Add a big-endian version of the ia64-ext floatformat Joel Brobecker
2010-12-28  4:43 ` [PATCH 4/8] libunwind-frame.c: handle functions with no minimal symbol/debug info Joel Brobecker
2010-12-28  4:43 ` [PATCH 2/8] small integral parameters and return values Joel Brobecker
2010-12-28  4:44 ` [PATCH 5/8] inf-ttrace: Determine attached process LWP immediately after attaching Joel Brobecker
2010-12-28 11:04   ` Pedro Alves
2010-12-28 11:26     ` Joel Brobecker
2010-12-28  4:44 ` [PATCH 3/8] Make sure __LITTLE_ENDIAN/__BIG_ENDIAN are defined in libunwind-frame.c Joel Brobecker
2010-12-28  4:44 ` [PATCH 6/8] port GDB to ia64-hpux (native) Joel Brobecker
2011-01-11 23:26   ` Steve Ellcey
2011-01-12  1:26     ` Joel Brobecker
2011-01-12 16:57       ` Steve Ellcey
2011-01-12 20:11         ` Joel Brobecker
2011-01-13  1:01     ` Joel Brobecker
2011-01-13  5:13       ` Steve Ellcey
     [not found]       ` <1299014508.30497.20.camel@hpsje.cup.hp.com>
     [not found]         ` <20110302044549.GU2513@adacore.com>
     [not found]           ` <1299171098.30497.88.camel@hpsje.cup.hp.com>
     [not found]             ` <20110303172717.GJ2513@adacore.com>
     [not found]               ` <1299173882.30497.114.camel@hpsje.cup.hp.com>
2011-06-17 16:30                 ` Joel Brobecker [this message]
2011-01-13 18:07   ` Joel Brobecker
2010-12-28  4:54 ` [PATCH 7/8] ia64-hpux: unwinding bsp value from system call Joel Brobecker
2010-12-28 11:35   ` Pedro Alves
2010-12-28 12:01     ` Joel Brobecker
2010-12-28 16:17       ` Pedro Alves
2010-12-29  5:49         ` Joel Brobecker
2010-12-29 12:05           ` Pedro Alves
2010-12-29 13:16             ` Joel Brobecker
2010-12-31 18:15             ` Joel Brobecker
2010-12-28 15:29     ` [RFA/commit] Add documentation for TARGET_OBJECT_OSDATA Joel Brobecker
2010-12-28 15:46       ` Pedro Alves
2010-12-29  3:29       ` Joel Brobecker
2010-12-28  5:00 ` [PATCH 8/8] [ia64-hpux] inferior function call support Joel Brobecker
2010-12-31 19:18   ` Joel Brobecker
2011-01-13 16:53 ` Porting GDB to ia64-hpux Joel Brobecker

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=20110617163006.GD5944@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sje@cup.hp.com \
    /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