Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Nathan Sidwell <nathan@codesourcery.com>
Cc: gdb-patches@sources.redhat.com, Paul Brook <paul@codesourcery.com>
Subject: Re: [PATCH] remote protocol cleanups
Date: Mon, 07 Mar 2005 22:45:00 -0000	[thread overview]
Message-ID: <20050307224517.GB28725@nevyn.them.org> (raw)
In-Reply-To: <4209F9CE.4030405@codesourcery.com>

On Wed, Feb 09, 2005 at 11:53:50AM +0000, Nathan Sidwell wrote:
> Hi,
> This patch fixes a couple of problems with the remote protcol handling
> 
> 1) remote_fetch_registers checks to see things have not got out of
> sync, but it does not deal with upper case hex characters and so can get
> confused
> 
> 2) remote_write_bytes attempts to honour get_memory_write_packet_size's
> limit, but fails in two ways when that is a very small number.  a) it can
> end up with a negative byte count. b) it deducts the number of chars in
> the *maximal* length count, not the number of chars in the actual length
> count.  This can result in packets sending 1 or 2 bytes fewer than they
> are limited to.
> 
> built & tested on i686-pc-linux-gnu and an unreleased architecture. ok?

Mostly OK, but one question.  I don't get the "max (todo, 1)".  If no
bytes fit, aren't we hosed?  It seems like an error condition; we
shouldn't be violating the size limit.

>       case PACKET_DISABLE:
>         *p++ = 'M';
>         /* Num bytes that will fit.  */
>         todo = min (len, payload_size / 2);
> +       payload_size -= hexnumlen (todo);
> +       todo = min (todo, payload_size / 2);
> +       todo = max (todo, 1);
>         break;
>       case PACKET_SUPPORT_UNKNOWN:
>         internal_error (__FILE__, __LINE__,


-- 
Daniel Jacobowitz
CodeSourcery, LLC


  reply	other threads:[~2005-03-07 22:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-09 14:19 Nathan Sidwell
2005-03-07 22:45 ` Daniel Jacobowitz [this message]
2005-03-08 11:09   ` Nathan Sidwell
2005-03-08 13:37     ` Daniel Jacobowitz

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=20050307224517.GB28725@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=nathan@codesourcery.com \
    --cc=paul@codesourcery.com \
    /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