Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH 2/7] Add overload of s390_inferior_tid with a parameter
Date: Wed, 08 Mar 2017 16:42:00 -0000	[thread overview]
Message-ID: <20170308164140.7281-3-simon.marchi@ericsson.com> (raw)
In-Reply-To: <20170308164140.7281-1-simon.marchi@ericsson.com>

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


  parent reply	other threads:[~2017-03-08 16:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 16:42 [PATCH 0/7] Pass ptid to target_ops register methods Simon Marchi
2017-03-08 16:42 ` [PATCH 3/7] Define and use typedefs for bsd_uthread_ops fields Simon Marchi
2017-03-08 16:42 ` [PATCH 1/7] windows: Don't use current_thread for register fetch/store Simon Marchi
2017-03-08 16:42 ` [PATCH 6/7] Pass ptid to target_store_registers Simon Marchi
2017-03-08 16:42 ` [PATCH 4/7] Pass down ptid in bsd_uthread_ops layer Simon Marchi
2017-03-08 16:42 ` Simon Marchi [this message]
2017-03-08 16:42 ` [PATCH 7/7] Pass ptid to to_prepare_to_store Simon Marchi
2017-03-08 16:42 ` [PATCH 5/7] Pass ptid to target_fetch_registers Simon Marchi
2017-03-08 21:08   ` Simon Marchi
2017-03-08 17:03 ` [PATCH 0/7] Pass ptid to target_ops register methods Simon Marchi
2017-03-08 23:31 ` Pedro Alves
2017-03-10 16:06   ` Simon Marchi
2017-03-10 17:12     ` Ulrich Weigand
2017-03-10 17:51       ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170308164140.7281-3-simon.marchi@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox