Re: [PATCH v2 3/6] Use get_remote_packet_size in download_tracepoint

Ulrich Weigand
2018-08-02T16:47:05Z

Pedro Franco de Carvalho wrote:

> * remote.c (remote_target::download_tracepoint): Remove BUF_SIZE.
> Replace array buf with gdb::char_vector buf, of size
> get_remote_packet_size (). Replace references to buf and BUF_SIZE
> to buf.data () and buf.size (). Replace strcpy, strcat and
> pack_hex_byte with snprintf. Raise errors if the buffer is too
> small.

> if (target_static_tracepoint_marker_at (tpaddr, &marker))
> - strcat (buf, ":S");
> + {
> + size_left = buf.size () - strlen (buf.data ());
> + ret = snprintf (buf.data () + strlen (buf.data ()),
> + size_left, ":F%x",
> + gdb_insn_length (loc->gdbarch, tpaddr));

This changes the message -- I guess that should remain :S?

Otherwise this looks good to me.

Thanks,
Ulrich

--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com