This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[committed] MIPS/Linux/native: Convert to `get_ptrace_pid' for PID extraction
- From: "Maciej W. Rozycki" <macro at mips dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Fri, 20 Jul 2018 17:29:19 +0100
- Subject: [committed] MIPS/Linux/native: Convert to `get_ptrace_pid' for PID extraction
Use `get_ptrace_pid' to get the ptrace PID from `inferior_ptid' rather
than extracting it by hand.
gdb/
* mips-linux-nat.c (mips_linux_nat_target::read_description):
Call `get_ptrace_pid' rather than extracting the ptrace PID by
hand.
---
gdb/mips-linux-nat.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
gdb-mips-linux-nat-get-ptrace-pid.diff
Index: binutils/gdb/mips-linux-nat.c
===================================================================
--- binutils.orig/gdb/mips-linux-nat.c 2018-07-09 18:07:06.852666718 +0100
+++ binutils/gdb/mips-linux-nat.c 2018-07-20 00:30:12.473106296 +0100
@@ -458,11 +458,7 @@ mips_linux_nat_target::read_description
if (have_dsp < 0)
{
- int tid;
-
- tid = inferior_ptid.lwp ();
- if (tid == 0)
- tid = inferior_ptid.pid ();
+ int tid = get_ptrace_pid (inferior_ptid);
errno = 0;
ptrace (PTRACE_PEEKUSER, tid, DSP_CONTROL, 0);