From: Aleksandar Ristovski <aristovski@qnx.com>
To: Pedro Alves <palves@redhat.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdbserver: Reset current_thread when its process is removed.
Date: Fri, 16 Oct 2015 14:48:00 -0000 [thread overview]
Message-ID: <56210E49.9010304@qnx.com> (raw)
In-Reply-To: <562103DC.70605@redhat.com>
On 15-10-16 10:04 AM, Pedro Alves wrote:
> On 10/16/2015 02:40 PM, Aleksandar Ristovski wrote:
>
>> +static int
>> +thread_pid_matches_callback (struct inferior_list_entry *entry, void *args)
>> +{
>
> ...
>
>> +static struct thread_info *
>> +find_thread_process (const struct process_info *const process)
>> +{
>
> OK with intro comments added.
>
Like this?
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
index fe47a72..72a3ef1 100644
--- a/gdb/gdbserver/inferiors.c
+++ b/gdb/gdbserver/inferiors.c
@@ -141,12 +141,18 @@ find_thread_ptid (ptid_t ptid)
return (struct thread_info *) find_inferior_id (&all_threads, ptid);
}
+/* Predicate function for matching thread entry's pid to the given
+ pid value passed by address in ARGS. */
+
static int
thread_pid_matches_callback (struct inferior_list_entry *entry, void *args)
{
return (ptid_get_pid (entry->id) == *(pid_t *)args);
}
+/* Find a thread associated with the given PROCESS, or NULL if no
+ such thread exists. */
+
static struct thread_info *
find_thread_process (const struct process_info *const process)
{
next prev parent reply other threads:[~2015-10-16 14:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-15 14:36 Aleksandar Ristovski
2015-10-15 16:22 ` Pedro Alves
2015-10-16 13:40 ` Aleksandar Ristovski
2015-10-16 14:04 ` Pedro Alves
2015-10-16 14:48 ` Aleksandar Ristovski [this message]
2015-10-16 15:06 ` Pedro Alves
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=56210E49.9010304@qnx.com \
--to=aristovski@qnx.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.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