From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6616 invoked by alias); 17 Jun 2011 16:30:35 -0000 Received: (qmail 6594 invoked by uid 22791); 17 Jun 2011 16:30:31 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,TW_LG X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Jun 2011 16:30:15 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id F1DBE2BB505; Fri, 17 Jun 2011 12:30:14 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id y6WZhVOzjAje; Fri, 17 Jun 2011 12:30:14 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A6ED42BB504; Fri, 17 Jun 2011 12:30:14 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id EE133145615; Fri, 17 Jun 2011 09:30:06 -0700 (PDT) Date: Fri, 17 Jun 2011 16:30:00 -0000 From: Joel Brobecker To: Steve Ellcey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 6/8] port GDB to ia64-hpux (native). Message-ID: <20110617163006.GD5944@adacore.com> References: <1293511386-7384-7-git-send-email-brobecker@adacore.com> <201101112314.p0BNErd19061@lucas.cup.hp.com> <20110112231604.GI2504@adacore.com> <1299014508.30497.20.camel@hpsje.cup.hp.com> <20110302044549.GU2513@adacore.com> <1299171098.30497.88.camel@hpsje.cup.hp.com> <20110303172717.GJ2513@adacore.com> <1299173882.30497.114.camel@hpsje.cup.hp.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline In-Reply-To: <1299173882.30497.114.camel@hpsje.cup.hp.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-06/txt/msg00235.txt.bz2 --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1332 [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 --y0ulUmNC+osPPQO6 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="libunwind-0.98.5.tar.gz.diff" Content-length: 5625 2008-10-02 Joel Brobecker On ia64-hpux version 11.31, there is no 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 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 * Ginit.c (tdep_uc_addr): New function. Needed to avoid a link failure. 2005-09-02 Joel Brobecker 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 header file. */ +#undef HAVE_SYS_PTRACE_H + /* Define to 1 if you have the 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 #include -#include - #include "internal.h" #include "tdep.h" +#ifdef HAVE_SYS_PTRACE_H +#include +#endif + struct UPT_info { pid_t pid; /* the process-id of the child we're unwinding */ --y0ulUmNC+osPPQO6--