This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFA: PACKET_OVERHEAD constant added to remote.c


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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]