On Mon, Oct 10, 2011 at 11:22 AM, Pedro Alves wrote: > This version goes back to breaking the "file right_executable" core > or attach cases (with static binaries) that the previous patch > fixed.  :-) > [...] > (gdb -c core; file exec). That scenario I hadn't thought of. Thanks, at least the code will be there for a documented reason. Note that the non-static case of that sequence was and still is broken. I checked this in. 2011-10-10 Doug Evans * linux-thread-db.c (thread_db_new_objfile): Only try to load libthread_db when we load libpthread or the main symbol file. (thread_db_inferior_created): New function. (_initialize_thread_db): Attach inferior_created observer. * linux-nat.c (linux_child_post_attach): Remove call to check_for_thread_db. (linux_child_post_startup_inferior): Ditto. * objfiles.h (OBJF_MAINLINE): Define. * symfile.c (symbol_file_add_with_addrs_or_offsets): Pass it to allocate_objfile when appropriate.