Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] Unconditionally include shared library code
@ 2005-05-02 12:53 Mark Kettenis
  2005-05-08 13:15 ` Mark Kettenis
  0 siblings, 1 reply; 12+ messages in thread
From: Mark Kettenis @ 2005-05-02 12:53 UTC (permalink / raw)
  To: gdb-patches

This patch is an attempt to be able to link in the generic shared
library code in solib.c while attempting to keep the shared library
implementations that have not yet been converted to use the generic
code (Windows, coff) working.  It allows me to get rid of
DEPRECATED_TM_FILE in basically every *BSD target.

I introduce two new files shlib.c, shlib.h.  I need these because
solib.h contains both the prototypes and macro defenitions for the
shared library stuff.  In the long run, I should be able to get rid of
either shlib.[ch] or solib.[ch] again.  I took the opportunity to give
various functions a somewhat more logical name.

Comments are welcome.  It'd also be great if this could be tested on
Cygwin.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* shlib.c, shlib.h: New files.
	* breakpoint.c: Include "shlib.h".
	(insert_bp_location) [!DISABLE_UNSETTABLE_BREAK]: Call
	shlib_for_pc.
	(remove_solib_event_breakpoints, create_solib_event_breakpoint)
	(disable_breakpoints_in_shlibs)
	(disable_breakpoints_in_unloaded_shlib)
	(re_enable_breakpoints_in_shlibs): Compile if SOLIB_ADD isn't
	defined. If PC_SOLIB isn't defined, call shlib_for_pc.
	(_initialize_breakpoint): Unconditionally install observer.
	* corelow.c: Include "shlib.h".
	[SOLIB_ADD] (solib_add_stub): Remove prototype.
	(core_close) [!CLEAR_SOLIB]: Call shlib_clear.
	(solib_add_stub) [!SOLIB_ADD] Call shlib_rescan.
	(core_open): Unconditionally call solib_add_stub.
	* fork-child.c: Include "shlib.h".
	(fork_inferior) [!SOLIB_CREATE_INFERIOR_HOOK]: Call shlib_init.
	* infcmd.c: Include "shlib.h".
	(attach_command) [!SOLIB_ADD]: Call shlib_rescan.  Unconditionally
	call re_enable_breakpoints_in_shlibs.
	* infrun.c: Include "shlib.h".
	(SOLIB_IN_SYNSYM_RESOLVE_CODE): Don't define if not already
	defined.
	(stop_on_solib_events, show_stop_on_solib_events): Include
	unconditionally.
	(follow_exec) [!SOLIB_CREATE_INFERIOR_HOOK]: Call shlib_init.
	(handle_inferior_event) [!SOLIB_ADD]: Call shlib_rescan.
	[!IN_SOLIB_DYNSYM_RESOLVE_CODE]: Call shlib_pc_in_resolver.
	(_initialize_infrun): Unconditionally add "stop_on_solib-events"
	command.
	* remote.c: Include "shlib.h".
	(remote_open_1) [!SOLIB_CREATE_INFERIOR_HOOK] Call shlib_init.
	* stack.c: Include "shlib.h".
	(print_frame) [!PC_SOLIB] Call shlib_for_pc.
	* Makefile.in (SFILES): Add shlib.c and solib.c.
	(ALLDEPFILES): Remove solib.c.
	(COMMON_OBS): Add shlib.o and solib.o.
	(shlib_h): New variable.
	(breakpoint.o, corelow.o, fork-chiled.o, infcmd.o, infrun.o)
	(remote.o, stack.o): Update dependencies.
	(shlib.o): New dependency.

Index: shlib.c
===================================================================
RCS file: shlib.c
diff -N shlib.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ shlib.c 2 May 2005 12:30:22 -0000
@@ -0,0 +1,54 @@
+/* Shared library support code.
+
+   Copyright 2005 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "shlib.h"
+#include "solib.h"
+
+void
+shlib_init (ptid_t ptid)
+{
+  solib_create_inferior_hook ();
+}
+
+void
+shlib_rescan (int from_tty, struct target_ops *ops, int read_syms)
+{
+  solib_add (NULL, from_tty, ops, read_syms);
+}
+
+char *
+shlib_for_pc (CORE_ADDR pc)
+{
+  return solib_address (pc);
+}
+
+int
+shlib_pc_in_resolver (CORE_ADDR pc)
+{
+  return in_solib_dynsym_resolve_code (pc);
+}
+
+void
+shlib_clear (void)
+{
+  clear_solib ();
+}
Index: shlib.h
===================================================================
RCS file: shlib.h
diff -N shlib.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ shlib.h 2 May 2005 12:30:22 -0000
@@ -0,0 +1,33 @@
+/* Shared library support code.
+
+   Copyright 2005 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef SHLIB_H
+#define SHLIB_H
+
+extern void shlib_init (ptid_t);
+extern void shlib_rescan (int, struct target_ops *, int);
+extern char *shlib_for_pc (CORE_ADDR);
+extern int shlib_pc_in_resolver (CORE_ADDR);
+extern void shlib_clear (void);
+
+#endif /* shlib.h */
+
+
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.213
diff -u -p -r1.213 breakpoint.c
--- breakpoint.c 26 Apr 2005 05:03:35 -0000 1.213
+++ breakpoint.c 2 May 2005 12:30:27 -0000
@@ -49,6 +49,7 @@
 #include "cli/cli-script.h"
 #include "gdb_assert.h"
 #include "block.h"
+#include "shlib.h"
 #include "solist.h"
 #include "observer.h"
 #include "exceptions.h"
@@ -853,8 +854,13 @@ insert_bp_location (struct bp_location *
       if (val)
 	{
 	  /* Can't set the breakpoint.  */
+	  if (
 #if defined (DISABLE_UNSETTABLE_BREAK)
-	  if (DISABLE_UNSETTABLE_BREAK (bpt->address))
+	      DISABLE_UNSETTABLE_BREAK (bpt->address)
+#else
+	      shlib_for_pc (bpt->address)
+#endif
+	      )
 	    {
 	      /* See also: disable_breakpoints_in_shlibs. */
 	      val = 0;
@@ -872,7 +878,6 @@ insert_bp_location (struct bp_location *
 				  "breakpoint #%d\n", bpt->owner->number);
 	    }
 	  else
-#endif
 	    {
 #ifdef ONE_PROCESS_WRITETEXT
 	      *process_warning = 1;
@@ -4330,7 +4335,6 @@ resolve_pending_breakpoint (struct break
   return rc;
 }
 
-#ifdef SOLIB_ADD
 void
 remove_solib_event_breakpoints (void)
 {
@@ -4362,12 +4366,14 @@ disable_breakpoints_in_shlibs (int silen
   /* See also: insert_breakpoints, under DISABLE_UNSETTABLE_BREAK. */
   ALL_BREAKPOINTS (b)
   {
-#if defined (PC_SOLIB)
-    if (((b->type == bp_breakpoint) ||
-	 (b->type == bp_hardware_breakpoint)) &&
-	breakpoint_enabled (b) &&
-	!b->loc->duplicate &&
-	PC_SOLIB (b->loc->address))
+    if (((b->type == bp_breakpoint) || (b->type == bp_hardware_breakpoint))
+	&& breakpoint_enabled (b) && !b->loc->duplicate
+#ifdef PC_SOLIB
+	&& PC_SOLIB (b->loc->address)
+#else
+	&& shlib_for_pc (b->loc->address)
+#endif
+	)
       {
 	b->enable_state = bp_shlib_disabled;
 	if (!silent)
@@ -4381,7 +4387,6 @@ disable_breakpoints_in_shlibs (int silen
 	    warning (_("breakpoint #%d "), b->number);
 	  }
       }
-#endif
   }
 }
 
@@ -4394,18 +4399,19 @@ disable_breakpoints_in_unloaded_shlib (s
   struct breakpoint *b;
   int disabled_shlib_breaks = 0;
 
-#if defined (PC_SOLIB)
   /* See also: insert_breakpoints, under DISABLE_UNSETTABLE_BREAK.  */
   ALL_BREAKPOINTS (b)
   {
     if ((b->loc->loc_type == bp_loc_hardware_breakpoint
 	|| b->loc->loc_type == bp_loc_software_breakpoint)
-	&& breakpoint_enabled (b) 
-	&& !b->loc->duplicate)
+	&& breakpoint_enabled (b) && !b->loc->duplicate)
       {
+#ifdef PC_SOLIB
 	char *so_name = PC_SOLIB (b->loc->address);
-	if (so_name 
-	    && !strcmp (so_name, solib->so_name))
+#else
+	char *so_name = shlib_for_pc (b->loc->address);
+#endif
+	if (so_name && !strcmp (so_name, solib->so_name))
           {
 	    b->enable_state = bp_shlib_disabled;
 	    /* At this point, we cannot rely on remove_breakpoint
@@ -4422,7 +4428,6 @@ disable_breakpoints_in_unloaded_shlib (s
 	  }
       }
   }
-#endif
 }
 
 /* Try to reenable any breakpoints in shared libraries.  */
@@ -4437,9 +4442,13 @@ re_enable_breakpoints_in_shlibs (void)
       {
 	char buf[1], *lib;
 	
-	/* Do not reenable the breakpoint if the shared library
-	   is still not mapped in.  */
+	/* Do not reenable the breakpoint if the shared library is
+	   still not mapped in.  */
+#ifdef PC_SOLIB
 	lib = PC_SOLIB (b->loc->address);
+#else
+	lib = shlib_for_pc (b->loc->address);
+#endif
 	if (lib != NULL && target_read_memory (b->loc->address, buf, 1) == 0)
 	  b->enable_state = bp_enabled;
       }
@@ -4451,8 +4460,6 @@ re_enable_breakpoints_in_shlibs (void)
   }
 }
 
-#endif
-
 static void
 solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname,
 		     char *cond_string, enum bptype bp_kind)
@@ -7632,9 +7639,7 @@ _initialize_breakpoint (void)
   static struct cmd_list_element *breakpoint_show_cmdlist;
   struct cmd_list_element *c;
 
-#ifdef SOLIB_ADD
   observer_attach_solib_unloaded (disable_breakpoints_in_unloaded_shlib);
-#endif
 
   breakpoint_chain = 0;
   /* Don't bother to call set_breakpoint_count.  $bpnum isn't useful
Index: corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.48
diff -u -p -r1.48 corelow.c
--- corelow.c 1 May 2005 19:58:52 -0000 1.48
+++ corelow.c 2 May 2005 12:30:27 -0000
@@ -46,6 +46,7 @@
 #include "observer.h"
 #include "gdb_assert.h"
 #include "exceptions.h"
+#include "shlib.h"
 
 #ifndef O_BINARY
 #define O_BINARY 0
@@ -73,10 +74,6 @@ struct gdbarch *core_gdbarch = NULL;
 
 static void core_files_info (struct target_ops *);
 
-#ifdef SOLIB_ADD
-static int solib_add_stub (void *);
-#endif
-
 static struct core_fns *sniff_core_bfd (bfd *);
 
 static int gdb_check_format (bfd *);
@@ -212,6 +209,8 @@ core_close (int quitting)
          comments in clear_solib in solib.c. */
 #ifdef CLEAR_SOLIB
       CLEAR_SOLIB ();
+#else
+      shlib_clear ();
 #endif
 
       name = bfd_get_filename (core_bfd);
@@ -237,18 +236,20 @@ core_close_cleanup (void *ignore)
   core_close (0/*ignored*/);
 }
 
-#ifdef SOLIB_ADD
 /* Stub function for catch_errors around shared library hacking.  FROM_TTYP
    is really an int * which points to from_tty.  */
 
 static int
 solib_add_stub (void *from_ttyp)
 {
+#ifdef SOLIB_ADD
   SOLIB_ADD (NULL, *(int *) from_ttyp, &current_target, auto_solib_add);
+#else
+  shlib_rescan (*(int *)from_ttyp, &current_target, auto_solib_add);
+#endif
   re_enable_breakpoints_in_shlibs ();
   return 0;
 }
-#endif /* SOLIB_ADD */
 
 /* Look for sections whose names start with `.reg/' so that we can extract the
    list of threads in a core file.  */
