gdbserver: Reset current_thread when its process is removed.
Commit Message
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?
Comments
On 10/16/2015 03:48 PM, Aleksandar Ristovski wrote:
> On 15-10-16 10:04 AM, Pedro Alves wrote:
>> OK with intro comments added.
>>
>
> Like this?
That's perfect. Please push.
Thanks,
Pedro Alves
@@ -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)
{