This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Adjust remote memory packet alignment
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Sun, 15 Oct 2006 23:10:11 -0400
- Subject: [commit] Adjust remote memory packet alignment
Ronald Hecht reported a problem with one of my recent changes; his target
has very very few registers, so the packet size GDB assumes is very very
small, and the memory write packets were being rounded down to no bytes.
Tested on x86_64-pc-linux-gnu (using gdbserver) and by Ronald, and
committed.
--
Daniel Jacobowitz
CodeSourcery
2006-10-15 Daniel Jacobowitz <dan@codesourcery.com>
PR remote/2158
* remote.c (remote_write_bytes): Throttle packet alignment
for small packets.
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.226
diff -u -p -r1.226 remote.c
--- remote.c 16 Aug 2006 18:31:03 -0000 1.226
+++ remote.c 17 Aug 2006 14:06:09 -0000
@@ -3953,8 +3953,9 @@ remote_write_bytes (CORE_ADDR memaddr, c
payload_size);
/* If not all TODO bytes fit, then we'll need another packet. Make
- a second try to keep the end of the packet aligned. */
- if (nr_bytes < todo)
+ a second try to keep the end of the packet aligned. Don't do
+ this if the packet is tiny. */
+ if (nr_bytes < todo && nr_bytes > 2 * REMOTE_ALIGN_WRITES)
{
int new_nr_bytes;