From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26016 invoked by alias); 11 Feb 2012 14:10:15 -0000 Received: (qmail 26005 invoked by uid 22791); 11 Feb 2012 14:10:13 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 11 Feb 2012 14:09:52 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1BE9UuK010417 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 11 Feb 2012 09:09:30 -0500 Received: from host2.jankratochvil.net (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1BE9Kv8024595 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 11 Feb 2012 09:09:24 -0500 Date: Sat, 11 Feb 2012 14:10:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: Tristan Gingold , "gdb-patches@sourceware.org ml" Subject: Re: RFA: Try to include libunwind-ia64.h in libunwind-frame.h Message-ID: <20120211140919.GA24043@host2.jankratochvil.net> References: <5D1CD28F-F628-475C-B6D8-5FCBF5290C63@adacore.com> <20120210182705.GA32459@host2.jankratochvil.net> <4F3562FE.7050106@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F3562FE.7050106@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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: 2012-02/txt/msg00224.txt.bz2 On Fri, 10 Feb 2012 19:33:34 +0100, Pedro Alves wrote: > What about --enable-targets=all, or --target=x86_64-foo --enable-target=ia64-xxx ? Fixed. Thanks, Jan 2012-02-11 Jan Kratochvil Tristan Gingold * configure.ac (gdb_target_cpu_has_ia64): New variable. Set it for --target and --enable-targets parameters. (--with-libunwind=auto): Set enable_libunwind for either of libunwind.h or libunwind-ia64.h with $gdb_target_cpu_has_ia64. * configure: Regenerate. * libunwind-frame.h: Conditionalize the file for HAVE_LIBUNWIND and not HAVE_LIBUNWIND_H. Include libunwind-ia64.h instead of libunwind.h if possible. --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -184,6 +184,13 @@ fi TARGET_OBS= all_targets= +# Set to true if any of the supported targets uses ia64 CPU. +# libunwind libraries can be installed for multiple architecture targets but +# GDB libunwind-frame.c can support only architecture. If there are multiple +# target architectures supported by libunwind prefer ia64 - while GDB can +# unwind other architectures on its own GDB can unwind ia64 only with libunwind. +gdb_target_cpu_has_ia64=false + for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'` do if test "$targ_alias" = "all"; then @@ -216,6 +223,12 @@ do if test x${want64} = xfalse; then . ${srcdir}/../bfd/config.bfd fi + + case "$targ" in + ia64*) + gdb_target_cpu_has_ia64=true + ;; + esac fi done @@ -241,6 +254,7 @@ if test x${all_targets} = xtrue; then else TARGET_OBS='$(ALL_TARGET_OBS)' fi + gdb_target_cpu_has_ia64=true fi AC_SUBST(TARGET_OBS) @@ -349,8 +363,10 @@ AS_HELP_STRING([--with-libunwind], [use libunwind frame unwinding support]), *) AC_MSG_ERROR(bad value ${withval} for GDB with-libunwind option) ;; esac],[ AC_CHECK_HEADERS(libunwind.h libunwind-ia64.h) - if test x"$ac_cv_header_libunwind_h" = xyes -a x"$ac_cv_header_libunwind_ia64_h" = xyes; then - enable_libunwind=yes; + if $gdb_target_cpu_has_ia64 && test x"$ac_cv_header_libunwind_ia64_h" = xyes; then + enable_libunwind=yes + elif test x"$ac_cv_header_libunwind_h" = xyes; then + enable_libunwind=yes fi ]) --- a/gdb/libunwind-frame.h +++ b/gdb/libunwind-frame.h @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef HAVE_LIBUNWIND_H +#ifdef HAVE_LIBUNWIND struct frame_info; struct frame_id; @@ -29,7 +29,13 @@ struct gdbarch; #ifndef LIBUNWIND_FRAME_H #define LIBUNWIND_FRAME_H 1 -#include "libunwind.h" +#if defined HAVE_LIBUNWIND_IA64_H +# include "libunwind-ia64.h" +#elif defined HAVE_LIBUNWIND_H +# include "libunwind.h" +#else +# error "HAVE_LIBUNWIND && !HAVE_LIBUNWIND_IA64_H && !HAVE_LIBUNWIND_H" +#endif struct libunwind_descr { @@ -73,4 +79,4 @@ int libunwind_get_reg_special (struct gdbarch *gdbarch, #endif /* libunwind-frame.h */ -#endif /* HAVE_LIBUNWIND_H */ +#endif /* HAVE_LIBUNWIND */