I used the word "needless" above because I think there's a perfectly
reasonable way that the user can achieve the same effect without
modifying gdb. Simply place the following commands in a suitable
.gdbinit file:
set auto-solib-add off
define hook-stop
sharedlibrary libpthread
end
The ``hook-stop'' definition above will attempt to load the libpthread
shared library every time gdb stops. Of course, once a shared library
has been loaded, future attempts to load the shared library are
effectively no-ops since gdb knows that the library is already loaded.