The first entry in the xml list returned by svr4_current_sos_via_xfer_libraries() is the executable itself. For dynamically linked programs, the existing code that deals with gdbserver that doesn't support svr4_current_sos_via_xfer_libraries is ignoring the first entry. This patch applies the same logic on the result returned by svr4_current_sos_via_xfer_libraries(). See GDB PR/15507 for more details. -- 2013-05-28 Ben Cheng PR gdb/15507: * solib-svr4.c (svr4_current_sos): Ignore the first library list entry returned by svr4_current_sos_via_xfer_libraries call for dynamically linked programs.