This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/7] Add overload of s390_inferior_tid with a parameter
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>
- Date: Wed, 8 Mar 2017 11:41:35 -0500
- Subject: [PATCH 2/7] Add overload of s390_inferior_tid with a parameter
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=ericsson.com;
- References: <20170308164140.7281-1-simon.marchi@ericsson.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
In the following patches, we'll want to use this function with a ptid
other than inferior_ptid. This patch adds an overload which takes a
ptid as a parameter.
gdb/ChangeLog:
* s390-linux-nat.c (s390_inferior_tid): Add overload with ptid
parameter.
---
gdb/s390-linux-nat.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
index 2b205df9de..3544588de6 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
--
2.11.0