This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] fix gdb.base/remote.c and h8300
- To: Jeff Holcomb <jeffh at redhat dot com>, Kevin Buettner <kevinb at cygnus dot com>
- Subject: Re: [RFA] fix gdb.base/remote.c and h8300
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Tue, 28 Aug 2001 16:28:08 -0700
- Cc: gdb-patches at sourceware dot cygnus dot com
- References: <Pine.SOL.3.91.1010828161147.25088W-100000@taarna.cygnus.com>
On Aug 28, 4:16pm, Jeff Holcomb wrote:
> > On Aug 28, 11:12am, Jeff Holcomb wrote:
> >
> > > +#ifdef __H8300__
> > > +# define RANDOM_DATA_SIZE (1024)
> > > +#endif
> > > +
> >
> > We need to think of a better way to do this. I've run into a similar
> > problem on a target that I've worked on in the past too. I don't think
> > that adding ifdefs for all the targets that need a smaller size is the
> > way to go...
>
> Yes. I agree there needs to be a better way. The problem I have is that
> the H8300s has 16-bit int and 16-bit pointers. There's no way the large
> structure defined in remote.c can fit so gcc spews a bunch of errors when
> compiling. There existed a mechanism already in remote.c to handle this,
> so I just extended it to the h8300.
>
> Whatever the solution, it has to be done in the preprocessor. Perhaps
> checking to see how big MAXINT is defined to be?
Yeah. Or maybe just check sizeof (int)?
#if sizeof (int) <= 2
# define RANDOM_DATA_SIZE (1024)
#else
...
#endif
(That way we're not depending on any header files for this test.)