From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id EAE5339524B1; Mon, 5 Dec 2022 21:39:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EAE5339524B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670276361; bh=xuq0LWGPay9hF5bmM3culvyQhZlIrxWNHM+yewrFZFI=; h=From:To:Subject:Date:From; b=mvMbLw/VCnSxNym3ZYfRkPASEV9IkvL/XpkgB54Ybu+DPF+6BnTdVAk16hd3LYEQx mJrIwSycYhmTN5YjXvu94snhVkYfC575T2dVyaQhn6VmvSNbTXcUbMtmHg4A8LiomV Bp9iLxBlbGCNbOr78DEW0pNGBYKjzglbutYxnjfc= 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: use l linux_nat_get_siginfo in linux_xfer_siginfo X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 7cc662bcb70fc4eb5a7b5883fd27fab0d4e372cb X-Git-Newrev: d29ea3286809466a0f490a39d3f6c72cf69bfa17 Message-Id: <20221205213921.EAE5339524B1@sourceware.org> Date: Mon, 5 Dec 2022 21:39:21 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dd29ea3286809= 466a0f490a39d3f6c72cf69bfa17 commit d29ea3286809466a0f490a39d3f6c72cf69bfa17 Author: Simon Marchi Date: Fri Dec 2 15:09:24 2022 -0500 gdb/linux-nat: use l linux_nat_get_siginfo in linux_xfer_siginfo =20 I noticed we could reduce duplication a bit here. =20 Change-Id: If24e54d1dac71b46f7c1f68a18a073d4c084b644 Diff: --- gdb/linux-nat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index b33fac3d149..aeb81cd01bd 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -3620,10 +3620,7 @@ linux_xfer_siginfo (enum target_object object, if (offset > sizeof (siginfo)) return TARGET_XFER_E_IO; =20 - int pid =3D get_ptrace_pid (inferior_ptid); - errno =3D 0; - ptrace (PTRACE_GETSIGINFO, pid, (PTRACE_TYPE_ARG3) 0, &siginfo); - if (errno !=3D 0) + if (!linux_nat_get_siginfo (inferior_ptid, &siginfo)) return TARGET_XFER_E_IO; =20 /* When GDB is built as a 64-bit application, ptrace writes into @@ -3646,6 +3643,7 @@ linux_xfer_siginfo (enum target_object object, /* Convert back to ptrace layout before flushing it out. */ siginfo_fixup (&siginfo, inf_siginfo, 1); =20 + int pid =3D get_ptrace_pid (inferior_ptid); errno =3D 0; ptrace (PTRACE_SETSIGINFO, pid, (PTRACE_TYPE_ARG3) 0, &siginfo); if (errno !=3D 0)