Re: [patch 4/6] Prepare linux_find_memory_regions_full & co. for move

Jan Kratochvil
2013-03-26T16:53:06Z

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;