diff options
author | Pedro Alves <palves@redhat.com> | 2010-02-24 17:01:58 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2010-02-24 17:01:58 +0000 |
commit | 0723dbf578cc2f8ab942f4bbd36e1377adcd0620 (patch) | |
tree | 312b86861e6378fff025e8b3e4030d693a4efbb0 /gdb/infrun.c | |
parent | 09de9781bdd949cdd00adec6e0693a0d79d70463 (diff) | |
download | gdb-0723dbf578cc2f8ab942f4bbd36e1377adcd0620.zip gdb-0723dbf578cc2f8ab942f4bbd36e1377adcd0620.tar.gz gdb-0723dbf578cc2f8ab942f4bbd36e1377adcd0620.tar.bz2 |
* inferior.h (ptid_match): Declare.
* infrun.c (ptid_match): New.
* remote.c (queued_stop_reply): Rewrite and use ptid_match.
(handle_notification): Add debug output.
* linux-nat.c (ptid_match): Delete.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index 9a5c3a8..83abdeb 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -6126,6 +6126,26 @@ ptid_is_pid (ptid_t ptid) return (ptid_get_lwp (ptid) == 0 && ptid_get_tid (ptid) == 0); } +int +ptid_match (ptid_t ptid, ptid_t filter) +{ + /* Since both parameters have the same type, prevent easy mistakes + from happening. */ + gdb_assert (!ptid_equal (ptid, minus_one_ptid) + && !ptid_equal (ptid, null_ptid) + && !ptid_is_pid (ptid)); + + 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(). */ |