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] gdbserver: Reset current_thread when its process is removed.


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)
 {


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