public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "tankut.baris.aktemur at intel dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug server/24751] doc: Can 'm' return partial read?
Date: Thu, 14 Mar 2024 12:32:10 +0000	[thread overview]
Message-ID: <bug-24751-4717-Gx6WGsyJ29@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-24751-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=24751

Baris Aktemur <tankut.baris.aktemur at intel dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tankut.baris.aktemur@intel.
                   |                            |com

--- Comment #1 from Baris Aktemur <tankut.baris.aktemur at intel dot com> ---
The `gdb_read_memory` function's comment reads

```
/* Read trace frame or inferior memory.  Returns the number of bytes
   actually read, zero when no further transfer is possible, and -1 on
   error.  Return of a positive value smaller than LEN does not
   indicate there's no more to be read, only the end of the transfer.
   E.g., when GDB reads memory from a traceframe, a first request may
   be served from a memory block that does not cover the whole request
   length.  A following request gets the rest served from either
   another block (of the same traceframe) or from the read-only
   regions.  */
```

The code that's about the traceframe is

```
      if (traceframe_read_mem (cs.current_traceframe,
                               memaddr, myaddr, len, &nbytes))
        return -1;
      /* Data read from trace buffer, we're done.  */
      if (nbytes > 0)
        return nbytes;
```

I checked the code of `traceframe_read_mem`.  It may indeed return a partial
result, indicated in `nbytes` above.

Based on these, the function comment and the documentation seem mostly accurate
to me.  If the documentation is updated as follows, would it be better?

"The reply may contain fewer addressable memory units than requested if the
server read from a traceframe and was able to read only part of the region of
memory."

-- 
You are receiving this mail because:
You are on the CC list for the bug.

       reply	other threads:[~2024-03-14 12:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-24751-4717@http.sourceware.org/bugzilla/>
2024-03-14 12:32 ` tankut.baris.aktemur at intel dot com [this message]
2024-03-15 11:58 ` labath at google dot com

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=bug-24751-4717-Gx6WGsyJ29@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).