This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch 4/6] Prepare linux_find_memory_regions_full & co. for move
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Aleksandar Ristovski <aristovski at qnx dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 26 Mar 2013 17:52:42 +0100
- Subject: Re: [patch 4/6] Prepare linux_find_memory_regions_full & co. for move
- References: <51278984 dot 3070208 at qnx dot com> <20130310210820 dot GE21130 at host2 dot jankratochvil dot net> <514C56CB dot 4070207 at qnx dot com>
On Fri, 22 Mar 2013 14:04:11 +0100, Aleksandar Ristovski wrote:
> --- a/gdb/target.c
> +++ b/gdb/target.c
[...]
> @@ -3540,15 +3578,17 @@ target_fileio_read_alloc (const char *filename, gdb_byte **buf_p)
> are returned as allocated but empty strings. A warning is issued
> if the result contains any embedded NUL bytes. */
>
> -char *
> -target_fileio_read_stralloc (const char *filename)
> +typedef LONGEST (read_stralloc_func_ftype) (const char *filename,
> + gdb_byte **buf_p, int padding);
> +
> +static char *
> +read_stralloc (const char *filename, read_stralloc_func_ftype *func)
> {
> gdb_byte *buffer;
> char *bufstr;
> LONGEST i, transferred;
>
> - transferred = target_fileio_read_alloc_1 (filename, &buffer, 1);
> - bufstr = (char *) buffer;
This line is accidentally deleted, it should not be.
> + transferred = func (filename, &buffer, 1);
>
> if (transferred < 0)
> return NULL;