[PATCH v2 3/6] Use get_remote_packet_size in download_tracepoint
Szabolcs Nagy
szabolcs.nagy@arm.com
Wed Aug 8 10:02:00 GMT 2018
On 03/08/18 22:41, Pedro Franco de Carvalho wrote:
> YYYY-MM-DD Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
>
> * 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.
> ---
> gdb/remote.c | 134 ++++++++++++++++++++++++++++++++++++++++++++---------------
> 1 file changed, 100 insertions(+), 34 deletions(-)
>
> diff --git a/gdb/remote.c b/gdb/remote.c
> index e3180923ee..4974c2e8f0 100644
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
> @@ -12832,26 +12832,35 @@ remote_target::remote_download_command_source (int num, ULONGEST addr,
> void
> remote_target::download_tracepoint (struct bp_location *loc)
> {
> -#define BUF_SIZE 2048
> -
> CORE_ADDR tpaddr;
> char addrbuf[40];
> - char buf[BUF_SIZE];
> std::vector<std::string> tdp_actions;
> std::vector<std::string> stepping_actions;
> char *pkt;
> struct breakpoint *b = loc->owner;
> struct tracepoint *t = (struct tracepoint *) b;
> struct remote_state *rs = get_remote_state ();
> + int ret;
> + char *err_msg = _("Tracepoint packet too large for target.");
> + size_t size_left;
> +
on baremetal arm targets i see
In file included from /S/gdb/common/common-defs.h:86:0,
from /S/gdb/defs.h:28,
from /S/gdb/remote.c:22:
/S/gdb/remote.c: In member function 'virtual void remote_target::download_tracepoint(bp_location*)':
/S/gdb/common/gdb_locale.h:35:27: error: deprecated conversion from string constant to 'char*' [-Werror=write-strings]
# define _(String) (String)
^
/S/gdb/remote.c:12844:19: note: in expansion of macro '_'
char *err_msg = _("Tracepoint packet too large for target.");
^
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:1611: remote.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/B/gdb'
make: *** [Makefile:9446: all-gdb] Error 2
More information about the Gdb-patches
mailing list