@@ -396,10 +397,7 @@ core_open (char *filename, int from_tty)
       target_fetch_registers (-1);
 
       /* Add symbols and section mappings for any shared libraries.  */
-#ifdef SOLIB_ADD
-      catch_errors (solib_add_stub, &from_tty, (char *) 0,
-		    RETURN_MASK_ALL);
-#endif
+      catch_errors (solib_add_stub, &from_tty, (char *) 0, RETURN_MASK_ALL);
 
       /* Now, set up the frame cache, and print the top of stack.  */
       flush_cached_frames ();
Index: fork-child.c
===================================================================
RCS file: /cvs/src/src/gdb/fork-child.c,v
retrieving revision 1.25
diff -u -p -r1.25 fork-child.c
--- fork-child.c 11 Feb 2005 18:13:49 -0000 1.25
+++ fork-child.c 2 May 2005 12:30:27 -0000
@@ -33,6 +33,7 @@
 #include "terminal.h"
 #include "gdbthread.h"
 #include "command.h" /* for dont_repeat () */
+#include "shlib.h"
 
 #include <signal.h>
 
@@ -404,6 +405,8 @@ fork_inferior (char *exec_file_arg, char
 
 #ifdef SOLIB_CREATE_INFERIOR_HOOK
   SOLIB_CREATE_INFERIOR_HOOK (pid);
+#else
+  shlib_init (inferior_ptid);
 #endif
 }
 
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.136
diff -u -p -r1.136 infcmd.c
--- infcmd.c 8 Mar 2005 22:17:34 -0000 1.136
+++ infcmd.c 2 May 2005 12:30:29 -0000
@@ -44,6 +44,7 @@
 #include "regcache.h"
 #include "reggroups.h"
 #include "block.h"
+#include "shlib.h"
 #include <ctype.h>
 #include "gdb_assert.h"
 
@@ -1805,6 +1806,8 @@ attach_command (char *args, int from_tty
   */
 #ifdef CLEAR_SOLIB
       CLEAR_SOLIB ();
+#else
+      shlib_clear ();
 #endif
 
   target_attach (args, from_tty);
@@ -1864,8 +1867,10 @@ attach_command (char *args, int from_tty
 #ifdef SOLIB_ADD
   /* Add shared library symbols from the newly attached process, if any.  */
   SOLIB_ADD ((char *) 0, from_tty, &current_target, auto_solib_add);
-  re_enable_breakpoints_in_shlibs ();
+#else
+  shlib_rescan (from_tty, &current_target, auto_solib_add);
 #endif
+  re_enable_breakpoints_in_shlibs ();
 
   /* Take any necessary post-attaching actions for this platform.
    */
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.199
diff -u -p -r1.199 infrun.c
--- infrun.c 24 Feb 2005 13:51:32 -0000 1.199
+++ infrun.c 2 May 2005 12:30:31 -0000
@@ -45,6 +45,8 @@
 #include "value.h"
 #include "observer.h"
 #include "language.h"
+#include "shlib.h"
+
 #include "gdb_assert.h"
 
 /* Prototypes for local functions */
@@ -160,10 +162,6 @@ show_debug_infrun (struct ui_file *file,
    signalling an error, which will obscure the change in the
    inferior's state.  */
 
-#ifndef IN_SOLIB_DYNSYM_RESOLVE_CODE
-#define IN_SOLIB_DYNSYM_RESOLVE_CODE(pc) 0
-#endif
-
 /* This function returns TRUE if pc is the address of an instruction
    that lies within the dynamic linker (such as the event hook, or the
    dld itself).
@@ -253,7 +251,6 @@ static struct symbol *step_start_functio
 
 static int trap_expected;
 
-#ifdef SOLIB_ADD
 /* Nonzero if we want to give control to the user when we're notified
    of shared library events by the dynamic linker.  */
 static int stop_on_solib_events;
@@ -264,7 +261,6 @@ show_stop_on_solib_events (struct ui_fil
   fprintf_filtered (file, _("Stopping for shared library events is %s.\n"),
 		    value);
 }
-#endif
 
 /* Nonzero means expecting a trace trap
    and should stop the inferior and return silently when it happens.  */
@@ -448,6 +444,8 @@ follow_exec (int pid, char *execd_pathna
 #endif
 #ifdef SOLIB_CREATE_INFERIOR_HOOK
   SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
+#else
+  shlib_init (inferior_ptid);
 #endif
 
   /* Reinsert all breakpoints.  (Those which were symbolic have
@@ -2133,7 +2131,6 @@ process_event_stop_test:
 
       case BPSTAT_WHAT_CHECK_SHLIBS:
       case BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK:
-#ifdef SOLIB_ADD
 	{
           if (debug_infrun)
 	    fprintf_unfiltered (gdb_stdlog, "infrun: BPSTATE_WHAT_CHECK_SHLIBS\n");
@@ -2164,7 +2161,11 @@ process_event_stop_test:
 	     exec/process stratum, instead relying on the target stack
 	     to propagate relevant changes (stop, section table
 	     changed, ...) up to other layers.  */
+#ifdef SOLIB_ADD
 	  SOLIB_ADD (NULL, 0, &current_target, auto_solib_add);
+#else
+	  shlib_rescan (0, &current_target, auto_solib_add);
+#endif
 	  target_terminal_inferior ();
 
 	  /* Try to reenable shared library breakpoints, additional
@@ -2223,7 +2224,6 @@ process_event_stop_test:
 	      break;
 	    }
 	}
-#endif
 	break;
 
       case BPSTAT_WHAT_LAST:
@@ -2312,7 +2312,12 @@ process_event_stop_test:
      until we exit the run time loader code and reach the callee's
      address.  */
   if (step_over_calls == STEP_OVER_UNDEBUGGABLE
-      && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc))
+#ifdef IN_SOLIB_DYNSYM_RESOLVE_CODE
+      && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc)
+#else
+      && shlib_pc_in_resolver (stop_pc)
+#endif
+      )
     {
       CORE_ADDR pc_after_resolver =
 	gdbarch_skip_solib_resolver (current_gdbarch, stop_pc);
@@ -2396,7 +2401,13 @@ process_event_stop_test:
       if (real_stop_pc != 0)
 	ecs->stop_func_start = real_stop_pc;
 
-      if (IN_SOLIB_DYNSYM_RESOLVE_CODE (ecs->stop_func_start))
+      if (
+#ifdef IN_SOLIB_DYNSYM_RESOLVE_CODE
+	  IN_SOLIB_DYNSYM_RESOLVE_CODE (ecs->stop_func_start)
+#else
+	  shlib_pc_in_resolver (ecs->stop_func_start)
+#endif
+)
 	{
 	  struct symtab_and_line sr_sal;
 	  init_sal (&sr_sal);
@@ -3920,7 +3931,6 @@ When non-zero, inferior specific debuggi
   signal_stop[TARGET_SIGNAL_CANCEL] = 0;
   signal_print[TARGET_SIGNAL_CANCEL] = 0;
 
-#ifdef SOLIB_ADD
   add_setshow_zinteger_cmd ("stop-on-solib-events", class_support,
 			    &stop_on_solib_events, _("\
 Set stopping for shared library events."), _("\
@@ -3931,7 +3941,6 @@ to the user would be loading/unloading o
 			    NULL,
 			    show_stop_on_solib_events,
 			    &setlist, &showlist);
-#endif
 
   add_setshow_enum_cmd ("follow-fork-mode", class_run,
 			follow_fork_mode_kind_names,
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.188
diff -u -p -r1.188 remote.c
--- remote.c 1 May 2005 19:58:54 -0000 1.188
+++ remote.c 2 May 2005 12:30:34 -0000
@@ -42,6 +42,7 @@
 #include "value.h"
 #include "gdb_assert.h"
 #include "observer.h"
+#include "shlib.h"
 
 #include <ctype.h>
 #include <sys/time.h>
@@ -2300,7 +2301,7 @@ remote_open_1 (char *name, int from_tty,
       putpkt ("!");
       getpkt (buf, (rs->remote_packet_size), 0);
     }
-#ifdef SOLIB_CREATE_INFERIOR_HOOK
+
   /* FIXME: need a master target_open vector from which all
      remote_opens can be called, so that stuff like this can
      go there.  Failing that, the following code must be copied
@@ -2310,10 +2311,13 @@ remote_open_1 (char *name, int from_tty,
   /* Set up to detect and load shared libraries.  */
   if (exec_bfd) 	/* No use without an exec file.  */
     {
+#ifdef SOLIB_CREATE_INFERIOR_HOOK
       SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
+#else
+      shlib_init (inferior_ptid);
+#endif
       remote_check_symbols (symfile_objfile);
     }
-#endif
 
   observer_notify_inferior_created (&current_target, from_tty);
 }
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.130
diff -u -p -r1.130 stack.c
--- stack.c 28 Feb 2005 17:00:49 -0000 1.130
+++ stack.c 2 May 2005 12:30:35 -0000
@@ -46,6 +46,7 @@
 #include "exceptions.h"
 #include "reggroups.h"
 #include "regcache.h"
+#include "shlib.h"
 
 /* Prototypes for exported functions. */
 
@@ -686,10 +687,13 @@ print_frame (struct frame_info *fi, 
       annotate_frame_source_end ();
     }
 
-#ifdef PC_SOLIB
   if (!funname || (!sal.symtab || !sal.symtab->filename))
     {
+#ifdef PC_SOLIB
       char *lib = PC_SOLIB (get_frame_pc (fi));
+#else
+      char *lib = shlib_for_pc (get_frame_pc (fi));
+#endif
       if (lib)
 	{
 	  annotate_frame_where ();
@@ -698,7 +702,6 @@ print_frame (struct frame_info *fi, 
 	  ui_out_field_string (uiout, "from", lib);
 	}
     }
-#endif /* PC_SOLIB */
 
   /* do_cleanups will call ui_out_tuple_end() for us.  */
   do_cleanups (list_chain);
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.726
diff -u -p -r1.726 Makefile.in
--- Makefile.in 2 May 2005 12:05:11 -0000 1.726
+++ Makefile.in 2 May 2005 12:30:38 -0000
@@ -545,7 +545,8 @@ SFILES = ada-exp.y ada-lang.c ada-typepr
 	regcache.c reggroups.c remote.c remote-fileio.c \
 	scm-exp.c scm-lang.c scm-valprint.c \
 	sentinel-frame.c \
-	serial.c ser-base.c ser-unix.c source.c \
+	serial.c ser-base.c ser-unix.c \
+	shlib.c solib.c source.c \
 	stabsread.c stack.c std-regs.c symfile.c symfile-mem.c symmisc.c \
 	symtab.c \
 	target.c thread.c top.c tracepoint.c \
@@ -767,6 +768,7 @@ ser_base_h = ser-base.h
 ser_unix_h = ser-unix.h
 shnbsd_tdep_h = shnbsd-tdep.h
 sh_tdep_h = sh-tdep.h
+shlib_h = shlib.h
 sim_regno_h = sim-regno.h
 solib_h = solib.h
 solib_pa64_h = solib-pa64.h
@@ -938,7 +940,8 @@ COMMON_OBS = $(DEPFILES) $(YYOBJ) \
 	cp-namespace.o \
 	reggroups.o regset.o \
 	trad-frame.o \
-	tramp-frame.o
+	tramp-frame.o \
+	shlib.o solib.o
 
 TSOBS = inflow.o
 
@@ -1436,7 +1439,7 @@ ALLDEPFILES = \
 	s390-tdep.c s390-nat.c \
 	ser-go32.c ser-pipe.c ser-tcp.c \
 	sh-tdep.c sh64-tdep.c shnbsd-tdep.c shnbsd-nat.c \
-	solib.c solib-irix.c solib-svr4.c solib-sunos.c \
+	solib-irix.c solib-svr4.c solib-sunos.c \
 	sparc-linux-tdep.c sparc-nat.c sparc-sol2-nat.c sparc-sol2-tdep.c \
 	sparc-tdep.c sparc-sol2-nat.c sparc-sol2-tdep.c sparc64-linux-nat.c \
 	sparc64-linux-tdep.c sparc64-nat.c sparc64-sol2-tdep.c \
@@ -1772,8 +1775,8 @@ breakpoint.o: breakpoint.c $(defs_h) $(s
 	$(command_h) $(inferior_h) $(gdbthread_h) $(target_h) $(language_h) \
 	$(gdb_string_h) $(demangle_h) $(annotate_h) $(symfile_h) \
 	$(objfiles_h) $(source_h) $(linespec_h) $(completer_h) $(gdb_h) \
-	$(ui_out_h) $(cli_script_h) $(gdb_assert_h) $(block_h) $(solist_h) \
-	$(observer_h) $(exceptions_h) $(gdb_events_h)
+	$(ui_out_h) $(cli_script_h) $(gdb_assert_h) $(block_h) $(shlib_h) \
+	$(solist_h) $(observer_h) $(exceptions_h) $(gdb_events_h)
 bsd-kvm.o: bsd-kvm.c $(defs_h) $(cli_cmds_h) $(command_h) $(frame_h) \
 	$(regcache_h) $(target_h) $(value_h) $(gdbcore_h) $(gdb_assert_h) \
 	$(readline_h) $(bsd_kvm_h)
@@ -1821,7 +1824,7 @@ corelow.o: corelow.c $(defs_h) $(arch_ut
 	$(inferior_h) $(symtab_h) $(command_h) $(bfd_h) $(target_h) \
 	$(gdbcore_h) $(gdbthread_h) $(regcache_h) $(regset_h) $(symfile_h) \
 	$(exec_h) $(readline_h) $(observer_h) $(gdb_assert_h) \
-	$(exceptions_h)
+	$(exceptions_h) $(shlib_h)
 core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \
 	$(inferior_h) $(target_h) $(gdb_string_h) $(gregset_h)
 cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \
@@ -1938,7 +1941,7 @@ f-lang.o: f-lang.c $(defs_h) $(gdb_strin
 	$(valprint_h) $(value_h)
 fork-child.o: fork-child.c $(defs_h) $(gdb_string_h) $(frame_h) \
 	$(inferior_h) $(target_h) $(gdb_wait_h) $(gdb_vfork_h) $(gdbcore_h) \
-	$(terminal_h) $(gdbthread_h) $(command_h)
+	$(terminal_h) $(gdbthread_h) $(command_h) $(shlib_h)
 frame-base.o: frame-base.c $(defs_h) $(frame_base_h) $(frame_h) \
 	$(gdb_obstack_h)
 frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \
@@ -2108,7 +2111,7 @@ infcmd.o: infcmd.c $(defs_h) $(gdb_strin
 	$(symfile_h) $(gdbcore_h) $(target_h) $(language_h) $(symfile_h) \
 	$(objfiles_h) $(completer_h) $(ui_out_h) $(event_top_h) \
 	$(parser_defs_h) $(regcache_h) $(reggroups_h) $(block_h) \
-	$(gdb_assert_h)
+	$(shlib_h) $(gdb_assert_h)
 inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \
 	$(event_top_h) $(inf_loop_h) $(remote_h) $(exceptions_h)
 inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \
@@ -2124,7 +2127,7 @@ infrun.o: infrun.c $(defs_h) $(gdb_strin
 	$(inferior_h) $(exceptions_h) $(breakpoint_h) $(gdb_wait_h) \
 	$(gdbcore_h) $(gdbcmd_h) $(cli_script_h) $(target_h) $(gdbthread_h) \
 	$(annotate_h) $(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) \
-	$(value_h) $(observer_h) $(language_h) $(gdb_assert_h)
+	$(value_h) $(observer_h) $(language_h) $(shlib_h) $(gdb_assert_h)
 inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
 	$(gdbcore_h) $(command_h) $(gdb_stat_h) $(observer_h) $(gdb_wait_h) \
 	$(inflow_h)
@@ -2410,7 +2413,7 @@ remote.o: remote.c $(defs_h) $(gdb_strin
 	$(symfile_h) $(exceptions_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \
 	$(gdb_stabs_h) $(gdbthread_h) $(remote_h) $(regcache_h) $(value_h) \
 	$(gdb_assert_h) $(event_loop_h) $(event_top_h) $(inf_loop_h) \
-	$(serial_h) $(gdbcore_h) $(remote_fileio_h) $(observer_h)
+	$(serial_h) $(gdbcore_h) $(remote_fileio_h) $(shlib_h) $(observer_h)
 remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) $(gdbarch_h) \
 	$(inferior_h) $(target_h) $(value_h) $(command_h) $(gdb_string_h) \
 	$(exceptions_h) $(gdbcmd_h) $(serial_h) $(remote_utils_h) \
@@ -2514,6 +2517,7 @@ sh-tdep.o: sh-tdep.c $(defs_h) $(frame_h
 	$(gdb_assert_h) $(arch_utils_h) $(floatformat_h) $(regcache_h) \
 	$(doublest_h) $(osabi_h) $(sh_tdep_h) $(elf_bfd_h) $(solib_svr4_h) \
 	$(elf_sh_h) $(gdb_sim_sh_h)
+shlib.o: shlib.c $(defs_h) $(shlib_h) $(solib_h)
 solib-aix5.o: solib-aix5.c $(defs_h) $(gdb_string_h) $(elf_external_h) \
 	$(symtab_h) $(bfd_h) $(symfile_h) $(objfiles_h) $(gdbcore_h) \
 	$(command_h) $(target_h) $(frame_h) $(gdb_regex_h) $(inferior_h) \
@@ -2625,7 +2629,7 @@ stack.o: stack.c $(defs_h) $(gdb_string_
 	$(gdbcore_h) $(target_h) $(source_h) $(breakpoint_h) $(demangle_h) \
 	$(inferior_h) $(annotate_h) $(ui_out_h) $(block_h) $(stack_h) \
 	$(gdb_assert_h) $(dictionary_h) $(exceptions_h) $(reggroups_h) \
-	$(regcache_h)
+	$(regcache_h) $(shlib_h)
 std-regs.o: std-regs.c $(defs_h) $(user_regs_h) $(frame_h) $(gdbtypes_h) \
 	$(value_h) $(gdb_string_h)
 stop-gdb.o: stop-gdb.c $(defs_h)


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

* Re: [RFC] Unconditionally include shared library code
  2005-05-02 12:53 [RFC] Unconditionally include shared library code Mark Kettenis
@ 2005-05-08 13:15 ` Mark Kettenis
  2005-05-08 13:59   ` Daniel Jacobowitz
  0 siblings, 1 reply; 12+ messages in thread
From: Mark Kettenis @ 2005-05-08 13:15 UTC (permalink / raw)
  To: mark.kettenis; +Cc: gdb-patches

   Date: Mon, 2 May 2005 14:51:59 +0200 (CEST)
   From: Mark Kettenis <mark.kettenis@xs4all.nl>

   This patch is an attempt to be able to link in the generic shared
   library code in solib.c while attempting to keep the shared library
   implementations that have not yet been converted to use the generic
   code (Windows, coff) working.  It allows me to get rid of
   DEPRECATED_TM_FILE in basically every *BSD target.

   I introduce two new files shlib.c, shlib.h.  I need these because
   solib.h contains both the prototypes and macro defenitions for the
   shared library stuff.  In the long run, I should be able to get rid of
   either shlib.[ch] or solib.[ch] again.  I took the opportunity to give
   various functions a somewhat more logical name.

   Comments are welcome.  It'd also be great if this could be tested on
   Cygwin.

Hmm, no comments yet.  If this is really so uncontroversial, I'm going
to check it in next weekend ;-).

Mark


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

* Re: [RFC] Unconditionally include shared library code
  2005-05-08 13:15 ` Mark Kettenis
@ 2005-05-08 13:59   ` Daniel Jacobowitz
  2005-05-08 14:24     ` Daniel Jacobowitz
  2005-05-08 14:40     ` Mark Kettenis
  0 siblings, 2 replies; 12+ messages in thread
From: Daniel Jacobowitz @ 2005-05-08 13:59 UTC (permalink / raw)
  To: gdb-patches, gdb-patches

On Sun, May 08, 2005 at 03:15:08PM +0200, Mark Kettenis wrote:
>    Date: Mon, 2 May 2005 14:51:59 +0200 (CEST)
>    From: Mark Kettenis <mark.kettenis@xs4all.nl>
> 
>    This patch is an attempt to be able to link in the generic shared
>    library code in solib.c while attempting to keep the shared library
>    implementations that have not yet been converted to use the generic
>    code (Windows, coff) working.  It allows me to get rid of
>    DEPRECATED_TM_FILE in basically every *BSD target.
> 
>    I introduce two new files shlib.c, shlib.h.  I need these because
>    solib.h contains both the prototypes and macro defenitions for the
>    shared library stuff.  In the long run, I should be able to get rid of
>    either shlib.[ch] or solib.[ch] again.  I took the opportunity to give
>    various functions a somewhat more logical name.
> 
>    Comments are welcome.  It'd also be great if this could be tested on
>    Cygwin.
> 
> Hmm, no comments yet.  If this is really so uncontroversial, I'm going
> to check it in next weekend ;-).

My only comment is that I really don't like having both shlib* and
solib* (files and interface names).  Could you explain a little more
why shlib.h is necessary?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: [RFC] Unconditionally include shared library code
  2005-05-08 13:59   ` Daniel Jacobowitz
@ 2005-05-08 14:24     ` Daniel Jacobowitz
  2005-05-08 14:40     ` Mark Kettenis
  1 sibling, 0 replies; 12+ messages in thread
From: Daniel Jacobowitz @ 2005-05-08 14:24 UTC (permalink / raw)
  To: gdb-patches, gdb-patches

On Sun, May 08, 2005 at 03:15:08PM +0200, Mark Kettenis wrote:
>    Date: Mon, 2 May 2005 14:51:59 +0200 (CEST)
>    From: Mark Kettenis <mark.kettenis@xs4all.nl>
> 
>    This patch is an attempt to be able to link in the generic shared
>    library code in solib.c while attempting to keep the shared library
>    implementations that have not yet been converted to use the generic
>    code (Windows, coff) working.  It allows me to get rid of
>    DEPRECATED_TM_FILE in basically every *BSD target.
> 
>    I introduce two new files shlib.c, shlib.h.  I need these because
>    solib.h contains both the prototypes and macro defenitions for the
>    shared library stuff.  In the long run, I should be able to get rid of
>    either shlib.[ch] or solib.[ch] again.  I took the opportunity to give
>    various functions a somewhat more logical name.
> 
>    Comments are welcome.  It'd also be great if this could be tested on
>    Cygwin.
> 
> Hmm, no comments yet.  If this is really so uncontroversial, I'm going
> to check it in next weekend ;-).

My only comment is that I really don't like having both shlib* and
solib* (files and interface names).  Could you explain a little more
why shlib.h is necessary?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: [RFC] Unconditionally include shared library code
  2005-05-08 13:59   ` Daniel Jacobowitz
  2005-05-08 14:24     ` Daniel Jacobowitz
@ 2005-05-08 14:40     ` Mark Kettenis
  2005-05-08 14:48       ` Daniel Jacobowitz
  1 sibling, 1 reply; 12+ messages in thread
From: Mark Kettenis @ 2005-05-08 14:40 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

   Date: Sun, 8 May 2005 09:58:40 -0400
   From: Daniel Jacobowitz <drow@false.org>

   On Sun, May 08, 2005 at 03:15:08PM +0200, Mark Kettenis wrote:
   >    Date: Mon, 2 May 2005 14:51:59 +0200 (CEST)
   >    From: Mark Kettenis <mark.kettenis@xs4all.nl>
   > 
   >    This patch is an attempt to be able to link in the generic shared
   >    library code in solib.c while attempting to keep the shared library
   >    implementations that have not yet been converted to use the generic
   >    code (Windows, coff) working.  It allows me to get rid of
   >    DEPRECATED_TM_FILE in basically every *BSD target.
   > 
   >    I introduce two new files shlib.c, shlib.h.  I need these because
   >    solib.h contains both the prototypes and macro defenitions for the
   >    shared library stuff.  In the long run, I should be able to get rid of
   >    either shlib.[ch] or solib.[ch] again.  I took the opportunity to give
   >    various functions a somewhat more logical name.
   > 
   >    Comments are welcome.  It'd also be great if this could be tested on
   >    Cygwin.
   > 
   > Hmm, no comments yet.  If this is really so uncontroversial, I'm going
   > to check it in next weekend ;-).

   My only comment is that I really don't like having both shlib* and
   solib* (files and interface names).  Could you explain a little more
   why shlib.h is necessary?

Me neither.  The usage is very inconsistent within GDB, using both
shlib and solib in interface dealing with shared libraries.  I'd
certainly be in favor on us standardizing on one of the two (and I've
got a slight preference to use shlib).  It would be great if we could
reach agreement on a consistent naming convention That would make for
an afwul lot of obvious patches.

But the problem I'm addressing here is solib.h.  It contains both the
prototypes for the functions in solib.c and the #defines for the hooks
that make core GDB use those functions.  Since the goal of my patch is
to get away from using those #defines, I can't simply #include solib.h
in the core GDB source files, unless I do a massive conversion of all
targets using solib.h.  That, I think is rather dangerous.  I'd rather
convert them one-by one, after I've verified that indeed they work
using the new mechanism.

My goal is certainly to get rid of either solib.[ch] or shlib.[ch]
once the conversion is done.

Mark


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

* Re: [RFC] Unconditionally include shared library code
  2005-05-08 14:40     ` Mark Kettenis
@ 2005-05-08 14:48       ` Daniel Jacobowitz
  2005-05-08 17:32         ` Mark Kettenis
  0 siblings, 1 reply; 12+ messages in thread
From: Daniel Jacobowitz @ 2005-05-08 14:48 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Sun, May 08, 2005 at 04:21:50PM +0200, Mark Kettenis wrote:
> Me neither.  The usage is very inconsistent within GDB, using both
> shlib and solib in interface dealing with shared libraries.  I'd
> certainly be in favor on us standardizing on one of the two (and I've
> got a slight preference to use shlib).  It would be great if we could
> reach agreement on a consistent naming convention That would make for
> an afwul lot of obvious patches.

I have a slight preference to solib, since that's what the machinery
currently uses.

> But the problem I'm addressing here is solib.h.  It contains both the
> prototypes for the functions in solib.c and the #defines for the hooks
> that make core GDB use those functions.  Since the goal of my patch is
> to get away from using those #defines, I can't simply #include solib.h
> in the core GDB source files, unless I do a massive conversion of all
> targets using solib.h.  That, I think is rather dangerous.  I'd rather
> convert them one-by one, after I've verified that indeed they work
> using the new mechanism.

What bugs me about it is that it's not clear which one is going away.
Would this alternative work for you?  Create a new file, solib-macros.h,
and move the macros from solib.h there.  Have any targets which
currently include solib.h via their TM_FILE include solib-macros.h
instead, which is a nice mechanical update.
 
-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: [RFC] Unconditionally include shared library code
  2005-05-08 17:32         ` Mark Kettenis
@ 2005-05-08 15:33           ` Daniel Jacobowitz
  2005-05-08 22:01             ` Mark Kettenis
  0 siblings, 1 reply; 12+ messages in thread
From: Daniel Jacobowitz @ 2005-05-08 15:33 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Sun, May 08, 2005 at 04:51:25PM +0200, Mark Kettenis wrote:
> Hmm, that'd work.  We'll have to face the inconsistent interface issue
> eventually, but it's a seperate issue indeed.  Any objection if I
> introduce a config/tm-solib.h and use that?  Its purpose is a bit more
> clear, and the risk of abuse is smaller.  The mechanical update is not
> without risk, but I'm willing to take it.  Deal?

I like it.  It is indeed a tm file and shouldn't be used any other way.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: [RFC] Unconditionally include shared library code
  2005-05-08 14:48       ` Daniel Jacobowitz
@ 2005-05-08 17:32         ` Mark Kettenis
  2005-05-08 15:33           ` Daniel Jacobowitz
  0 siblings, 1 reply; 12+ messages in thread
From: Mark Kettenis @ 2005-05-08 17:32 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

   Date: Sun, 8 May 2005 10:40:20 -0400
   From: Daniel Jacobowitz <drow@false.org>

   > But the problem I'm addressing here is solib.h.  It contains both the
   > prototypes for the functions in solib.c and the #defines for the hooks
   > that make core GDB use those functions.  Since the goal of my patch is
   > to get away from using those #defines, I can't simply #include solib.h
   > in the core GDB source files, unless I do a massive conversion of all
   > targets using solib.h.  That, I think is rather dangerous.  I'd rather
   > convert them one-by one, after I've verified that indeed they work
   > using the new mechanism.

   What bugs me about it is that it's not clear which one is going away.
   Would this alternative work for you?  Create a new file, solib-macros.h,
   and move the macros from solib.h there.  Have any targets which
   currently include solib.h via their TM_FILE include solib-macros.h
   instead, which is a nice mechanical update.

Hmm, that'd work.  We'll have to face the inconsistent interface issue
eventually, but it's a seperate issue indeed.  Any objection if I
introduce a config/tm-solib.h and use that?  Its purpose is a bit more
clear, and the risk of abuse is smaller.  The mechanical update is not
without risk, but I'm willing to take it.  Deal?

Mark


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

* Re: [RFC] Unconditionally include shared library code
  2005-05-08 15:33           ` Daniel Jacobowitz
@ 2005-05-08 22:01             ` Mark Kettenis
  2005-05-08 22:08               ` Daniel Jacobowitz
  0 siblings, 1 reply; 12+ messages in thread
From: Mark Kettenis @ 2005-05-08 22:01 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

ar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2])
	by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id j48LkCpZ015976;
	Sun, 8 May 2005 23:46:12 +0200 (CEST)
Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1])
	by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id j48LkCXv027024;
	Sun, 8 May 2005 23:46:12 +0200 (CEST)
Received: (from kettenis@localhost)
	by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id j48Lk8TZ022794;
	Sun, 8 May 2005 23:46:08 +0200 (CEST)
Date: Sun, 8 May 2005 23:46:08 +0200 (CEST)
Message-Id: <200505082146.j48Lk8TZ022794@elgar.sibelius.xs4all.nl>
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: drow@false.org
CC: gdb-patches@sources.redhat.com
In-reply-to: <20050508145627.GA9122@nevyn.them.org> (message from Daniel
	Jacobowitz on Sun, 8 May 2005 10:56:27 -0400)
Subject: Re: [RFC] Unconditionally include shared library code
References: <200505021251.j42CpxIZ010109@elgar.sibelius.xs4all.nl> <200505081315.j48DF8AG030440@elgar.sibelius.xs4all.nl> <20050508135839.GA7384@nevyn.them.org> <200505081421.j48ELoGI020668@elgar.sibelius.xs4all.nl> <20050508144020.GA8650@nevyn.them.org> <200505081451.j48EpPTO013691@elgar.sibelius.xs4all.nl> <20050508145627.GA9122@nevyn.them.org>

   Date: Sun, 8 May 2005 10:56:27 -0400
   From: Daniel Jacobowitz <drow@false.org>

   On Sun, May 08, 2005 at 04:51:25PM +0200, Mark Kettenis wrote:
   > Hmm, that'd work.  We'll have to face the inconsistent interface issue
   > eventually, but it's a seperate issue indeed.  Any objection if I
   > introduce a config/tm-solib.h and use that?  Its purpose is a bit more
   > clear, and the risk of abuse is smaller.  The mechanical update is not
   > without risk, but I'm willing to take it.  Deal?

   I like it.  It is indeed a tm file and shouldn't be used any other way.

I reworked the patch to avoid shlib.[ch].  Looking at the changes I
think the risk of changing solib.h into tm-solib.h under config/ is
riskier than leaving config/ alone and simply removing the #defines
from solib.h.  I'm moving towards checking in the attached patch at
the end of the coming week.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* solib.h (CLEAR_SOLIB, SOLIB_ADD)
	(SOLIB_CREATE_INFERIOR_HOOK, SOLIB_REMOVE_INFERIOR_HOOK)
	(SOLIB_IN_DYNAMIC_LINKER, SOLIB_RESTART)
	(DISABLE_UNSETTABLE_BREAK, PC_SOLIB)
	(IN_SOLIB_DYNSYM_RESOLVE_CODE): Remove defines and orphaned
	comments.
	* breakpoint.c: Include "solib.h".
	(insert_bp_location) [!DISABLE_UNSETTABLE_BREAK]: Call
	solib_address.
	(remove_solib_event_breakpoints, create_solib_event_breakpoint)
	(disable_breakpoints_in_shlibs)
	(disable_breakpoints_in_unloaded_shlib)
	(re_enable_breakpoints_in_shlibs): Compile if SOLIB_ADD isn't
	defined. If PC_SOLIB isn't defined, call solib_address.
	(_initialize_breakpoint): Unconditionally install observer.
	* corelow.c: Include "solib.h".
	[SOLIB_ADD] (solib_add_stub): Remove prototype.
	(core_close) [!CLEAR_SOLIB]: Call clear_solib.
	(solib_add_stub) [!SOLIB_ADD] Call solib_add.
	(core_open): Unconditionally call solib_add_stub.
	* fork-child.c: Include "solib.h".
	(fork_inferior) [!SOLIB_CREATE_INFERIOR_HOOK]: Call
	solib_create_inferior_hook.
	* infcmd.c: Include "solib.h".
	(attach_command) [!SOLIB_ADD]: Call shlib_rescan.  Unconditionally
	call re_enable_breakpoints_in_shlibs.
	* infrun.c: Include "solib.h".
	(SOLIB_IN_SYNSYM_RESOLVE_CODE): Don't define if not already
	defined.
	(stop_on_solib_events, show_stop_on_solib_events): Include
	unconditionally.
	(follow_exec) [!SOLIB_CREATE_INFERIOR_HOOK]: Call
	solib_create_inferior_hook.
	(handle_inferior_event) [!SOLIB_ADD]: Call shlib_add.
	[!IN_SOLIB_DYNSYM_RESOLVE_CODE]: Call in_solib_dynsym_resolve_code.
	(_initialize_infrun): Unconditionally add "stop_on_solib-events"
	command.
	* remote.c: Include "solib.h".
	(remote_open_1): Unconditionally call no_shared_libraries.
	[!SOLIB_CREATE_INFERIOR_HOOK] Call solib_create_inferior_hook.
	* stack.c: Include "solib.h".
	(print_frame) [!PC_SOLIB] Call shlib_for_pc.
	* xcoffsolib.c (no_shared_libraries): Remove function.
	* Makefile.in (SFILES): Add solib.c.
	(ALLDEPFILES): Remove solib.c.
	(COMMON_OBS): Add solib.o.
	(breakpoint.o, corelow.o, fork-chiled.o, infcmd.o, infrun.o)
	(remote.o, stack.o): Update dependencies.

Index: solib.h
===================================================================
RCS file: /cvs/src/src/gdb/solib.h,v
retrieving revision 1.14
diff -u -p -r1.14 solib.h
--- solib.h 14 Jan 2005 02:04:02 -0000 1.14
+++ solib.h 8 May 2005 21:38:11 -0000
@@ -30,15 +30,10 @@ struct target_ops;
 /* Called when we free all symtabs, to free the shared library information
    as well. */
 
-#define CLEAR_SOLIB			clear_solib
-
 extern void clear_solib (void);
 
 /* Called to add symbols from a shared library to gdb's symbol table. */
 
-#define SOLIB_ADD(filename, from_tty, targ, readsyms) \
-    solib_add (filename, from_tty, targ, readsyms)
-
 extern void solib_add (char *, int, struct target_ops *, int);
 extern int solib_read_symbols (struct so_list *, int);
 
@@ -47,64 +42,16 @@ extern int solib_read_symbols (struct so
    addresses to which they are linked, and sufficient information to
    read in their symbols at a later time.  */
 
-#define SOLIB_CREATE_INFERIOR_HOOK(PID)	solib_create_inferior_hook ()
-
-/* Function to be called to remove the connection between debugger and
-   dynamic linker that was established by SOLIB_CREATE_INFERIOR_HOOK.
-   (This operation does not remove shared library information from
-   the debugger, as CLEAR_SOLIB does.)
-
-   This functionality is presently not implemented for this target.
- */
-#define SOLIB_REMOVE_INFERIOR_HOOK(PID) (0)
-
-extern void solib_create_inferior_hook (void);	/* solib.c */
-
-/* This function returns TRUE if pc is the address of an instruction that
-   lies within the dynamic linker (such as the event hook, or the dld
-   itself).
-
-   This function must be used only when a dynamic linker event has been
-   caught, and the inferior is being stepped out of the hook, or undefined
-   results are guaranteed.
-
-   Presently, this functionality is not implemented.
- */
-
-/*
-   #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
-   error("catch of library loads/unloads not yet implemented on this platform")
- */
-
-#define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
-(0)
-
-/* This function must be called when the inferior is killed, and the program
-   restarted.  This is not the same as CLEAR_SOLIB, in that it doesn't discard
-   any symbol tables.
-
-   Presently, this functionality is not implemented.
- */
-#define SOLIB_RESTART() \
-  (0)
-
-/* If we can't set a breakpoint, and it's in a shared library, just
-   disable it.  */
-
-#define DISABLE_UNSETTABLE_BREAK(addr)	(solib_address(addr) != NULL)
-
-extern char *solib_address (CORE_ADDR);	/* solib.c */
+extern void solib_create_inferior_hook (void);
 
 /* If ADDR lies in a shared library, return its name.  */
 
-#define PC_SOLIB(addr)	solib_address (addr)
+extern char *solib_address (CORE_ADDR);
 
 /* Return 1 if PC lies in the dynamic symbol resolution code of the
    run time loader.  */
 
-#define IN_SOLIB_DYNSYM_RESOLVE_CODE(pc) in_solib_dynsym_resolve_code (pc)
-
-extern int in_solib_dynsym_resolve_code (CORE_ADDR);	/* solib.c */
+extern int in_solib_dynsym_resolve_code (CORE_ADDR);
 
 /* Discard symbols that were auto-loaded from shared libraries. */
 
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.213
diff -u -p -r1.213 breakpoint.c
--- breakpoint.c 26 Apr 2005 05:03:35 -0000 1.213
+++ breakpoint.c 8 May 2005 21:38:16 -0000
@@ -49,6 +49,7 @@
 #include "cli/cli-script.h"
 #include "gdb_assert.h"
 #include "block.h"
+#include "solib.h"
 #include "solist.h"
 #include "observer.h"
 #include "exceptions.h"
@@ -853,8 +854,13 @@ insert_bp_location (struct bp_location *
       if (val)
 	{
 	  /* Can't set the breakpoint.  */
+	  if (
 #if defined (DISABLE_UNSETTABLE_BREAK)
-	  if (DISABLE_UNSETTABLE_BREAK (bpt->address))
+	      DISABLE_UNSETTABLE_BREAK (bpt->address)
+#else
+	      solib_address (bpt->address)
+#endif
+	      )
 	    {
 	      /* See also: disable_breakpoints_in_shlibs. */
 	      val = 0;
@@ -872,7 +878,6 @@ insert_bp_location (struct bp_location *
 				  "breakpoint #%d\n", bpt->owner->number);
 	    }
 	  else
-#endif
 	    {
 #ifdef ONE_PROCESS_WRITETEXT
 	      *process_warning = 1;
@@ -4330,7 +4335,6 @@ resolve_pending_breakpoint (struct break
   return rc;
 }
 
-#ifdef SOLIB_ADD
 void
 remove_solib_event_breakpoints (void)
 {
@@ -4362,12 +4366,14 @@ disable_breakpoints_in_shlibs (int silen
   /* See also: insert_breakpoints, under DISABLE_UNSETTABLE_BREAK. */
   ALL_BREAKPOINTS (b)
   {
-#if defined (PC_SOLIB)
-    if (((b->type == bp_breakpoint) ||
-	 (b->type == bp_hardware_breakpoint)) &&
-	breakpoint_enabled (b) &&
-	!b->loc->duplicate &&
-	PC_SOLIB (b->loc->address))
+    if (((b->type == bp_breakpoint) || (b->type == bp_hardware_breakpoint))
+	&& breakpoint_enabled (b) && !b->loc->duplicate
+#ifdef PC_SOLIB
+	&& PC_SOLIB (b->loc->address)
+#else
+	&& solib_address (b->loc->address)
+#endif
+	)
       {
 	b->enable_state = bp_shlib_disabled;
 	if (!silent)
@@ -4381,7 +4387,6 @@ disable_breakpoints_in_shlibs (int silen
 	    warning (_("breakpoint #%d "), b->number);
 	  }
       }
-#endif
   }
 }
 
@@ -4394,18 +4399,19 @@ disable_breakpoints_in_unloaded_shlib (s
   struct breakpoint *b;
   int disabled_shlib_breaks = 0;
 
-#if defined (PC_SOLIB)
   /* See also: insert_breakpoints, under DISABLE_UNSETTABLE_BREAK.  */
   ALL_BREAKPOINTS (b)
   {
     if ((b->loc->loc_type == bp_loc_hardware_breakpoint
 	|| b->loc->loc_type == bp_loc_software_breakpoint)
-	&& breakpoint_enabled (b) 
-	&& !b->loc->duplicate)
+	&& breakpoint_enabled (b) && !b->loc->duplicate)
       {
+#ifdef PC_SOLIB
 	char *so_name = PC_SOLIB (b->loc->address);
-	if (so_name 
-	    && !strcmp (so_name, solib->so_name))
+#else
+	char *so_name = solib_address (b->loc->address);
+#endif
+	if (so_name && !strcmp (so_name, solib->so_name))
           {
 	    b->enable_state = bp_shlib_disabled;
 	    /* At this point, we cannot rely on remove_breakpoint
@@ -4422,7 +4428,6 @@ disable_breakpoints_in_unloaded_shlib (s
 	  }
       }
   }
-#endif
 }
 
 /* Try to reenable any breakpoints in shared libraries.  */
@@ -4437,9 +4442,13 @@ re_enable_breakpoints_in_shlibs (void)
       {
 	char buf[1], *lib;
 	
-	/* Do not reenable the breakpoint if the shared library
-	   is still not mapped in.  */
+	/* Do not reenable the breakpoint if the shared library is
+	   still not mapped in.  */
+#ifdef PC_SOLIB
 	lib = PC_SOLIB (b->loc->address);
+#else
+	lib = solib_address (b->loc->address);
+#endif
 	if (lib != NULL && target_read_memory (b->loc->address, buf, 1) == 0)
 	  b->enable_state = bp_enabled;
       }
@@ -4451,8 +4460,6 @@ re_enable_breakpoints_in_shlibs (void)
   }
 }
 
-#endif
-
 static void
 solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname,
 		     char *cond_string, enum bptype bp_kind)
@@ -7632,9 +7639,7 @@ _initialize_breakpoint (void)
   static struct cmd_list_element *breakpoint_show_cmdlist;
   struct cmd_list_element *c;
 
-#ifdef SOLIB_ADD
   observer_attach_solib_unloaded (disable_breakpoints_in_unloaded_shlib);
-#endif
 
   breakpoint_chain = 0;
   /* Don't bother to call set_breakpoint_count.  $bpnum isn't useful
Index: corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.48
diff -u -p -r1.48 corelow.c
--- corelow.c 1 May 2005 19:58:52 -0000 1.48
+++ corelow.c 8 May 2005 21:38:16 -0000
@@ -46,6 +46,7 @@
 #include "observer.h"
 #include "gdb_assert.h"
 #include "exceptions.h"
+#include "solib.h"
 
 #ifndef O_BINARY
 #define O_BINARY 0
@@ -73,10 +74,6 @@ struct gdbarch *core_gdbarch = NULL;
 
 static void core_files_info (struct target_ops *);
 
-#ifdef SOLIB_ADD
-static int solib_add_stub (void *);
-#endif
-
 static struct core_fns *sniff_core_bfd (bfd *);
 
 static int gdb_check_format (bfd *);
@@ -212,6 +209,8 @@ core_close (int quitting)
          comments in clear_solib in solib.c. */
 #ifdef CLEAR_SOLIB
       CLEAR_SOLIB ();
+#else
+      clear_solib ();
 #endif
 
       name = bfd_get_filename (core_bfd);
@@ -237,18 +236,20 @@ core_close_cleanup (void *ignore)
   core_close (0/*ignored*/);
 }
 
-#ifdef SOLIB_ADD
 /* Stub function for catch_errors around shared library hacking.  FROM_TTYP
    is really an int * which points to from_tty.  */
 
 static int
 solib_add_stub (void *from_ttyp)
 {
+#ifdef SOLIB_ADD
   SOLIB_ADD (NULL, *(int *) from_ttyp, &current_target, auto_solib_add);
+#else
+  solib_add (NULL, *(int *)from_ttyp, &current_target, auto_solib_add);
+#endif
   re_enable_breakpoints_in_shlibs ();
   return 0;
 }
-#endif /* SOLIB_ADD */
 
 /* Look for sections whose names start with `.reg/' so that we can extract the
    list of threads in a core file.  */
@@ -396,10 +397,7 @@ core_open (char *filename, int from_tty)
       target_fetch_registers (-1);
 
       /* Add symbols and section mappings for any shared libraries.  */
-#ifdef SOLIB_ADD
-      catch_errors (solib_add_stub, &from_tty, (char *) 0,
-		    RETURN_MASK_ALL);
-#endif
+      catch_errors (solib_add_stub, &from_tty, (char *) 0, RETURN_MASK_ALL);
 
       /* Now, set up the frame cache, and print the top of stack.  */
       flush_cached_frames ();
Index: fork-child.c
===================================================================
RCS file: /cvs/src/src/gdb/fork-child.c,v
retrieving revision 1.25
diff -u -p -r1.25 fork-child.c
--- fork-child.c 11 Feb 2005 18:13:49 -0000 1.25
+++ fork-child.c 8 May 2005 21:38:16 -0000
@@ -33,6 +33,7 @@
 #include "terminal.h"
 #include "gdbthread.h"
 #include "command.h" /* for dont_repeat () */
+#include "solib.h"
 
 #include <signal.h>
 
@@ -404,6 +405,8 @@ fork_inferior (char *exec_file_arg, char
 
 #ifdef SOLIB_CREATE_INFERIOR_HOOK
   SOLIB_CREATE_INFERIOR_HOOK (pid);
+#else
+  solib_create_inferior_hook ();
 #endif
 }
 
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.136
diff -u -p -r1.136 infcmd.c
--- infcmd.c 8 Mar 2005 22:17:34 -0000 1.136
+++ infcmd.c 8 May 2005 21:38:17 -0000
@@ -44,6 +44,7 @@
 #include "regcache.h"
 #include "reggroups.h"
 #include "block.h"
+#include "solib.h"
 #include <ctype.h>
 #include "gdb_assert.h"
 
@@ -1805,6 +1806,8 @@ attach_command (char *args, int from_tty
   */
 #ifdef CLEAR_SOLIB
       CLEAR_SOLIB ();
+#else
+      clear_solib ();
 #endif
 
   target_attach (args, from_tty);
@@ -1864,8 +1867,10 @@ attach_command (char *args, int from_tty
 #ifdef SOLIB_ADD
   /* Add shared library symbols from the newly attached process, if any.  */
   SOLIB_ADD ((char *) 0, from_tty, &current_target, auto_solib_add);
-  re_enable_breakpoints_in_shlibs ();
+#else
+  solib_add (NULL, from_tty, &current_target, auto_solib_add);
 #endif
+  re_enable_breakpoints_in_shlibs ();
 
   /* Take any necessary post-attaching actions for this platform.
    */
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.200
diff -u -p -r1.200 infrun.c
--- infrun.c 2 May 2005 23:56:36 -0000 1.200
+++ infrun.c 8 May 2005 21:38:20 -0000
@@ -45,6 +45,8 @@
 #include "value.h"
 #include "observer.h"
 #include "language.h"
+#include "solib.h"
+
 #include "gdb_assert.h"
 
 /* Prototypes for local functions */
@@ -160,10 +162,6 @@ show_debug_infrun (struct ui_file *file,
    signalling an error, which will obscure the change in the
    inferior's state.  */
 
-#ifndef IN_SOLIB_DYNSYM_RESOLVE_CODE
-#define IN_SOLIB_DYNSYM_RESOLVE_CODE(pc) 0
-#endif
-
 /* This function returns TRUE if pc is the address of an instruction
    that lies within the dynamic linker (such as the event hook, or the
    dld itself).
@@ -253,7 +251,6 @@ static struct symbol *step_start_functio
 
 static int trap_expected;
 
-#ifdef SOLIB_ADD
 /* Nonzero if we want to give control to the user when we're notified
    of shared library events by the dynamic linker.  */
 static int stop_on_solib_events;
@@ -264,7 +261,6 @@ show_stop_on_solib_events (struct ui_fil
   fprintf_filtered (file, _("Stopping for shared library events is %s.\n"),
 		    value);
 }
-#endif
 
 /* Nonzero means expecting a trace trap
    and should stop the inferior and return silently when it happens.  */
@@ -448,6 +444,8 @@ follow_exec (int pid, char *execd_pathna
 #endif
 #ifdef SOLIB_CREATE_INFERIOR_HOOK
   SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
+#else
+  solib_create_inferior_hook ();
 #endif
 
   /* Reinsert all breakpoints.  (Those which were symbolic have
@@ -2132,7 +2130,6 @@ process_event_stop_test:
 
       case BPSTAT_WHAT_CHECK_SHLIBS:
       case BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK:
-#ifdef SOLIB_ADD
 	{
           if (debug_infrun)
 	    fprintf_unfiltered (gdb_stdlog, "infrun: BPSTATE_WHAT_CHECK_SHLIBS\n");
@@ -2163,7 +2160,11 @@ process_event_stop_test:
 	     exec/process stratum, instead relying on the target stack
 	     to propagate relevant changes (stop, section table
 	     changed, ...) up to other layers.  */
+#ifdef SOLIB_ADD
 	  SOLIB_ADD (NULL, 0, &current_target, auto_solib_add);
+#else
+	  solib_add (NULL, 0, &current_target, auto_solib_add);
+#endif
 	  target_terminal_inferior ();
 
 	  /* Try to reenable shared library breakpoints, additional
@@ -2222,7 +2223,6 @@ process_event_stop_test:
 	      break;
 	    }
 	}
-#endif
 	break;
 
       case BPSTAT_WHAT_LAST:
@@ -2311,7 +2311,12 @@ process_event_stop_test:
      until we exit the run time loader code and reach the callee's
      address.  */
   if (step_over_calls == STEP_OVER_UNDEBUGGABLE
-      && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc))
+#ifdef IN_SOLIB_DYNSYM_RESOLVE_CODE
+      && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc)
+#else
+      && in_solib_dynsym_resolve_code (stop_pc)
+#endif
+      )
     {
       CORE_ADDR pc_after_resolver =
 	gdbarch_skip_solib_resolver (current_gdbarch, stop_pc);
@@ -2395,7 +2400,13 @@ process_event_stop_test:
       if (real_stop_pc != 0)
 	ecs->stop_func_start = real_stop_pc;
 
-      if (IN_SOLIB_DYNSYM_RESOLVE_CODE (ecs->stop_func_start))
+      if (
+#ifdef IN_SOLIB_DYNSYM_RESOLVE_CODE
+	  IN_SOLIB_DYNSYM_RESOLVE_CODE (ecs->stop_func_start)
+#else
+	  in_solib_dynsym_resolve_code (ecs->stop_func_start)
+#endif
+)
 	{
 	  struct symtab_and_line sr_sal;
 	  init_sal (&sr_sal);
@@ -3919,7 +3930,6 @@ When non-zero, inferior specific debuggi
   signal_stop[TARGET_SIGNAL_CANCEL] = 0;
   signal_print[TARGET_SIGNAL_CANCEL] = 0;
 
-#ifdef SOLIB_ADD
   add_setshow_zinteger_cmd ("stop-on-solib-events", class_support,
 			    &stop_on_solib_events, _("\
 Set stopping for shared library events."), _("\
@@ -3930,7 +3940,6 @@ to the user would be loading/unloading o
 			    NULL,
 			    show_stop_on_solib_events,
 			    &setlist, &showlist);
-#endif
 
   add_setshow_enum_cmd ("follow-fork-mode", class_run,
 			follow_fork_mode_kind_names,
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.188
diff -u -p -r1.188 remote.c
--- remote.c 1 May 2005 19:58:54 -0000 1.188
+++ remote.c 8 May 2005 21:38:23 -0000
@@ -42,6 +42,7 @@
 #include "value.h"
 #include "gdb_assert.h"
 #include "observer.h"
+#include "solib.h"
 
 #include <ctype.h>
 #include <sys/time.h>
@@ -2258,10 +2259,8 @@ remote_open_1 (char *name, int from_tty,
       wait_forever_enabled_p = 0;
     }
 
-#ifdef SOLIB_CREATE_INFERIOR_HOOK
   /* First delete any symbols previously loaded from shared libraries.  */
   no_shared_libraries (NULL, 0);
-#endif
 
   /* Start the remote connection.  If error() or QUIT, discard this
      target (we'd otherwise be in an inconsistent state) and then
@@ -2300,7 +2299,7 @@ remote_open_1 (char *name, int from_tty,
       putpkt ("!");
       getpkt (buf, (rs->remote_packet_size), 0);
     }
-#ifdef SOLIB_CREATE_INFERIOR_HOOK
+
   /* FIXME: need a master target_open vector from which all
      remote_opens can be called, so that stuff like this can
      go there.  Failing that, the following code must be copied
@@ -2310,10 +2309,13 @@ remote_open_1 (char *name, int from_tty,
   /* Set up to detect and load shared libraries.  */
   if (exec_bfd) 	/* No use without an exec file.  */
     {
+#ifdef SOLIB_CREATE_INFERIOR_HOOK
       SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
+#else
+      solib_create_inferior_hook ();
+#endif
       remote_check_symbols (symfile_objfile);
     }
-#endif
 
   observer_notify_inferior_created (&current_target, from_tty);
 }
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.130
diff -u -p -r1.130 stack.c
--- stack.c 28 Feb 2005 17:00:49 -0000 1.130
+++ stack.c 8 May 2005 21:38:24 -0000
@@ -46,6 +46,7 @@
 #include "exceptions.h"
 #include "reggroups.h"
 #include "regcache.h"
+#include "solib.h"
 
 /* Prototypes for exported functions. */
 
@@ -686,10 +687,13 @@ print_frame (struct frame_info *fi, 
       annotate_frame_source_end ();
     }
 
-#ifdef PC_SOLIB
   if (!funname || (!sal.symtab || !sal.symtab->filename))
     {
+#ifdef PC_SOLIB
       char *lib = PC_SOLIB (get_frame_pc (fi));
+#else
+      char *lib = solib_address (get_frame_pc (fi));
+#endif
       if (lib)
 	{
 	  annotate_frame_where ();
@@ -698,7 +702,6 @@ print_frame (struct frame_info *fi, 
 	  ui_out_field_string (uiout, "from", lib);
 	}
     }
-#endif /* PC_SOLIB */
 
   /* do_cleanups will call ui_out_tuple_end() for us.  */
   do_cleanups (list_chain);
Index: xcoffsolib.c
===================================================================
RCS file: /cvs/src/src/gdb/xcoffsolib.c,v
retrieving revision 1.17
diff -u -p -r1.17 xcoffsolib.c
--- xcoffsolib.c 18 Feb 2005 15:25:31 -0000 1.17
+++ xcoffsolib.c 8 May 2005 21:38:24 -0000
@@ -157,24 +157,6 @@ sharedlibrary_command (char *pattern, in
   }
 }
 
-/* LOCAL FUNCTION
-
-   no_shared_libraries -- handle command to explicitly discard symbols
-   from shared libraries.
-
-   DESCRIPTION
-
-   Implements the command "nosharedlibrary", which discards symbols
-   that have been auto-loaded from shared libraries.  Symbols from
-   shared libraries that were added by explicit request of the user
-   are not discarded.  Also called from remote.c.  */
-
-void
-no_shared_libraries (char *ignored, int from_tty)
-{
-  /* FIXME */
-}
-
 void
 _initialize_xcoffsolib (void)
 {
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.726
diff -u -p -r1.726 Makefile.in
--- Makefile.in 2 May 2005 12:05:11 -0000 1.726
+++ Makefile.in 8 May 2005 21:38:27 -0000
@@ -545,7 +545,8 @@ SFILES = ada-exp.y ada-lang.c ada-typepr
 	regcache.c reggroups.c remote.c remote-fileio.c \
 	scm-exp.c scm-lang.c scm-valprint.c \
 	sentinel-frame.c \
-	serial.c ser-base.c ser-unix.c source.c \
+	serial.c ser-base.c ser-unix.c \
+	solib.c solib-null.c source.c \
 	stabsread.c stack.c std-regs.c symfile.c symfile-mem.c symmisc.c \
 	symtab.c \
 	target.c thread.c top.c tracepoint.c \
@@ -938,7 +939,8 @@ COMMON_OBS = $(DEPFILES) $(YYOBJ) \
 	cp-namespace.o \
 	reggroups.o regset.o \
 	trad-frame.o \
-	tramp-frame.o
+	tramp-frame.o \
+	solib.o solib-null.o
 
 TSOBS = inflow.o
 
@@ -1436,7 +1438,7 @@ ALLDEPFILES = \
 	s390-tdep.c s390-nat.c \
 	ser-go32.c ser-pipe.c ser-tcp.c \
 	sh-tdep.c sh64-tdep.c shnbsd-tdep.c shnbsd-nat.c \
-	solib.c solib-irix.c solib-svr4.c solib-sunos.c \
+	solib-irix.c solib-svr4.c solib-sunos.c \
 	sparc-linux-tdep.c sparc-nat.c sparc-sol2-nat.c sparc-sol2-tdep.c \
 	sparc-tdep.c sparc-sol2-nat.c sparc-sol2-tdep.c sparc64-linux-nat.c \
 	sparc64-linux-tdep.c sparc64-nat.c sparc64-sol2-tdep.c \
@@ -1772,8 +1774,8 @@ breakpoint.o: breakpoint.c $(defs_h) $(s
 	$(command_h) $(inferior_h) $(gdbthread_h) $(target_h) $(language_h) \
 	$(gdb_string_h) $(demangle_h) $(annotate_h) $(symfile_h) \
 	$(objfiles_h) $(source_h) $(linespec_h) $(completer_h) $(gdb_h) \
-	$(ui_out_h) $(cli_script_h) $(gdb_assert_h) $(block_h) $(solist_h) \
-	$(observer_h) $(exceptions_h) $(gdb_events_h)
+	$(ui_out_h) $(cli_script_h) $(gdb_assert_h) $(block_h) $(solib_h) \
+	$(solist_h) $(observer_h) $(exceptions_h) $(gdb_events_h)
 bsd-kvm.o: bsd-kvm.c $(defs_h) $(cli_cmds_h) $(command_h) $(frame_h) \
 	$(regcache_h) $(target_h) $(value_h) $(gdbcore_h) $(gdb_assert_h) \
 	$(readline_h) $(bsd_kvm_h)
@@ -1821,7 +1823,7 @@ corelow.o: corelow.c $(defs_h) $(arch_ut
 	$(inferior_h) $(symtab_h) $(command_h) $(bfd_h) $(target_h) \
 	$(gdbcore_h) $(gdbthread_h) $(regcache_h) $(regset_h) $(symfile_h) \
 	$(exec_h) $(readline_h) $(observer_h) $(gdb_assert_h) \
-	$(exceptions_h)
+	$(exceptions_h) $(solib_h)
 core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \
 	$(inferior_h) $(target_h) $(gdb_string_h) $(gregset_h)
 cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \
@@ -1938,7 +1940,7 @@ f-lang.o: f-lang.c $(defs_h) $(gdb_strin
 	$(valprint_h) $(value_h)
 fork-child.o: fork-child.c $(defs_h) $(gdb_string_h) $(frame_h) \
 	$(inferior_h) $(target_h) $(gdb_wait_h) $(gdb_vfork_h) $(gdbcore_h) \
-	$(terminal_h) $(gdbthread_h) $(command_h)
+	$(terminal_h) $(gdbthread_h) $(command_h) $(solib_h)
 frame-base.o: frame-base.c $(defs_h) $(frame_base_h) $(frame_h) \
 	$(gdb_obstack_h)
 frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \
@@ -2108,7 +2110,7 @@ infcmd.o: infcmd.c $(defs_h) $(gdb_strin
 	$(symfile_h) $(gdbcore_h) $(target_h) $(language_h) $(symfile_h) \
 	$(objfiles_h) $(completer_h) $(ui_out_h) $(event_top_h) \
 	$(parser_defs_h) $(regcache_h) $(reggroups_h) $(block_h) \
-	$(gdb_assert_h)
+	$(solib_h) $(gdb_assert_h)
 inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \
 	$(event_top_h) $(inf_loop_h) $(remote_h) $(exceptions_h)
 inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \
@@ -2124,7 +2126,7 @@ infrun.o: infrun.c $(defs_h) $(gdb_strin
 	$(inferior_h) $(exceptions_h) $(breakpoint_h) $(gdb_wait_h) \
 	$(gdbcore_h) $(gdbcmd_h) $(cli_script_h) $(target_h) $(gdbthread_h) \
 	$(annotate_h) $(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) \
-	$(value_h) $(observer_h) $(language_h) $(gdb_assert_h)
+	$(value_h) $(observer_h) $(language_h) $(solib_h) $(gdb_assert_h)
 inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
 	$(gdbcore_h) $(command_h) $(gdb_stat_h) $(observer_h) $(gdb_wait_h) \
 	$(inflow_h)
@@ -2410,7 +2412,7 @@ remote.o: remote.c $(defs_h) $(gdb_strin
 	$(symfile_h) $(exceptions_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \
 	$(gdb_stabs_h) $(gdbthread_h) $(remote_h) $(regcache_h) $(value_h) \
 	$(gdb_assert_h) $(event_loop_h) $(event_top_h) $(inf_loop_h) \
-	$(serial_h) $(gdbcore_h) $(remote_fileio_h) $(observer_h)
+	$(serial_h) $(gdbcore_h) $(remote_fileio_h) $(solib_h) $(observer_h)
 remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) $(gdbarch_h) \
 	$(inferior_h) $(target_h) $(value_h) $(command_h) $(gdb_string_h) \
 	$(exceptions_h) $(gdbcmd_h) $(serial_h) $(remote_utils_h) \
@@ -2625,7 +2627,7 @@ stack.o: stack.c $(defs_h) $(gdb_string_
 	$(gdbcore_h) $(target_h) $(source_h) $(breakpoint_h) $(demangle_h) \
 	$(inferior_h) $(annotate_h) $(ui_out_h) $(block_h) $(stack_h) \
 	$(gdb_assert_h) $(dictionary_h) $(exceptions_h) $(reggroups_h) \
-	$(regcache_h)
+	$(regcache_h) $(solib_h)
 std-regs.o: std-regs.c $(defs_h) $(user_regs_h) $(frame_h) $(gdbtypes_h) \
 	$(value_h) $(gdb_string_h)
 stop-gdb.o: stop-gdb.c $(defs_h)


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

* Re: [RFC] Unconditionally include shared library code
  2005-05-08 22:01             ` Mark Kettenis
@ 2005-05-08 22:08               ` Daniel Jacobowitz
  2005-05-09 20:46                 ` Kevin Buettner
  0 siblings, 1 reply; 12+ messages in thread
From: Daniel Jacobowitz @ 2005-05-08 22:08 UTC (permalink / raw)
  To: gdb-patches

On Sun, May 08, 2005 at 11:46:08PM +0200, Mark Kettenis wrote:
>    Date: Sun, 8 May 2005 10:56:27 -0400
>    From: Daniel Jacobowitz <drow@false.org>
> 
>    On Sun, May 08, 2005 at 04:51:25PM +0200, Mark Kettenis wrote:
>    > Hmm, that'd work.  We'll have to face the inconsistent interface issue
>    > eventually, but it's a seperate issue indeed.  Any objection if I
>    > introduce a config/tm-solib.h and use that?  Its purpose is a bit more
>    > clear, and the risk of abuse is smaller.  The mechanical update is not
>    > without risk, but I'm willing to take it.  Deal?
> 
>    I like it.  It is indeed a tm file and shouldn't be used any other way.
> 
> I reworked the patch to avoid shlib.[ch].  Looking at the changes I
> think the risk of changing solib.h into tm-solib.h under config/ is
> riskier than leaving config/ alone and simply removing the #defines
> from solib.h.  I'm moving towards checking in the attached patch at
> the end of the coming week.

I like this even more!  Kevin?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: [RFC] Unconditionally include shared library code
  2005-05-08 22:08               ` Daniel Jacobowitz
@ 2005-05-09 20:46                 ` Kevin Buettner
  2005-05-12 20:40                   ` Mark Kettenis
  0 siblings, 1 reply; 12+ messages in thread
From: Kevin Buettner @ 2005-05-09 20:46 UTC (permalink / raw)
  To: gdb-patches

On Sun, 8 May 2005 18:01:41 -0400
Daniel Jacobowitz <drow@false.org> wrote:

> On Sun, May 08, 2005 at 11:46:08PM +0200, Mark Kettenis wrote:
> >    Date: Sun, 8 May 2005 10:56:27 -0400
> >    From: Daniel Jacobowitz <drow@false.org>
> > 
> >    On Sun, May 08, 2005 at 04:51:25PM +0200, Mark Kettenis wrote:
> >    > Hmm, that'd work.  We'll have to face the inconsistent interface issue
> >    > eventually, but it's a seperate issue indeed.  Any objection if I
> >    > introduce a config/tm-solib.h and use that?  Its purpose is a bit more
> >    > clear, and the risk of abuse is smaller.  The mechanical update is not
> >    > without risk, but I'm willing to take it.  Deal?
> > 
> >    I like it.  It is indeed a tm file and shouldn't be used any other way.
> > 
> > I reworked the patch to avoid shlib.[ch].  Looking at the changes I
> > think the risk of changing solib.h into tm-solib.h under config/ is
> > riskier than leaving config/ alone and simply removing the #defines
> > from solib.h.  I'm moving towards checking in the attached patch at
> > the end of the coming week.
> 
> I like this even more!  Kevin?

It's okay with me.

Kevin


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

* Re: [RFC] Unconditionally include shared library code
  2005-05-09 20:46                 ` Kevin Buettner
@ 2005-05-12 20:40                   ` Mark Kettenis
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Kettenis @ 2005-05-12 20:40 UTC (permalink / raw)
  To: kevinb; +Cc: gdb-patches

   Date: Mon, 9 May 2005 13:42:29 -0700
   From: Kevin Buettner <kevinb@redhat.com>

   On Sun, 8 May 2005 18:01:41 -0400
   Daniel Jacobowitz <drow@false.org> wrote:

   > On Sun, May 08, 2005 at 11:46:08PM +0200, Mark Kettenis wrote:
   > >
   > > I reworked the patch to avoid shlib.[ch].  Looking at the changes I
   > > think the risk of changing solib.h into tm-solib.h under config/ is
   > > riskier than leaving config/ alone and simply removing the #defines
   > > from solib.h.  I'm moving towards checking in the attached patch at
   > > the end of the coming week.
   > 
   > I like this even more!  Kevin?

   It's okay with me.

Thanks,  I've checked it in.  Please yell if anything is broken now.

Mark


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

end of thread, other threads:[~2005-05-12 20:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-02 12:53 [RFC] Unconditionally include shared library code Mark Kettenis
2005-05-08 13:15 ` Mark Kettenis
2005-05-08 13:59   ` Daniel Jacobowitz
2005-05-08 14:24     ` Daniel Jacobowitz
2005-05-08 14:40     ` Mark Kettenis
2005-05-08 14:48       ` Daniel Jacobowitz
2005-05-08 17:32         ` Mark Kettenis
2005-05-08 15:33           ` Daniel Jacobowitz
2005-05-08 22:01             ` Mark Kettenis
2005-05-08 22:08               ` Daniel Jacobowitz
2005-05-09 20:46                 ` Kevin Buettner
2005-05-12 20:40                   ` Mark Kettenis

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