aboutsummaryrefslogtreecommitdiff
path: root/gdb/m32r-linux-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/m32r-linux-nat.c')
-rw-r--r--gdb/m32r-linux-nat.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c
index 9d9bef3..a33de23 100644
--- a/gdb/m32r-linux-nat.c
+++ b/gdb/m32r-linux-nat.c
@@ -26,6 +26,7 @@
#include "nat/gdb_ptrace.h"
#include <sys/user.h>
#include <sys/procfs.h>
+#include "inf-ptrace.h"
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
@@ -194,12 +195,7 @@ static void
m32r_linux_fetch_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int regno)
{
- int tid;
-
- /* GNU/Linux LWP ID's are process ID's. */
- tid = ptid_get_lwp (inferior_ptid);
- if (tid == 0)
- tid = ptid_get_pid (inferior_ptid); /* Not a threaded program. */
+ pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
/* Use the PTRACE_GETREGS request whenever possible, since it
transfers more registers in one system call, and we'll cache the
@@ -221,11 +217,7 @@ static void
m32r_linux_store_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int regno)
{
- int tid;
-
- /* GNU/Linux LWP ID's are process ID's. */
- if ((tid = ptid_get_lwp (inferior_ptid)) == 0)
- tid = ptid_get_pid (inferior_ptid); /* Not a threaded program. */
+ pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
/* Use the PTRACE_SETREGS request whenever possible, since it
transfers more registers in one system call. */