Re: [PATCH v3 2/8] gdbserver: Add PID parameter to linux_get_auxv and linux_get_hwcap

Simon Marchi via Gdb-patches
2023-02-06T20:16:33Z

On 2/6/23 14:54, Pedro Alves wrote:
> AFAICT by playing with debugging the gdb.threads/leader-exit.exp program,
> you can't read /proc/PID/auxv if the leader thread has exited (is zombie).
>
> Maybe that ends up not mattering in practice, not sure, but it is a
> behavior change.

Even if we can't read /proc/PID/auxv if the leader thread has exited,
auxv is still a process-specific resource, not a thread-specific one,
right? So, I suppose that the target interface could still accept a
pid, but linux_process_target could pick an arbitrary non-exited thread
from that pid to read auxv from? Although I don't know what would
happen if that chose thread has just exited and we haven't consumed the
event yet.

Simon