From cad9537f844cacbb73c1529249f77421b5e56c45 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Thu, 12 May 2005 20:21:18 +0000 Subject: * 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. --- gdb/corelow.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'gdb/corelow.c') diff --git a/gdb/corelow.c b/gdb/corelow.c index 75f9419081b..ea37df5d0a0 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -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, ¤t_target, auto_solib_add); +#else + solib_add (NULL, *(int *)from_ttyp, ¤t_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 (); -- cgit v1.2.1