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]

Re: [patch/multi-arch] Move TARGET_*_BIT to gdbarch.h


Eli Zaretskii wrote:
> 
> > Date: Thu, 10 Aug 2000 19:25:59 -0700
> > From: Andrew Cagney <ac131313@cygnus.com>
> >
> > The attatched patch moves the #ifdefs that provide default values for
> > all the TARGET_*_BIT macros to gdbarch.{h,c,sh}.
> 
> I'm not sure I understand the implications of this for non-multi-arch
> targets.  You've removed TARGET_*_BIT macros from defs.h, but will
> gdbarch.h resurrect those definitions in an equivalent way?  If not,
> various target-dependent files, such as i386-tdep.c and
> config/i386/tm-i386.h, will begin losing some nifty features in
> c-lang.c, c-exp_tab.c, valops.c, etc.

Fair question.

defs.h contained the code:

	#include "tm.h"
	#include "gdbarch.h"

	#ifndef TARGET_SHORT_BIT
	#define TARGET_SHORT_BIT 16
	#endif

For the non- multi-arch case, the #ifdef bit has been moved to gdbarch.h
(so has equivalent effect).

In the multi-arch case, things get more interesting.  The change means
that the architecture vector can now provide default values for the
TARGET_*_BIT entries.  Having default values means that the target
maintainer doesn't have to provide them (although they still can) unless
their target is unusual.  Hopefully this will make the maintainers life
easier.

I've further patches (one of which escaped befor it was ready :-() to
make similar simplifying changes to a few of the other architecture
vector entries.

Or to put it another way, for the short term, the x86 shouldn't be
affected and for the long term, converting something to multi-arch just
became a little easier :-)

	enjoy,
		Andrew

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