Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH] Fix PR remote/9053: remove dead code on query packet size
Date: Fri, 08 Aug 2014 05:54:00 -0000	[thread overview]
Message-ID: <1407476986-24777-1-git-send-email-yao@codesourcery.com> (raw)

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-08  Yao Qi  <yao@codesourcery.com>

	PR remote/9053
	* remote.c (remote_xfer_partial): Remove dead code.
---
 gdb/remote.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/gdb/remote.c b/gdb/remote.c
index 473bb72..357e9f2 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -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 ())
-- 
1.9.0


             reply	other threads:[~2014-08-08  5:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08  5:54 Yao Qi [this message]
2014-08-08 13:57 ` Tom Tromey
2014-08-09  1:03   ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407476986-24777-1-git-send-email-yao@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox