From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7323 invoked by alias); 8 May 2005 21:47:19 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6971 invoked by uid 22791); 8 May 2005 21:46:43 -0000 Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 08 May 2005 21:46:43 +0000 Received: from elgar.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, 08 May 2005 22:01:00 -0000 Message-Id: <200505082146.j48Lk8TZ022794@elgar.sibelius.xs4all.nl> From: Mark Kettenis 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> X-SW-Source: 2005-05/txt/msg00199.txt.bz2 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 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 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 * 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, ¤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 (); 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 @@ -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 #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, ¤t_target, auto_solib_add); - re_enable_breakpoints_in_shlibs (); +#else + solib_add (NULL, from_tty, ¤t_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, ¤t_target, auto_solib_add); +#else + solib_add (NULL, 0, ¤t_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 #include @@ -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 (¤t_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)