]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
MIPS/Linux/native: Convert to `get_ptrace_pid' for PID extraction
authorMaciej W. Rozycki <macro@mips.com>
Fri, 20 Jul 2018 16:28:08 +0000 (17:28 +0100)
committerMaciej W. Rozycki <macro@mips.com>
Fri, 20 Jul 2018 16:28:08 +0000 (17:28 +0100)
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/ChangeLog
gdb/mips-linux-nat.c

index 197da2568e6181a0b531325297cee14b0ba86ae1..d13c9ef0cef4dc4e49376e7fee955e161e6dce29 100644 (file)
@@ -1,3 +1,9 @@
+2018-07-20  Maciej W. Rozycki  <macro@mips.com>
+
+       * mips-linux-nat.c (mips_linux_nat_target::read_description):
+       Call `get_ptrace_pid' rather than extracting the ptrace PID by
+       hand.
+
 2018-07-20  Keith Seitz  <keiths@redhat.com>
 
        * buildsym.h (struct buildsym_compunit) <m_objfile, m_subfiles,
index 21b1f583b9226911e27e8620db3fb379dc1d8b53..e37fa4dc302df28cf9a66f5e46342af6c35bfb53 100644 (file)
@@ -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);