[RFA] fix gdb.base/remote.c and h8300

Kevin Buettner kevinb@cygnus.com
Tue Aug 28 16:28:00 GMT 2001


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.)



More information about the Gdb-patches mailing list