This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Memory reads and writes should have size_t length
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Tom Tromey <tromey at redhat dot com>
- Date: Sat, 2 Jun 2012 01:29:58 +0530
- Subject: Re: [PATCH] Memory reads and writes should have size_t length
- References: <20120531125320.65ad1f8f@spoyarek> <20120601174809.GA21938@host2.jankratochvil.net>
On Fri, 1 Jun 2012 19:48:09 +0200, Jan wrote:
> On Thu, 31 May 2012 09:23:20 +0200, Siddhesh Poyarekar wrote:
> > --- a/gdb/corefile.c
> > +++ b/gdb/corefile.c
> > @@ -213,7 +213,7 @@ memory_error (int status, CORE_ADDR memaddr)
> > /* Same as target_read_memory, but report an error if can't read.
> > */
> > void
> > -read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
> > +read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, size_t len)
>
> This patch goes again more far than what is needed, couldn't this be
> ssize_t? Making it unsigned could be some other cleanup.
>
I took the liberty of changing signs here because this patch in itself
is small enough (and independent) and if it does cause a regression, it
should be pretty easy to isolate even with a simple bisect, unlike the
last patch where we'd have to hunt through 6k lines of a patch to
figure out what went wrong.
This patch can be tested independently, so I figured this was OK. What
do you think?
Regards,
Siddhesh