This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: solist - internals: when ldd is in libc

> And this is, finally, my question: is there a mechanism in gdb to handle 
> such situation, or would supporting this scenario be a new feature?

Would the same routine in the target_ops object be what you are looking
for? Specifically, it is set to the following function for svr4:

    /* Return non-zero if GDB_SO_NAME and INFERIOR_SO_NAME represent
       the same shared library.  */
    static int
    svr4_same_1 (const char *gdb_so_name, const char *inferior_so_name)
      if (strcmp (gdb_so_name, inferior_so_name) == 0)
        return 1;
      /* On Solaris, when starting inferior we think that dynamic linker is
         /usr/lib/, but later on, the table of loaded shared libraries 
         contains /lib/  Sometimes one file is a link to another, but 
         sometimes they have identical content, but are not linked to each
         other.  We don't restrict this check for Solaris, but the chances
         of running into this situation elsewhere are very low.  */
      if (strcmp (gdb_so_name, "/usr/lib/") == 0
          && strcmp (inferior_so_name, "/lib/") == 0)
        return 1;
      /* Similarly, we observed the same issue with sparc64, but with
         different locations.  */
      if (strcmp (gdb_so_name, "/usr/lib/sparcv9/") == 0
          && strcmp (inferior_so_name, "/lib/sparcv9/") == 0)
        return 1;
      return 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]