remote/1948: remote_xfer_partial(): packet size probe fails when LENGTH and OFFSET are zero [target: avr]
Tue May 24 19:48:00 GMT 2005

>Number:         1948
>Category:       remote
>Synopsis:       remote_xfer_partial(): packet size probe fails when LENGTH and OFFSET are zero [target: avr]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 24 19:48:01 UTC 2005
>Originator:     Joerg Wunsch
>Release:        6.3
FreeBSD & configured for target AVR
In remote_xfer_partial(), the following piece of code suggests
the size of a remote packet can be probed:

  /* Note: a zero OFFSET and LEN can be used to query the minimum
     buffer size.  */
  if (offset == 0 && len == 0)
    return (rs->remote_packet_size);

Yet, a few lines above, the request had already been
discarded unless a buffer pointer was provided, commented

  /* Only handle reads.  */
  if (writebuf != NULL || readbuf == NULL)
    return -1;

That should be changed to not discard the request in the
case of a packet probe.  The suggested patch fixes this.

The problem became apparent as the "info io_registers"
command for the AVR target does no longer work (as it uses
the packet probe to decide how much space to allocate for
the IO register packet).
Use avr-gdb, connect to a target, and issue an
"info io_registers" command.  Debugging information in the
remote process indicate no request is sent there by GDB.

(NB: the AVR target only supports remote debugging.)

Content-Type: application/octet-stream; name="remote.c.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="remote.c.diff"


More information about the Gdb-prs mailing list