From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8295 invoked by alias); 2 Feb 2012 16:32:56 -0000 Received: (qmail 8279 invoked by uid 22791); 2 Feb 2012 16:32:53 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Feb 2012 16:32:41 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 9310E29005B for ; Thu, 2 Feb 2012 17:32:40 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mworRjzxkQyO for ; Thu, 2 Feb 2012 17:32:40 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 806B029005A for ; Thu, 2 Feb 2012 17:32:40 +0100 (CET) From: Tristan Gingold Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: RFA: Try to include libunwind-ia64.h in libunwind-frame.h Date: Thu, 02 Feb 2012 16:32:00 -0000 Message-Id: <5D1CD28F-F628-475C-B6D8-5FCBF5290C63@adacore.com> To: "gdb-patches@sourceware.org ml" Mime-Version: 1.0 (Apple Message framework v1251.1) 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/msg00034.txt.bz2 Hi, building a cross debugger for ia64 isn't as easy as for most other platform= s. Part of the issue is libunwind.h, which is not well designed for cross oper= ation: [=85] #ifndef UNW_REMOTE_ONLY #if defined __arm__ # include "libunwind-arm.h" #elif defined __hppa__ # include "libunwind-hppa.h" #elif defined __ia64__ # include "libunwind-ia64.h" #elif defined __mips__ # include "libunwind-mips.h" #elif defined __powerpc__ && !defined __powerpc64__ # include "libunwind-ppc32.h" #elif defined __powerpc64__ # include "libunwind-ppc64.h" #elif defined __i386__ # include "libunwind-x86.h" #elif defined __x86_64__ # include "libunwind-x86_64.h" #else # error "Unsupported arch" #endif [=85] Note that gdb doesn't define UNW_REMOTE_ONLY. So clearly in my case a wron= g header will be used. I propose to fix this issue with the following patch: it includes libunwind= -ia64.h if HAVE_LIBUNWIND_IA64_H is defined. This is not perfect as libunwind-ia64.h may be detected even if not used, b= ut will work in practice because only ia64 use libunwind. So maybe it is a little bit over-engineered, and we could simply include li= bunwind-ia64.h. (Also, the include of libunwind-ia64.h in ia64-tdep.c isn't necessary. The= reviewer will tell if s/he prefer to keep or remove this include). Manually tested. Ok for trunk ? Tristan. 2012-02-02 Tristan Gingold * ia64-tdep.c: Do not include libunwind-ia64.h * libunwind-frame.h: Include libunwind-ia64.h instead of libunwind.h if possible. 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" =20 /* 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..932439b 100644 --- a/gdb/libunwind-frame.h +++ b/gdb/libunwind-frame.h @@ -29,7 +29,11 @@ struct gdbarch; #ifndef LIBUNWIND_FRAME_H #define LIBUNWIND_FRAME_H 1 =20 +#ifdef HAVE_LIBUNWIND_IA64_H +#include "libunwind-ia64.h" +#else #include "libunwind.h" +#endif =20 struct libunwind_descr {