This is the mail archive of the gdb-patches@sources.redhat.com 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] Add x86-64 target to MAINTAINERS, broken


Michal Ludvig <mludvig@suse.cz> writes:

> Andreas Jaeger wrote:
>  > Andrew Cagney <ac131313@cygnus.com> writes:
>  >>In file included from /home/scratch/GDB/src/gdb/x86-64-tdep.c:30:
>  >>/home/scratch/GDB/src/gdb/x86-64-tdep.h:27: sys/reg.h: No such file or
>  >>directory
>  >>gmake[1]: *** [x86-64-tdep.o] Error 1
>  >>gmake[1]: Leaving directory
>  >>`/home/scratch/GDB/X-x86_64-unknown-linux-gnu/gdb'
>  >>gmake: *** [all-gdb] Error 2
>  >>
>  >>when trying to build an x86_64-linux-gnu target.
>  >>
>  >
>  > I fear you applied a broken patch by Michal.  Has this been fixed?
>  > Michal, can you test whether the CVS version works now?
> 
> File sys/reg.h comes from x86-64 glibc sources and yes, using my
> crosscompiler it compiles without problems for --host=x86-64 and 
> --target=x86-64...

x86-64-tdep.h should definitely *not* include <sys/reg.h>, or any
target header for that matter.  It should be possible to build a GDB
that can debug x86-64 stuff on any host.  Currently that's not
possible since there are problems with dwarfcfi.c, which doesn't
compile on a 32-bit host right now, which is a pity since it means I
cannot really help you with fixing the x86-64 bits.

Anyway, you should really try to test your build with --target=x86-64
on a totally different platform, e.g. *BSD on a sparc.

Anyway, I think the attached patch solves the <sys/reg.h> problem.  It
shouldn't break your x86-64 target, but I'm not entirely sure.  Can
you test it for me?

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* x86-64-tdep.h: Do not include <sys/reg.h>.
	(x86_64_regmap): Remove.

Index: x86-64-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.h,v
retrieving revision 1.1
diff -u -p -r1.1 x86-64-tdep.h
--- x86-64-tdep.h 2001/09/21 12:19:15 1.1
+++ x86-64-tdep.h 2002/03/04 11:34:55
@@ -1,5 +1,5 @@
 /* Target-dependent code for GDB, the GNU debugger.
-   Copyright 2001
+   Copyright 2001, 2002
    Free Software Foundation, Inc.
    Contributed by Jiri Smid, SuSE Labs.
 
@@ -24,18 +24,6 @@
 #define X86_64_TDEP_H
 
 #include "i386-tdep.h"
-#include <sys/reg.h>
-
-/* Mapping between the general-purpose registers in `struct user'
-   format and GDB's register array layout.  */
-
-static int x86_64_regmap[] = {
-  RAX, RDX, RCX, RBX,
-  RSI, RDI, RBP, RSP,
-  R8, R9, R10, R11,
-  R12, R13, R14, R15,
-  RIP, EFLAGS
-};
 
 /* Number of all registers */
 #define X86_64_NUM_REGS (51)


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