added target specific solib find hook
authorKris Warkentin <kewarken@qnx.com>
Mon, 24 Feb 2003 19:11:04 +0000 (19:11 +0000)
committerKris Warkentin <kewarken@qnx.com>
Mon, 24 Feb 2003 19:11:04 +0000 (19:11 +0000)
gdb/ChangeLog
gdb/solib.c
gdb/solist.h

index d181a53be9f4fd92abba29e9d50a8c36080c2f2b..82ab0d392dedea8043055090da76a6cb3e28bbd8 100644 (file)
@@ -1,3 +1,10 @@
+2003-02-24  Kris Warkentin  <kewarken@qnx.com>
+
+       * solib.c (solib_open): call target defined search function after
+       failing with solib-search-path
+       * solist.h (target_so_ops): add find_and_open_solib function hook,
+       create define TARGET_SO_FIND_AND_OPEN_SOLIB
+
 2003-02-24  Kris Warkentin  <kewarken@qnx.com>
 
        * MAINTAINERS: Add myself to Write After section
index da7179828003c5e5a1a50556e834974c43b7f531..289b84f34bfc4478a723383cd12597c491538132 100644 (file)
@@ -160,6 +160,11 @@ solib_open (char *in_pathname, char **found_pathname)
                         1, lbasename (in_pathname), O_RDONLY, 0,
                         &temp_pathname);
 
+  /* If not found, try to use target supplied solib search method */
+  if (found_file < 0 && TARGET_SO_FIND_AND_OPEN_SOLIB != NULL)
+    found_file = TARGET_SO_FIND_AND_OPEN_SOLIB
+                 (in_pathname, O_RDONLY, &temp_pathname);
+
   /* If not found, next search the inferior's $PATH environment variable. */
   if (found_file < 0 && solib_search_path != NULL)
     found_file = openp (get_in_environ (inferior_environ, "PATH"),
index dd1100c31cfd5acc9f8c5c926c1b8e249bf0d3e6..8e5c4321855ec2befe8c2580ee61eb510d1b0c5f 100644 (file)
@@ -99,6 +99,12 @@ struct target_so_ops
     /* Determine if PC lies in the dynamic symbol resolution code of
        the run time loader */
     int (*in_dynsym_resolve_code) (CORE_ADDR pc);
+
+    /* Extra hook for finding and opening a solib.  Convenience function
+       for remote debuggers finding host libs */
+    int (*find_and_open_solib) (char *soname,
+        unsigned o_flags, char **temp_pathname);
+    
   };
 
 void free_so (struct so_list *so);
@@ -122,5 +128,7 @@ extern struct target_so_ops *current_target_so_ops;
   (current_target_so_ops->open_symbol_file_object)
 #define TARGET_SO_IN_DYNSYM_RESOLVE_CODE \
   (current_target_so_ops->in_dynsym_resolve_code)
+#define TARGET_SO_FIND_AND_OPEN_SOLIB \
+  (current_target_so_ops->find_and_open_solib)
 
 #endif