[rfc] Multiple process support in gdbserver

Pedro Alves pedro_alves@portugalmail.pt
Thu Jan 24 01:50:00 GMT 2008


Hi Daniel,

I'm finally looking at this very, very useful patch.

I've got a few small comments.

+      if (remote_exec_file == NULL)
+	error (_("Running the default executable on the remote target failed; "

It seems remote_exec_file can never be NULL.  Certainly you wanted to
check for empty string.

In gdbserver/linux-low.c, when you do this,

   free (all_processes.head);
   all_processes.head = all_processes.tail = NULL;

Isn't this leaking every ]all_processes.head, all_processes.tail]
if (all_processes.head != all_processes.tail) ?

shouldn't you be doing something like:

   for_each_inferiors (&all_processes, free_process);
   all_processes.head = all_processes.tail = NULL;

?

In addition to that, this almost works on Windows targets, we just
need to clean up the state when the inferiors are detached or
killed, like you're doing on linux.  If you prefer, I can post a
patch once this goes in.

-- 
Pedro Alves



More information about the Gdb-patches mailing list