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 v5 2/5] Share parts of gdb/gdbthread.h with gdbserver


On 03/30/2017 02:49 AM, Sergio Durigan Junior wrote:
> +struct thread_info *
> +add_thread_silent (ptid_t ptid)
> +{
> +  pid_t pid = ptid_get_pid (ptid);
> +
> +  /* Check if there is a process already.  */
> +  if (find_process_pid (pid) == NULL)
> +    add_process (pid, 0);
> +
> +  return add_thread (ptid_build (pid, pid, 0), NULL);

This ptid_build here is always using the "pid" as
lwpid.  This suggests to me that "add_thread_silent" was not the
right function entry point to share, since we're adding a hack
to one of the implementations.  Either we need a new function,
like "add_initial_thread (pid_t pid)", or maybe we could move the
add_thread_silent call in fork_inferior to the gdb-side, only?

Thanks,
Pedro Alves


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