aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-03-06 13:38:54 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2017-03-07 10:54:46 -0500
commit4dab71822783834788e26c8858a37e3189efbdba (patch)
treee6f9876d21f328810db9ca5679b71422ba86ab8d
parent3c830b412ff85ca0662c8ed98311a9cee6895a81 (diff)
downloadgdb-4dab71822783834788e26c8858a37e3189efbdba.zip
gdb-4dab71822783834788e26c8858a37e3189efbdba.tar.gz
gdb-4dab71822783834788e26c8858a37e3189efbdba.tar.bz2
Add parametrized version of s390_inferior_tid
In the next patches, we'll want to use this function with a ptid other than inferior_ptid, so I add it with a separate patch to keep things clean. gdb/ChangeLog: * s390-linux-nat.c (s390_inferior_tid): Add overload with ptid parameter.
-rw-r--r--gdb/s390-linux-nat.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
index 2b205df..3544588 100644
--- a/gdb/s390-linux-nat.c
+++ b/gdb/s390-linux-nat.c
@@ -214,18 +214,26 @@ fill_fpregset (const struct regcache *regcache, fpregset_t *regp, int regno)
sizeof (fpregset_t));
}
-/* Find the TID for the current inferior thread to use with ptrace. */
+/* Find the TID for the inferior thread corresponding to PTID to use with
+ ptrace. */
static int
-s390_inferior_tid (void)
+s390_inferior_tid (ptid_t ptid)
{
/* GNU/Linux LWP ID's are process ID's. */
- int tid = ptid_get_lwp (inferior_ptid);
+ int tid = ptid_get_lwp (ptid);
if (tid == 0)
- tid = ptid_get_pid (inferior_ptid); /* Not a threaded program. */
+ tid = ptid_get_pid (ptid); /* Not a threaded program. */
return tid;
}
+/* Find the TID for the current inferior thread to use with ptrace. */
+static int
+s390_inferior_tid (void)
+{
+ return s390_inferior_tid (inferior_ptid);
+}
+
/* Fetch all general-purpose registers from process/thread TID and
store their values in GDB's register cache. */
static void