From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62603 invoked by alias); 31 Mar 2016 01:31:40 -0000 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 Received: (qmail 61789 invoked by uid 89); 31 Mar 2016 01:31:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: xyzzy.0x04.net Received: from xyzzy.0x04.net (HELO xyzzy.0x04.net) (159.100.250.38) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 Mar 2016 01:31:37 +0000 Received: from hogfather.0x04.net (89-65-66-135.dynamic.chello.pl [89.65.66.135]) by xyzzy.0x04.net (Postfix) with ESMTPS id 425AA1AA47; Thu, 31 Mar 2016 01:31:35 +0000 (UTC) Received: from [172.21.36.130] (unknown [88.214.185.169]) by hogfather.0x04.net (Postfix) with ESMTPSA id E0DFB580114; Thu, 31 Mar 2016 03:31:34 +0200 (CEST) Subject: Re: [PATCH v2 3/4] gdbserver: Add powerpc fast tracepoint support. To: Ulrich Weigand , Simon Marchi References: <20160330153540.8D4454989@oc7340732750.ibm.com> Cc: gdb-patches@sourceware.org From: =?UTF-8?Q?Marcin_Ko=c5=9bcielnicki?= Message-ID: <56FC7DF5.1060105@0x04.net> Date: Thu, 31 Mar 2016 01:31:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160330153540.8D4454989@oc7340732750.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00583.txt.bz2 On 30/03/16 17:35, Ulrich Weigand wrote: > Simon Marchi wrote: > >> Ahh, it seems like the ordering is important here. If I include it before >> (and everything that includes ), it works. > > Hmm, it would probably be best to avoid mixing in-tree BFD headers and > system headers this way. I'd suggest to *not* include at all, > but instead use: > > #include "elf/common.h" > #include "elf/ppc64.h" > > Bye, > Ulrich > That doesn't work either: ../../../gdb/gdbserver/linux-ppc-low.c: In function ‘is_elfv2_inferior’: ../../../gdb/gdbserver/linux-ppc-low.c:763:3: error: unknown type name ‘Elf64_Ehdr’ Elf64_Ehdr ehdr; ^ ../../../gdb/gdbserver/linux-ppc-low.c:772:18: error: request for member ‘e_ident’ in something not a structure or union if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG)) ^ ../../../gdb/gdbserver/linux-ppc-low.c:772:28: error: ‘ELFMAG’ undeclared (first use in this function) if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG)) ^ ../../../gdb/gdbserver/linux-ppc-low.c:772:28: note: each undeclared identifier is reported only once for each function it appears in ../../../gdb/gdbserver/linux-ppc-low.c:772:36: error: ‘SELFMAG’ undeclared (first use in this function) if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG)) ^ ../../../gdb/gdbserver/linux-ppc-low.c:775:15: error: request for member ‘e_flags’ in something not a structure or union return (ehdr.e_flags & EF_PPC64_ABI) == 2; ^ ../../../gdb/gdbserver/linux-ppc-low.c:776:1: error: control reaches end of non-void function [-Werror=return-type] } ^ There's no equivalent to ELFMAG in the BFD headers, and getting to e_flags requires more work too (you need elf/external.h and manually assemble the word from bytes). Perhaps it'd be simpler to just define EF_PPC64_ABI manually if it's not defined?