[RFA/gdbserver/LynxOS]: Incomplete thread list after --attach

Joel Brobecker brobecker@adacore.com
Tue Oct 1 10:02:00 GMT 2013


> > Unfortunately, as the added comments hints, there appears to be
> > no way of getting the list of threads via ptrace, other than by
> > spawning the "ps" command, and parsing its output. Not great,
> > but it appears to be the best we can do.  This method was actually
> > inspired by looking at old code which did exactly that.
> 
> Huh.  I didn't really look at the patch yet, but, then, how
> does "ps" manage to work?  If you strace "ps", what system calls
> is it using?  I'd imagine if not ptrace, then it would be reading
> /proc or some such?

I can look. But what strongly detered me from doing that is the fact
that it'd be starting to use unpublished interfaces. Running "ps"
isn't pretty, but I can hope it'll keep working across versions of
Lynx (we tested against Lynx 178 and 5.x, knowing that this has worked
with 4.x as well).

-- 
Joel



More information about the Gdb-patches mailing list