This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 3/4] gdbserver: Add powerpc fast tracepoint support.


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
<elf.h> (and everything that includes <elf.h>), 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 <elf.h> 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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]