Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: Tristan Gingold <gingold@adacore.com>,
	       "gdb-patches@sourceware.org ml"
	<gdb-patches@sourceware.org>
Subject: Re: RFA: Try to include libunwind-ia64.h in libunwind-frame.h
Date: Sat, 11 Feb 2012 14:10:00 -0000	[thread overview]
Message-ID: <20120211140919.GA24043@host2.jankratochvil.net> (raw)
In-Reply-To: <4F3562FE.7050106@redhat.com>

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  <jan.kratochvil@redhat.com>
	    Tristan Gingold  <gingold@adacore.com>

	* 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 <http://www.gnu.org/licenses/>.  */
 
-#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 */


  parent reply	other threads:[~2012-02-11 14:10 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 16:32 Tristan Gingold
2012-02-10 12:31 ` Jan Kratochvil
2012-02-10 13:15   ` Tristan Gingold
2012-02-10 13:21     ` Jan Kratochvil
2012-02-10 13:27     ` Joel Brobecker
2012-02-10 13:45       ` Tristan Gingold
2012-02-10 14:04   ` Tristan Gingold
2012-02-10 14:09     ` Jan Kratochvil
2012-02-10 14:14       ` Tristan Gingold
2012-02-10 18:27 ` Jan Kratochvil
2012-02-10 18:34   ` Pedro Alves
2012-02-10 18:44     ` Jan Kratochvil
2012-02-10 18:59       ` Pedro Alves
2012-02-10 19:38         ` Jan Kratochvil
2012-02-11 14:10     ` Jan Kratochvil [this message]
2012-02-13  8:41       ` Tristan Gingold
2012-02-13 18:58       ` Pedro Alves
2012-02-13 19:03         ` Jan Kratochvil
2012-02-13 19:20           ` Pedro Alves
2012-02-13 19:27             ` Jan Kratochvil
2012-02-13 20:05               ` Pedro Alves
2012-02-14  7:28                 ` Jan Kratochvil
2012-02-14 12:14                   ` Pedro Alves
2012-02-14 14:36                     ` Jan Kratochvil
2012-02-14 14:53                       ` Pedro Alves
2012-02-20 20:54                         ` Jan Kratochvil
2012-02-20 22:30                           ` Pedro Alves
2012-02-20 22:37                             ` Joel Brobecker
2012-02-20 22:39                               ` Joel Brobecker
2012-02-20 22:57                               ` Pedro Alves
2012-02-20 23:20                                 ` Joel Brobecker
2012-02-21  6:48                             ` Jan Kratochvil
2012-02-21 13:36                               ` Pedro Alves
2012-02-21 19:10                                 ` Tom Tromey
2012-02-22  7:56                                   ` Tristan Gingold
2012-02-22 14:52                                     ` Jan Kratochvil
2012-02-21 20:18                                 ` Jan Kratochvil
2012-02-21 20:43                                   ` Pedro Alves

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=20120211140919.GA24043@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gingold@adacore.com \
    --cc=palves@redhat.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