Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* patch to allow target defined solib search method
@ 2003-02-21 22:25 Kris Warkentin
  2003-02-22  2:04 ` Kevin Buettner
  0 siblings, 1 reply; 16+ messages in thread
From: Kris Warkentin @ 2003-02-21 22:25 UTC (permalink / raw)
  To: gdb-patches

The following patch allows a target to define a function for finding shared
libraries.  This prevents target back ends from having to monkey with
solib-search-path.

ChangeLog entry

    Add target function hook for searching out solibs.
    * solib.c: solib_open(): call search function after failing with
solib-search-path
    * solist.h: struct target_so_ops: add find_and_open_solib function hook,
create define
                                TARGET_SO_FIND_AND_OPEN_SOLIB

cheers,

Kris

Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.54
diff -u -r1.54 solib.c
--- solib.c 20 Feb 2003 18:25:27 -0000 1.54
+++ solib.c 21 Feb 2003 22:18:44 -0000
@@ -160,6 +160,10 @@
                         1, lbasename (in_pathname), O_RDONLY, 0,
                         &temp_pathname);

+  /* If not found, next use target supplied solib search method (if
existing) */
+  if (found_file < 0 && TARGET_SO_FIND_AND_OPEN_SOLIB)
+   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: solist.h
===================================================================
RCS file: /cvs/src/src/gdb/solist.h,v
retrieving revision 1.7
diff -u -r1.7 solist.h
--- solist.h 21 Oct 2001 19:20:30 -0000 1.7
+++ solist.h 21 Feb 2003 22:18:44 -0000
@@ -99,6 +99,11 @@
     /* 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 +127,7 @@
   (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


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2003-02-24 20:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-21 22:25 patch to allow target defined solib search method Kris Warkentin
2003-02-22  2:04 ` Kevin Buettner
2003-02-22  4:33   ` Kris Warkentin
2003-02-22  6:14     ` Daniel Jacobowitz
2003-02-24 16:04       ` Kris Warkentin
     [not found]   ` <1030222021025.ZM18868@localhost.localdomain>
     [not found]     ` <003301c2da28$71ce7ce0$2a00a8c0@dash>
     [not found]       ` <3E5A4ABD.1080706@redhat.com>
2003-02-24 16:53         ` Add Kris Warkentin to write after maintainers Kris Warkentin
2003-02-24 17:11           ` Andrew Cagney
2003-02-24 17:16             ` Kris Warkentin
2003-02-24 18:00               ` Kris Warkentin
2003-02-24 18:10             ` Andrew Cagney
2003-02-24 18:40               ` David Carlton
2003-02-24 20:01                 ` Andrew Cagney
2003-02-24 20:12                   ` Kris Warkentin
2003-02-24 18:50               ` Daniel Jacobowitz
2003-02-24 20:04                 ` Andrew Cagney
2003-02-24 20:18                   ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox