On 07/12, Roland McGrath wrote:
>
> > What is the reasoning for selecting /proc/ugdb instead of something like
> > /proc/<pid>/ugdb?
>
> The protocol, and gdb, support dealing with many processes over one control
> channel.  For normal the debugger model to work where it can attach to a
> process on demand, with your model it would have to open another fd for
> every process (or perhaps thread), maintain perhaps thousands of fds, do a
> select dance, never be able to pipeline notifications from multiple
> processes into a single receiving call in the debugger, etc.

Completely agreed. open() shouldn't be tied to any particular thread/process,
and the single fd should handle multiple tracees.

As for /proc/ugdb, this is just the random choice for now. It doesn't really
matter how we create the fd. In the long term we need the new syscall or
we can reuse sys_ptrace().

Oleg.

Reply via email to