This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: RFA: PACKET_OVERHEAD constant added to remote.c
- To: Kevin Buettner <kevinb at cygnus dot com>
- Subject: Re: RFA: PACKET_OVERHEAD constant added to remote.c
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Tue, 16 Nov 1999 09:53:15 +1100
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <991112184146.ZM22052@ocotillo.lan>
Kevin Buettner wrote:
>
> Hi Andrew,
>
> Jesper Skov alerted me to the fact that we were getting some "Remote
> packet too long" messages when attempting to debug using a gdbserver
> for i386 linux. The problem was that the memory packet size
> computations were not taking into account the packet overhead. This
> would've been a one line fix, but I decided to define PACKET_OVERHEAD
> instead of adding another hard-coded instance of the constant 32.
Keven,
I'm puzzled. (I guess you mean one of the M or X packets?).
I thought the function remote_write_bytes () was already taking care of
the packet overhead. Can you expand a little on what exactly Jesper is
seeing?
perhaphs this is an old problem?
confused,
Andrew
FYI, the pre change code is below, the new code was ment to be
functionally equivalent.
#define MAXBUFBYTES(N) (((N)-32)/2)
#define PBUFSIZ ((REGISTER_BYTES > MAXBUFBYTES (400)) \
? (REGISTER_BYTES * 2 + 32) \
: 400)
...
remote_write_size = PBUFSIZ;
...
/* Determine the max packet size. */
max_buf_size = min (remote_write_size, PBUFSIZ);
if (remote_register_buf_size != 0)
max_buf_size = min (max_buf_size, remote_register_buf_size);
buf = alloca (max_buf_size + 1);