From: Tom Tromey Date: Wed, 14 Aug 2013 18:15:48 +0000 (+0000) Subject: move sizeof_pkt into remote_trace_find X-Git-Tag: binutils-2_24-branchpoint~272 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f65bcb75d05d93af037229e084160fe25259322;p=platform%2Fupstream%2Fbinutils.git move sizeof_pkt into remote_trace_find The global sizeof_pkt is only used in remote_trace_find, like so: reply = remote_get_noisy_reply (&(rs->buf), &sizeof_pkt); I think in this situation it is more correct to use the recorded size of the buffer. Otherwise it seems that some skew could result. * remote.c (sizeof_pkt): Remove. (remote_trace_find): Use rs->buf_size, not sizeof_pkt. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1f0f1e7..08800de 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-08-14 Tom Tromey + * remote.c (sizeof_pkt): Remove. + (remote_trace_find): Use rs->buf_size, not sizeof_pkt. + +2013-08-14 Tom Tromey + * remote.c (struct remote_state) : New fields. (remote_threads_info, remote_threads_extra_info) diff --git a/gdb/remote.c b/gdb/remote.c index 780a1be..0fa5fcd 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -490,8 +490,6 @@ struct remote_arch_state long remote_packet_size; }; -long sizeof_pkt = 2000; - /* Utility: generate error from an incoming stub packet. */ static void trace_error (char *buf) @@ -10971,7 +10969,7 @@ remote_trace_find (enum trace_find_type type, int num, } putpkt (rs->buf); - reply = remote_get_noisy_reply (&(rs->buf), &sizeof_pkt); + reply = remote_get_noisy_reply (&(rs->buf), &rs->buf_size); if (*reply == '\0') error (_("Target does not support this command."));