Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Ralf Corsepius <ralf.corsepius@rtems.org>
To: tromey@redhat.com
Cc: Joel Brobecker <brobecker@adacore.com>,
	gdb@sourceware.org,   Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: GDB 6.8.92 available for testing
Date: Fri, 02 Oct 2009 16:57:00 -0000	[thread overview]
Message-ID: <4AC630C8.5090508@rtems.org> (raw)
In-Reply-To: <m3ocopsspz.fsf@fleche.redhat.com>

On 10/02/2009 05:47 PM, Tom Tromey wrote:
>>>>>> "Ralf" == Ralf Corsepius<ralf.corsepius@rtems.org>  writes:
>>>>>>              
> Ralf>  Eg. this one:
> Ralf>  http://sourceware.org/ml/gdb-patches/2009-09/msg00585.html
>
> I checked this in.
>
> Ralf>  and this one:
> Ralf>  http://sourceware.org/ml/gdb-patches/2009-09/msg00556.html
>
> Ralf>  But I presume, I can consider the later one to be rejected - This
> Ralf>  doesn't help anybody, but ... you want it this way, so be it.
>
> I think 'len' should be 'unsigned int', not 'size_t'.
>    
I think, len should be size_t, like any "sizeof"'s return type.


This also manifests in how "len" is being used in the fragment in question:

sparc32_store_return_value (struct type *type, struct regcache *regcache,
                             const gdb_byte *valbuf)
{
   size_t len = TYPE_LENGTH (type);
   gdb_byte buf[8];

   gdb_assert (!sparc_structure_or_union_p (type));
   gdb_assert (!(sparc_floating_p (type) && len == 16));

   if (sparc_floating_p (type))
     {
       /* Floating return values.  */
       memcpy (buf, valbuf, len);
       regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf);
       if (len > 4)
         regcache_cooked_write (regcache, SPARC_F1_REGNUM, buf + 4);
     }
   else
     {
       /* Integral and pointer return values.  */
       gdb_assert (sparc_integral_or_pointer_p (type));

       if (len > 4)
         {
           gdb_assert (len == 8);
           memcpy (buf, valbuf, 8);
           regcache_cooked_write (regcache, SPARC_O1_REGNUM, buf + 4);
         }
       else
         {
           /* ??? Do we need to do any sign-extension here?  */
           memcpy (buf + 4 - len, valbuf, len);
         }
       regcache_cooked_write (regcache, SPARC_O0_REGNUM, buf);
     }
}
...

Note: memcpy(..., len)

Apart of this, I can't imagine changing this "int" into "size_t" to have 
any negative impact.

That is, though the origin for the patch might be a bug in GCC, I don't 
see how the patch can be harmful.

Ralf


  reply	other threads:[~2009-10-02 16:57 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-30 20:48 Joel Brobecker
2009-10-01  3:17 ` Ralf Corsepius
2009-10-01  8:59   ` Andreas Schwab
2009-10-01  9:35     ` Pierre Muller
2009-10-01  9:42       ` Andreas Schwab
2009-10-01 12:11         ` Ralf Corsepius
2009-10-01 13:10           ` Jan Kratochvil
2009-10-02 15:40             ` Tom Tromey
2009-10-02 17:26               ` Jan Kratochvil
2009-10-01 10:09   ` Jan Kratochvil
2009-10-01 11:20     ` Ralf Corsepius
2009-10-01 18:16       ` Joel Brobecker
2009-10-02  2:46         ` Ralf Corsepius
2009-10-02 15:39     ` Tom Tromey
2009-10-02 17:28       ` Jan Kratochvil
2009-10-01 17:07   ` Joel Brobecker
2009-10-01 17:21     ` Ralf Corsepius
2009-10-01 17:35       ` Mark Kettenis
2009-10-01 18:27         ` Joel Brobecker
2009-10-01 18:37           ` Mark Kettenis
2009-10-01 20:22             ` Eli Zaretskii
2009-10-01 18:40           ` Paul Pluzhnikov
2009-10-01 18:25       ` Joel Brobecker
2009-10-02 15:48       ` Tom Tromey
2009-10-02 16:57         ` Ralf Corsepius [this message]
2009-10-02 17:27           ` Tom Tromey
2009-10-02 18:04             ` Mark Kettenis
2009-10-02 18:15               ` Joel Brobecker
2009-10-02 18:24                 ` Mark Kettenis
2009-10-02 18:38                   ` Jan Kratochvil
2009-10-02 21:46                     ` Tom Tromey
2009-10-02 22:00                       ` Jan Kratochvil
2009-10-02 15:35   ` Tom Tromey
2009-10-01 12:02 ` Pierre Muller
2009-10-01 17:56   ` Joel Brobecker
2009-10-01 21:22     ` [RFA] more fixes to testsuite (was RE: GDB 6.8.92 available for testing) Pierre Muller
2009-10-01 21:28       ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AC630C8.5090508@rtems.org \
    --to=ralf.corsepius@rtems.org \
    --cc=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox