* 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.
This commit is contained in:
Pedro Alves
2010-02-24 17:01:58 +00:00
parent 09de9781bd
commit 0723dbf578
5 changed files with 62 additions and 48 deletions

View File

@ -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(). */