From: Pedro Alves <palves@redhat.com>
To: Jan Kratochvil <jan.kratochvil@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: Mon, 13 Feb 2012 20:05:00 -0000 [thread overview]
Message-ID: <4F396CDC.7020504@redhat.com> (raw)
In-Reply-To: <20120213192652.GA11522@host2.jankratochvil.net>
On 02/13/2012 07:26 PM, Jan Kratochvil wrote:
> On Mon, 13 Feb 2012 20:19:45 +0100, Pedro Alves wrote:
>> On 02/13/2012 07:02 PM, Jan Kratochvil wrote:
>>> It is required for ia64 but it can be used even with non-ia64 archs.
>>
>> How? AFAICS, no other target installs the libunwind sniffer. It's just
>> dead code on other archs, if I'm reading the code correctly.
>
> I see now. I did not know. Sure in this case this patch of mine was wrong.
> I will therefore make libunwind usable only with ia64, this will be different
> patch removing some parts of gdb/ code.
I was only thinking of the below. Would this work for everyone?
I don't have a cross build of libunwind for ia64 handy, but I assume
this works, given the previous patches...
2012-02-13 Tristan Gingold <gingold@adacore.com>
Pedro Alves <palves@redhat.com>
* ia64-tdep.c: Do not include libunwind-ia64.h.
* libunwind-frame.h: Include libunwind-ia64.h instead of
libunwind.h.
* configure.ac (--with-libunwind, $enable_libunwind): Don't check
for libunwind.h existence.
* configure, config.in: Regenerate.
---
gdb/config.in | 3 ---
gdb/configure | 22 +++++++++-------------
gdb/configure.ac | 6 +++---
gdb/ia64-tdep.c | 1 -
gdb/libunwind-frame.h | 7 ++++++-
5 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/gdb/config.in b/gdb/config.in
index bae1763..194cc7d 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -242,9 +242,6 @@
/* Define if libunwind library is being used. */
#undef HAVE_LIBUNWIND
-/* Define to 1 if you have the <libunwind.h> header file. */
-#undef HAVE_LIBUNWIND_H
-
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
#undef HAVE_LIBUNWIND_IA64_H
diff --git a/gdb/configure b/gdb/configure
index 2566410..96a82ee 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -8252,21 +8252,19 @@ if test "${with_libunwind+set}" = set; then :
esac
else
- for ac_header in libunwind.h libunwind-ia64.h
+ for ac_header in libunwind-ia64.h
do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "libunwind-ia64.h" "ac_cv_header_libunwind_ia64_h" "$ac_includes_default"
+if test "x$ac_cv_header_libunwind_ia64_h" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_LIBUNWIND_IA64_H 1
_ACEOF
fi
done
- if test x"$ac_cv_header_libunwind_h" = xyes -a x"$ac_cv_header_libunwind_ia64_h" = xyes; then
+ if x"$ac_cv_header_libunwind_ia64_h" = xyes; then
enable_libunwind=yes;
fi
@@ -8274,14 +8272,12 @@ fi
if test x"$enable_libunwind" = xyes; then
- for ac_header in libunwind.h libunwind-ia64.h
+ for ac_header in libunwind-ia64.h
do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "libunwind-ia64.h" "ac_cv_header_libunwind_ia64_h" "$ac_includes_default"
+if test "x$ac_cv_header_libunwind_ia64_h" = x""yes; then :
cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_LIBUNWIND_IA64_H 1
_ACEOF
fi
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 1b11adb..f7c987d 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -348,14 +348,14 @@ AS_HELP_STRING([--with-libunwind], [use libunwind frame unwinding support]),
no) enable_libunwind=no ;;
*) 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
+ AC_CHECK_HEADERS(libunwind-ia64.h)
+ if x"$ac_cv_header_libunwind_ia64_h" = xyes; then
enable_libunwind=yes;
fi
])
if test x"$enable_libunwind" = xyes; then
- AC_CHECK_HEADERS(libunwind.h libunwind-ia64.h)
+ AC_CHECK_HEADERS(libunwind-ia64.h)
AC_DEFINE(HAVE_LIBUNWIND, 1, [Define if libunwind library is being used.])
CONFIG_OBS="$CONFIG_OBS libunwind-frame.o"
CONFIG_DEPS="$CONFIG_DEPS libunwind-frame.o"
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index a297ecc..a36dc22 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -43,7 +43,6 @@
#ifdef HAVE_LIBUNWIND_IA64_H
#include "elf/ia64.h" /* for PT_IA_64_UNWIND value */
#include "libunwind-frame.h"
-#include "libunwind-ia64.h"
/* Note: KERNEL_START is supposed to be an address which is not going
to ever contain any valid unwind info. For ia64 linux, the choice
diff --git a/gdb/libunwind-frame.h b/gdb/libunwind-frame.h
index 0251819..922fdcb 100644
--- a/gdb/libunwind-frame.h
+++ b/gdb/libunwind-frame.h
@@ -29,7 +29,12 @@ struct gdbarch;
#ifndef LIBUNWIND_FRAME_H
#define LIBUNWIND_FRAME_H 1
-#include "libunwind.h"
+/* IA64 is the only target that currently uses libunwind. If some
+ other target wants to use it, we will need to do some abstracting
+ in order to make it possible to have more than one libunwind-frame
+ instance. Including "libunwind.h" is wrong as that picks up the
+ version for the host gdb is running on. */
+#include "libunwind-ia64.h"
struct libunwind_descr
{
next prev parent reply other threads:[~2012-02-13 20:05 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
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 [this message]
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=4F396CDC.7020504@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=gingold@adacore.com \
--cc=jan.kratochvil@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