This is the mail archive of the gdb@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]

Re: prgregset_t vs gdb_gregset_t on Linux: not the same!


On Sat, Jun 09, 2001 at 12:05:02PM -0400, Andrew Cagney wrote:
> > 
> > #include "nm-linux.h"
> > #include "tm-linux.h"
> > 
> > Otherwise, you may not get the header files you want since mips has
> > both liltle and big endians. Once you have done that, your problem
> > should go away.
> 
> 
> Just FYI, this isn't correct.
> 
> GDB configurations don't have -Isrc/gdb/config/$MACHINE added to the 
> include path (if one does then it is broken).  Consequently "tm-linux.h" 
> will find the header in src/gdb/config.

Here is the ticky part. It took me a while to understand what is
going on. For mipsel, I have mips/tm-littlelinux.h in config, which
has

----
#ifndef TM_MIPSLITTLELINUX_H
#define TM_MIPSLITTLELINUX_H

#define TARGET_BYTE_ORDER LITTLE_ENDIAN

#include "mips/tm-linux.h"

#endif /* TM_MIPSLITTLELINUX_H */
----

The gdb configure links/copies mips/tm-littlelinux.h to tm.h. Now
gdb/tm.h has

---
#ifndef TM_MIPSLITTLELINUX_H
#define TM_MIPSLITTLELINUX_H

#define TARGET_BYTE_ORDER LITTLE_ENDIAN

#include "mips/tm-linux.h"
---

If in mips/tm-linux.h, there are

#include "mips/tm-mips.h"
#include "tm-linux.h"

mips/tm-linux.h is found by -Isrc/gdb/config. But can you guess which
tm-linux.h is included from mips/tm-linux.h? It is mips/tm-linux.h
since

#include "tm-linux.h"

for gcc, "" means to search the current directory of the file even if
it is not listed with -I. Therefor, tm-linux.h in config/mips will be
included from mips/tm-linux.h.  Here is an example

# make
gcc -M -I. foo.c
foo.o: foo.c tm.h mips/tm-linux.h
gcc -M -I. foo.c -DFIXED 
foo.o: foo.c tm.h mips/tm-linux.h tm-linux.h
 
Did I miss something here?


H.J.

cpp.tar.gz


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