This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [unavailable values part 1, 02/17] query the target about what has been collected in a traceframe (docs included)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]