remote/1948: remote_xfer_partial(): packet size probe fails when LENGTH and OFFSET are zero [target: avr]

j@uriah.heep.sax.de j@uriah.heep.sax.de
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
>Closed-Date:
>Last-Modified:
>Originator:     Joerg Wunsch
>Release:        6.3
>Organization:
>Environment:
FreeBSD & configured for target AVR
>Description:
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
as:

  /* 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).
>How-To-Repeat:
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.)
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="remote.c.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="remote.c.diff"

LS0tIHJlbW90ZS5jLm9yaWcJU2F0IE5vdiAgNiAwMDozODoyNSAyMDA0CisrKyByZW1vdGUuYwlU
dWUgTWF5IDI0IDIxOjM0OjU5IDIwMDUKQEAgLTQ4OTUsOCArNDg5NSwxMCBAQAogCXJldHVybiAt
MTsKICAgICB9CiAKLSAgLyogT25seSBoYW5kbGUgcmVhZHMuICAqLwotICBpZiAod3JpdGVidWYg
IT0gTlVMTCB8fCByZWFkYnVmID09IE5VTEwpCisgIC8qIE9ubHkgaGFuZGxlIHJlYWRzLiAgWmVy
byBPRkZTRVQgYW5kIExFTkdUSCBpcyBqdXN0IGEgc2l6ZQorICAgKiBxdWVyeSBvbmx5LCBzbyBh
bGxvdyBpdCBhbnl3YXkuICAqLworICBpZiAoKHdyaXRlYnVmICE9IE5VTEwgfHwgcmVhZGJ1ZiA9
PSBOVUxMKSAmJgorICAgICAgIShvZmZzZXQgPT0gMCAmJiBsZW4gPT0gMCkpCiAgICAgcmV0dXJu
IC0xOwogCiAgIC8qIE1hcCBwcmUtZXhpc3Rpbmcgb2JqZWN0cyBvbnRvIGxldHRlcnMuICBETyBO
T1QgZG8gdGhpcyBmb3IgbmV3Cg==



More information about the Gdb-prs mailing list