This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 13/16] move sizeof_pkt into remote_trace_find
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Fri, 21 Jun 2013 11:25:03 -0600
- Subject: [PATCH 13/16] move sizeof_pkt into remote_trace_find
- References: <1371835506-15691-1-git-send-email-tromey at redhat dot com>
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, not sizeof_pkt.
---
gdb/remote.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/gdb/remote.c b/gdb/remote.c
index 287b701..94aa5a8 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -496,8 +496,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)
@@ -10974,7 +10972,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."));
--
1.8.1.4