From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Cc: teawater@gmail.com, luis_gustavo@mentor.com
Subject: [PATCH 1/5] Move ptid_match to common/ptid.c.
Date: Thu, 23 Jan 2014 14:10:00 -0000 [thread overview]
Message-ID: <1390486209-8167-1-git-send-email-palves@redhat.com> (raw)
In-Reply-To: <52E12075.3040601@redhat.com>
So that gdbserver can use it too.
---
gdb/common/ptid.c | 14 ++++++++++++++
gdb/common/ptid.h | 10 ++++++++++
gdb/inferior.h | 10 ----------
gdb/infrun.c | 14 --------------
4 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/gdb/common/ptid.c b/gdb/common/ptid.c
index 49354ad..f614669 100644
--- a/gdb/common/ptid.c
+++ b/gdb/common/ptid.c
@@ -114,3 +114,17 @@ ptid_tid_p (ptid_t ptid)
return (ptid_get_tid (ptid) != 0);
}
+
+int
+ptid_match (ptid_t ptid, ptid_t filter)
+{
+ if (ptid_equal (filter, minus_one_ptid))
+ return 1;
+ if (ptid_is_pid (filter)
+ && ptid_get_pid (ptid) == ptid_get_pid (filter))
+ return 1;
+ else if (ptid_equal (ptid, filter))
+ return 1;
+
+ return 0;
+}
diff --git a/gdb/common/ptid.h b/gdb/common/ptid.h
index 362882d..21b46d9 100644
--- a/gdb/common/ptid.h
+++ b/gdb/common/ptid.h
@@ -78,4 +78,14 @@ int ptid_lwp_p (ptid_t ptid);
/* Return true if PTID's tid member is non-zero. */
int ptid_tid_p (ptid_t ptid);
+/* Returns true if PTID matches filter FILTER. FILTER can be the wild
+ card MINUS_ONE_PTID (all ptid match it); can be a ptid representing
+ a process (ptid_is_pid returns true), in which case, all lwps and
+ threads of that given process match, lwps and threads of other
+ processes do not; or, it can represent a specific thread, in which
+ case, only that thread will match true. PTID must represent a
+ specific LWP or THREAD, it can never be a wild card. */
+
+extern int ptid_match (ptid_t ptid, ptid_t filter);
+
#endif
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 290980a8..fe0d5f7 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -65,16 +65,6 @@ extern void discard_infcall_control_state (struct infcall_control_state *);
extern struct regcache *
get_infcall_suspend_state_regcache (struct infcall_suspend_state *);
-/* Returns true if PTID matches filter FILTER. FILTER can be the wild
- card MINUS_ONE_PTID (all ptid match it); can be a ptid representing
- a process (ptid_is_pid returns true), in which case, all lwps and
- threads of that given process match, lwps and threads of other
- processes do not; or, it can represent a specific thread, in which
- case, only that thread will match true. PTID must represent a
- specific LWP or THREAD, it can never be a wild card. */
-
-extern int ptid_match (ptid_t ptid, ptid_t filter);
-
/* Save value of inferior_ptid so that it may be restored by
a later call to do_cleanups(). Returns the struct cleanup
pointer needed for later doing the cleanup. */
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 71d9615..8982f73 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -7084,20 +7084,6 @@ discard_infcall_control_state (struct infcall_control_state *inf_status)
xfree (inf_status);
}
\f
-int
-ptid_match (ptid_t ptid, ptid_t filter)
-{
- if (ptid_equal (filter, minus_one_ptid))
- return 1;
- if (ptid_is_pid (filter)
- && ptid_get_pid (ptid) == ptid_get_pid (filter))
- return 1;
- else if (ptid_equal (ptid, filter))
- return 1;
-
- return 0;
-}
-
/* restore_inferior_ptid() will be used by the cleanup machinery
to restore the inferior_ptid value saved in a call to
save_inferior_ptid(). */
--
1.7.11.7
next prev parent reply other threads:[~2014-01-23 14:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-20 10:00 [PATCH] Fix PR 12702 - gdb can hang waiting for thread group leader (gdbserver) Hui Zhu
2013-07-24 18:25 ` Pedro Alves
2013-11-19 6:19 ` Hui Zhu
2014-01-23 14:51 ` Pedro Alves
2014-01-23 14:10 ` Pedro Alves [this message]
2014-01-23 14:10 ` [PATCH 3/5] Linux waitpid/__WALL emulation wrapper: If WNOHANG is set, don't touch sigprocmask Pedro Alves
2014-02-27 14:47 ` Pedro Alves
2014-01-23 14:10 ` [PATCH 5/5] Add TARGET_WAITKIND_NO_RESUMED support to the RSP Pedro Alves
2014-01-23 14:10 ` [PATCH 4/5] Teach gdbserver's linux backend about no unwaited-for children (TARGET_WAITDKIND_NO_RESUMED) Pedro Alves
2014-01-23 14:10 ` [PATCH 2/5] Move status_to_str to nat/linux-waitpid.c Pedro Alves
2014-02-27 14:38 ` [PATCH] Fix PR 12702 - gdb can hang waiting for thread group leader (gdbserver) Pedro Alves
2014-02-27 14:54 ` Luis Machado
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=1390486209-8167-1-git-send-email-palves@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=luis_gustavo@mentor.com \
--cc=teawater@gmail.com \
/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