This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/multi-arch] Move TARGET_*_BIT to gdbarch.h
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Subject: Re: [patch/multi-arch] Move TARGET_*_BIT to gdbarch.h
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Tue, 15 Aug 2000 00:01:08 -0700
- CC: gdb-patches at sourceware dot cygnus dot com
- References: <39936437.9662259@cygnus.com> <200008121015.GAA07487@indy.delorie.com>
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