From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id A3CA33858CDA; Fri, 2 Dec 2022 19:47:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3CA33858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670010421; bh=fE1qirOS/Sps+BBx0dVs9yGRMXt/gU7gd8bohIoRdoE=; h=From:To:Subject:Date:From; b=a+Mbyu1l9pzigfndFLUhmH4n/JLXo9VvSLjBN3mAt1XJJhkUNdqHYOuJfW+0viSv8 ynL228biPmjCzwTrezk5J2umYHJu7LApZghhZKK+8m//U0jQjUL8FzT9YKCerXdMFL iHSePQrXUntHZVSLulUhdGiZcJjuHkAaQ8yaBhTo= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/linux-nat: add pid parameter to linux_proc_xfer_memory_partial X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: f8baaa2b0bfe410f41cf1ca5c87ae78ca59587e5 X-Git-Newrev: f9f593ddb2dee399e1ad24370c8e627aa4262524 Message-Id: <20221202194701.A3CA33858CDA@sourceware.org> Date: Fri, 2 Dec 2022 19:47:01 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df9f593ddb2de= e399e1ad24370c8e627aa4262524 commit f9f593ddb2dee399e1ad24370c8e627aa4262524 Author: Simon Marchi Date: Fri Nov 25 16:27:15 2022 -0500 gdb/linux-nat: add pid parameter to linux_proc_xfer_memory_partial =20 Add a pid parameter to linux_proc_xfer_memory_partial, making the inferior_ptid reference bubble up close to the target_ops::xfer_partial boundary. No behavior change expected. =20 Change-Id: I58171b00ee1bba1ea22efdbb5dcab8b1ab3aac4c Diff: --- gdb/linux-nat.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 0b3c143382b..17e5dce08c3 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -3667,8 +3667,9 @@ linux_nat_xfer_osdata (enum target_object object, ULONGEST *xfered_len); =20 static enum target_xfer_status -linux_proc_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebu= f, - ULONGEST offset, LONGEST len, ULONGEST *xfered_len); +linux_proc_xfer_memory_partial (int pid, gdb_byte *readbuf, + const gdb_byte *writebuf, ULONGEST offset, + LONGEST len, ULONGEST *xfered_len); =20 enum target_xfer_status linux_nat_target::xfer_partial (enum target_object object, @@ -3713,8 +3714,9 @@ linux_nat_target::xfer_partial (enum target_object ob= ject, space, while the core was trying to write to the pre-exec address space. */ if (proc_mem_file_is_writable ()) - return linux_proc_xfer_memory_partial (readbuf, writebuf, - offset, len, xfered_len); + return linux_proc_xfer_memory_partial (inferior_ptid.pid (), readbuf, + writebuf, offset, len, + xfered_len); } =20 return inf_ptrace_target::xfer_partial (object, annex, readbuf, writebuf, @@ -3941,12 +3943,10 @@ linux_proc_xfer_memory_partial_fd (int fd, int pid, threads. */ =20 static enum target_xfer_status -linux_proc_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebu= f, - ULONGEST offset, LONGEST len, - ULONGEST *xfered_len) +linux_proc_xfer_memory_partial (int pid, gdb_byte *readbuf, + const gdb_byte *writebuf, ULONGEST offset, + LONGEST len, ULONGEST *xfered_len) { - int pid =3D inferior_ptid.pid (); - auto iter =3D proc_mem_file_map.find (pid); if (iter =3D=3D proc_mem_file_map.end ()) return TARGET_XFER_EOF;