From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC1973857C77; Thu, 14 Mar 2024 12:32:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC1973857C77 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710419532; bh=RBpEvWf8tuVj3LnjEz1m/iP5vjeREC/JoW7pvMIeAqw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NAgckDV/0fSIzky1dt5MJhBu6Oj7cPrVjiGoHMU0nUfjw+Ku2ellPJVv6ygIkZDoX /er2xHdihECbZiJTtUSdIiapKLhDYpT2/jqUkBau3TX3B5c9KmLWU66pHgdsrw4VEd blczxaRuf152dQ6gtu9XdyiV74d5TK2jKQWX44L0= From: "tankut.baris.aktemur at intel dot com" To: gdb-prs@sourceware.org Subject: [Bug server/24751] doc: Can 'm' return partial read? Date: Thu, 14 Mar 2024 12:32:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: server X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: tankut.baris.aktemur at intel dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: pedro at palves dot net X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D24751 Baris Aktemur changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tankut.baris.aktemur@intel. | |com --- Comment #1 from Baris Aktemur -= -- 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 accu= rate 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." --=20 You are receiving this mail because: You are on the CC list for the bug.=