From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H . J . Lu" To: Andrew Cagney Cc: gdb@sources.redhat.com Subject: Re: prgregset_t vs gdb_gregset_t on Linux: not the same! Date: Sun, 10 Jun 2001 00:23:00 -0000 Message-id: <20010610002356.A1938@lucon.org> References: <20010608132730.A4056@nevyn.them.org> <20010608155907.A21698@nevyn.them.org> <20010608221452.B3344@lucon.org> <3B22492E.5020908@cygnus.com> X-SW-Source: 2001-06/msg00068.html Content-type: multipart/mixed; boundary="----------=_1583534243-23287-3" This is a multi-part message in MIME format... ------------=_1583534243-23287-3 Content-length: 1654 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. ------------=_1583534243-23287-3 Content-Type: application/x-gzip; charset=binary; name="cpp.tar.gz" Content-Disposition: inline; filename="cpp.tar.gz" Content-Transfer-Encoding: base64 Content-Length: 574 H4sIAJYdIzsAA+2XUUvDMBDH+2o+RVh90IfWS5s2IOpLp1BwIoiw19GlLpp1 snbgxzftmJ1DqaDpkN3vJSQN3JXL/59Lvlj4mWMXYAAx5w4ABIyJegS2nq8J wAERMohZzIK43s9F4FCwnFfDqqwmS0qd2bPu2CeXZR8J9YurikyvppIOqrk/ G5B954P0y2jyInOlpc0YnfoX8Yf+o7jWPwuMDaD+eyBJLp+yjJCJ1ufk6Pgk SU6pN6Je6tO8vhq+WqPe8CYdXw8pusW/Z65eyzPLMQA4iCj6Xv/Q3v88FLVf RGHo0MhyXg0Hrv+m/tXc06qqtNSqWL35sz+O0en/ptib+gNnZn8YRwL9vw/a /q89Cc0ZwFbwINipupUYXfo3r74d/w94xFH/feCqvJjKnI7S+4fb9O5xTFwz VYXcXlF5vaXp+ciHYVy0p+aKuFKXkmw/JlsfcWUxVflm2PcPI5+oX/22Yxg9 gxDiR/1fCGbdfDTtIg36aE4OXP+Wrb+hs//brr+o+z/GzYD+jyAIgiAIgiAI giAIgiC/5B0wMfc3ACgAAA== ------------=_1583534243-23287-3-- >From eliz@is.elta.co.il Sun Jun 10 00:59:00 2001 From: Eli Zaretskii To: "H . J . Lu" Cc: Andrew Cagney , gdb@sources.redhat.com Subject: Re: prgregset_t vs gdb_gregset_t on Linux: not the same! Date: Sun, 10 Jun 2001 00:59:00 -0000 Message-id: References: <20010610002356.A1938@lucon.org> X-SW-Source: 2001-06/msg00069.html Content-length: 780 On Sun, 10 Jun 2001, H . J . Lu wrote: > 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 This is all expected. Perhaps it means that it's a bad idea to have several headers by the same name in different directories, if some port might include more than one of those headers, because small changes in the order of the -I options can break the build.