]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix PR remote/9053: remove dead code on query packet size
authorYao Qi <yao@codesourcery.com>
Fri, 8 Aug 2014 05:45:23 +0000 (13:45 +0800)
committerYao Qi <yao@codesourcery.com>
Sat, 9 Aug 2014 00:50:17 +0000 (08:50 +0800)
The code becomes dead as GDB evolves.  In 2003, Andrew Cagney post patch
https://sourceware.org/ml/gdb-patches/2003-10/msg00511.html to add target
read/write partial methods.  They support query buffer size when both
OFFSET and LEN is zero, and it was used in avr-tdep.c and kod.c.  Then,
Daniel added target_read_object_alloc and avr-tdep.c switches to use that
in patch https://sourceware.org/ml/gdb-patches/2006-07/msg00009.html
From then on, GDB on longer queries the buffer size, so the code
returning packet size in remote_xfer_partial became dead.

PR 17060 is duplicated of PR 9053, so I mention the latter in the
ChangeLog entry.  Rebuild GDB with this patch.  OK to apply?
I'll mark PR 17060 as duplicated once the patch is applied.

gdb:

2014-08-09  Yao Qi  <yao@codesourcery.com>

PR remote/9053
* remote.c (remote_xfer_partial): Remove dead code.

gdb/ChangeLog
gdb/remote.c

index 7dd366b63c0690317e273e7bcd13825f9a37e48c..0e30fe03293806e46c852f66da85ac8b50d65512 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-09  Yao Qi  <yao@codesourcery.com>
+
+       PR remote/9053
+       * remote.c (remote_xfer_partial): Remove dead code.
+
 2014-08-07  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * ia64-linux-tdep.c: Include "regset.h".
index 473bb724a20a809f115edffeb76afc34d2a673ff..357e9f2c91244b3ed20d8f247d0feb1002864949 100644 (file)
@@ -8863,10 +8863,6 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object,
       return TARGET_XFER_E_IO;
     }
 
-  /* Note: a zero OFFSET and LEN can be used to query the minimum
-     buffer size.  */
-  if (offset == 0 && len == 0)
-    return (get_remote_packet_size ());
   /* Minimum outbuf size is get_remote_packet_size ().  If LEN is not
      large enough let the caller deal with it.  */
   if (len < get_remote_packet_size ())