A wart I've been meaning to come back to for ages; I have some fixes for
thread debugging in static binaries that would have been quite ugly
without this, so I took a day to do it.
There are two target vectors in the current incarnation of linux-nat.c. The
one returned by linux_target () and inherited by target-specific files is
used for non-threaded applications; it handles basic operations including
target-specific extensions to them. The one built in linux_nat_ops
handles clone and can be used with libthread_db, and delegates to the
single-threaded variant for basic tasks.
This is a bit silly :-) We still need the separation between single and
multi-threaded vectors for the moment, because targets want to override
the single-threaded primitives rather than the complex multi-threaded
layer. However, that's all we need the single-threaded vector for. We
don't ever need to _use_ it.
This patch kills most of the single-threaded vector and arranges to
use the multi-threaded version in all cases. Some duplicated code
goes away, and it is suddenly much easier to switch back and forth
between "threaded" and "non-threaded" debugging.
One oddity: the Linux native target remains at process_stratum even
though it supports threads. I think this is right; the thread_stratum
gets used for linux-thread-db.c support which delegates to the process
stratum. If we had arbitrary stacking instead of strata I might
stack the linux multithreaded bits above the linux single-threaded
bits, but I think this is more natural.
Tested on x86_64-pc-linux-gnu. Any comments? Seems like progress?
Depends on my previous linux-fork.c patch, but only trivially.