Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] fix gdb.base/remote.c and h8300
@ 2001-08-28 11:12 Jeff Holcomb
  2001-08-28 12:33 ` Kevin Buettner
  2001-08-28 15:20 ` Michael Snyder
  0 siblings, 2 replies; 8+ messages in thread
From: Jeff Holcomb @ 2001-08-28 11:12 UTC (permalink / raw)
  To: gdb-patches

2001-08-28  Jeff Holcomb  <jeffh@redhat.com>
 
        * gdb.base/remote.c: Define RANDOM_DATA_SIZE if target is a
        h8300.

Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/remote.c,v
retrieving revision 1.2
diff -u -p -r1.2 remote.c
--- remote.c    2001/07/17 21:47:19     1.2
+++ remote.c    2001/08/28 18:09:27
@@ -27,6 +27,10 @@ BEGIN {
 # define RANDOM_DATA_SIZE (1024)
 #endif
 
+#ifdef __H8300__
+# define RANDOM_DATA_SIZE (1024)
+#endif
+
 /* Use a character buffer to avoid byte order problems. 48k is
    chosen so that the buffer required at least 3 16k packets but
    targets often have no more than 64k of data. */


--
Jeff Holcomb
jeffh@redhat.com
GDB Engineering
Red Hat, Inc.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFA] fix gdb.base/remote.c and h8300
  2001-08-28 11:12 [RFA] fix gdb.base/remote.c and h8300 Jeff Holcomb
@ 2001-08-28 12:33 ` Kevin Buettner
  2001-08-28 16:17   ` Jeff Holcomb
  2001-08-28 15:20 ` Michael Snyder
  1 sibling, 1 reply; 8+ messages in thread
From: Kevin Buettner @ 2001-08-28 12:33 UTC (permalink / raw)
  To: Jeff Holcomb, gdb-patches

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

Kevin


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFA] fix gdb.base/remote.c and h8300
  2001-08-28 11:12 [RFA] fix gdb.base/remote.c and h8300 Jeff Holcomb
  2001-08-28 12:33 ` Kevin Buettner
@ 2001-08-28 15:20 ` Michael Snyder
  1 sibling, 0 replies; 8+ messages in thread
From: Michael Snyder @ 2001-08-28 15:20 UTC (permalink / raw)
  To: Jeff Holcomb; +Cc: gdb-patches

Jeff Holcomb wrote:
> 
> 2001-08-28  Jeff Holcomb  <jeffh@redhat.com>
> 
>         * gdb.base/remote.c: Define RANDOM_DATA_SIZE if target is a
>         h8300.

Jeff, can't this go in the tm-h8300.h file, instead of
in a common source file?

> 
> Index: remote.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/remote.c,v
> retrieving revision 1.2
> diff -u -p -r1.2 remote.c
> --- remote.c    2001/07/17 21:47:19     1.2
> +++ remote.c    2001/08/28 18:09:27
> @@ -27,6 +27,10 @@ BEGIN {
>  # define RANDOM_DATA_SIZE (1024)
>  #endif
> 
> +#ifdef __H8300__
> +# define RANDOM_DATA_SIZE (1024)
> +#endif
> +
>  /* Use a character buffer to avoid byte order problems. 48k is
>     chosen so that the buffer required at least 3 16k packets but
>     targets often have no more than 64k of data. */
> 
> --
> Jeff Holcomb
> jeffh@redhat.com
> GDB Engineering
> Red Hat, Inc.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFA] fix gdb.base/remote.c and h8300
  2001-08-28 12:33 ` Kevin Buettner
@ 2001-08-28 16:17   ` Jeff Holcomb
  2001-08-28 16:28     ` Kevin Buettner
  2001-08-28 16:29     ` Andrew Cagney
  0 siblings, 2 replies; 8+ messages in thread
From: Jeff Holcomb @ 2001-08-28 16:17 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

On Tue, 28 Aug 2001, Kevin Buettner 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?

--
Jeff Holcomb
jeffh@redhat.com
GDB Engineering
Red Hat, Inc.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFA] fix gdb.base/remote.c and h8300
  2001-08-28 16:17   ` Jeff Holcomb
@ 2001-08-28 16:28     ` Kevin Buettner
  2001-08-28 17:14       ` Andrew Cagney
  2001-08-28 16:29     ` Andrew Cagney
  1 sibling, 1 reply; 8+ messages in thread
From: Kevin Buettner @ 2001-08-28 16:28 UTC (permalink / raw)
  To: Jeff Holcomb, Kevin Buettner; +Cc: gdb-patches

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFA] fix gdb.base/remote.c and h8300
  2001-08-28 16:17   ` Jeff Holcomb
  2001-08-28 16:28     ` Kevin Buettner
@ 2001-08-28 16:29     ` Andrew Cagney
  1 sibling, 0 replies; 8+ messages in thread
From: Andrew Cagney @ 2001-08-28 16:29 UTC (permalink / raw)
  To: Jeff Holcomb; +Cc: gdb-patches

> On Tue, 28 Aug 2001, Kevin Buettner wrote:
> 
> 
>> On Aug 28, 11:12am, Jeff Holcomb wrote:
>> 
> 
>> > +#ifdef __H8300__
>> > +# define RANDOM_DATA_SIZE (1024)
>> > +#endif
>> > +

I'm actually suprised someone hasn't called ``obvious fix''.  Yes it is 
horrible and we need to find a better way but this is current convention 
adopted for this file.

enjoy,
	Andrew



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFA] fix gdb.base/remote.c and h8300
  2001-08-28 16:28     ` Kevin Buettner
@ 2001-08-28 17:14       ` Andrew Cagney
  2001-08-28 18:41         ` Kevin Buettner
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2001-08-28 17:14 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: Jeff Holcomb, gdb-patches

> 
> Yeah.  Or maybe just check sizeof (int)?
> 
> #if sizeof (int) <= 2
> # define RANDOM_DATA_SIZE (1024)
> #else
> ...
> #endif

I'm 98% certain you can't do that using ISO-C.

	Andrew



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFA] fix gdb.base/remote.c and h8300
  2001-08-28 17:14       ` Andrew Cagney
@ 2001-08-28 18:41         ` Kevin Buettner
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Buettner @ 2001-08-28 18:41 UTC (permalink / raw)
  To: Andrew Cagney, Kevin Buettner; +Cc: Jeff Holcomb, gdb-patches

On Aug 28,  8:14pm, Andrew Cagney wrote:

> > Yeah.  Or maybe just check sizeof (int)?
> > 
> > #if sizeof (int) <= 2
> > # define RANDOM_DATA_SIZE (1024)
> > #else
> > ...
> > #endif
> 
> I'm 98% certain you can't do that using ISO-C.

You're right.  (How is the preprocessor to know what sizeof (int) means?)

Well, what about Jeff's idea then?

Kevin


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-08-28 18:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-28 11:12 [RFA] fix gdb.base/remote.c and h8300 Jeff Holcomb
2001-08-28 12:33 ` Kevin Buettner
2001-08-28 16:17   ` Jeff Holcomb
2001-08-28 16:28     ` Kevin Buettner
2001-08-28 17:14       ` Andrew Cagney
2001-08-28 18:41         ` Kevin Buettner
2001-08-28 16:29     ` Andrew Cagney
2001-08-28 15:20 ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox