This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 2/3] remove all_lwps from gdbserver: use list api


On Thu, Feb 6, 2014 at 4:27 AM, Pedro Alves <palves@redhat.com> wrote:
> On 01/29/2014 06:11 PM, Doug Evans wrote:
>
>> +/* Return a pointer to the first inferior in the list, or NULL if there
>> +   isn't one.
>> +   This is for cases where the caller needs a thread, but doesn't care
>> +   which one.  */
>> +
>> +struct inferior_list_entry *
>> +get_first_inferior (void)
>> +{
>> +  if (all_threads.head != NULL)
>> +    return all_threads.head;
>
> I think this one, being an "inferior" function, should take
> a list as argument.
>
>> +  return NULL;
>> +}
>> +
>
>> +/* Helper for gdb_agent_about_to_close.
>> +   Return non-zero if thread ENTRY is in the same process in DATA.  */
>> +
>> +static int
>> +same_process_p (struct inferior_list_entry *inf, void *data)
>
> Mismatch between comment and parameter (ENTRY vs inf).
>
> Otherwise looks good to me.
>
> (Note: I noticed that patch 3 had a hunk that should be here:
>
>           if (!non_stop)
>             {
> -             current_inferior = (struct thread_info *) all_threads.head;
> +             current_inferior = get_first_thread ();
> )

Committed with the suggested changes.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]