diff mbox

[committed] MIPS/Linux/native: Convert to `get_ptrace_pid' for PID extraction

Message ID alpine.DEB.2.00.1807200114090.30992@tp.orcam.me.uk
State Committed
Headers show

Commit Message

Maciej W. Rozycki July 20, 2018, 4:29 p.m. UTC
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
diff mbox

Patch

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);