This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [unavailable values part 1, 02/17] query the target about what has been collected in a traceframe (docs included)
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 14 Feb 2011 12:59:32 +0100
- Subject: Re: [unavailable values part 1, 02/17] query the target about what has been collected in a traceframe (docs included)
- References: <201102071428.34708.pedro@codesourcery.com>
On Mon, 07 Feb 2011 15:28:34 +0100, Pedro Alves wrote:
> +/* Handle qXfer:traceframe-info:read. */
> +
> +static int
> +handle_qxfer_traceframe_info (const char *annex,
> + gdb_byte *readbuf, const gdb_byte *writebuf,
> + ULONGEST offset, LONGEST len)
> +{
> + static char *result = 0;
> + static unsigned int result_length = 0;
It should be size_t, this problem is common in GDB (even whole obstack).
[...]
> + result = buffer_finish (&buffer);
> + result_length = strlen (result);
> + buffer_free (&buffer);
> + }
[...]
> + memcpy (readbuf, result + offset, len);
I see more &result[offset] in use, not mentioned in GCS (GNU Coding Standards)
so considering both as allowed now.
CORE_ADDR is probably never planned to be possibly 4 bytes in gdbserver/
otherwise there are bugs.
Thanks,
Jan