From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Snyder To: gdb-patches@sources.redhat.com Cc: cagney@redhat.com, kevinb@redhat.com, hunt@redhat.com, jsmith@redhat.com, jtc@redback.com Subject: [RFA] Link remote target with svr4 solibs. Date: Mon, 12 Mar 2001 16:13:00 -0000 Message-id: <3AAD635C.DAE5D340@cygnus.com> X-SW-Source: 2001-03/msg00176.html The following change is necessary in order to activate svr4 solib debugging for remote targets. With it, GDB will detect when the remote target loads a new shared library (using the method implemented in solib-svr4.c), and GDB will load the symbols for the library (provided that GDB has been told where to find the symbol files, using the "set solib-search-path" and "set solib-absolute-prefix" commands. 2001-03-12 Michael Snyder * remote.c (remote_open): On opening the remote target, activate the solib_create_inferior_hook, so that it can detect when the target loads shared libraries. Index: remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.41 diff -c -3 -p -r1.41 remote.c *** remote.c 2001/03/06 08:21:13 1.41 --- remote.c 2001/03/12 23:58:32 *************** static void *** 2002,2007 **** --- 2002,2011 ---- remote_open (char *name, int from_tty) { remote_open_1 (name, from_tty, &remote_ops, 0); + #ifdef SOLIB_CREATE_INFERIOR_HOOK + if (exec_bfd) /* No use without an exec file. */ + SOLIB_CREATE_INFERIOR_HOOK (inferior_pid); + #endif } /* Just like remote_open, but with asynchronous support. */ >From jtc@redback.com Mon Mar 12 16:30:00 2001 From: jtc@redback.com (J.T. Conklin) To: Michael Snyder Cc: gdb-patches@sources.redhat.com, cagney@redhat.com, kevinb@redhat.com, hunt@redhat.com, jsmith@redhat.com Subject: Re: [RFA] Link remote target with svr4 solibs. Date: Mon, 12 Mar 2001 16:30:00 -0000 Message-id: <5m1ys2cxxt.fsf@jtc.redback.com> References: <3AAD635C.DAE5D340@cygnus.com> X-SW-Source: 2001-03/msg00177.html Content-length: 1013 >>>>> "Michael" == Michael Snyder writes: Michael> The following change is necessary in order to activate svr4 Michael> solib debugging for remote targets. With it, GDB will detect Michael> when the remote target loads a new shared library (using the Michael> method implemented in solib-svr4.c), and GDB will load the Michael> symbols for the library (provided that GDB has been told Michael> where to find the symbol files, using the "set Michael> solib-search-path" and "set solib-absolute-prefix" If I understand the shared library implementation correctly, a magic breakpoint is inserted in the dynamic loader, which when hit GDB does normal reads and writes to determine what shared library has been loaded or unloaded, etc. If so, practically any remote back end (perhaps a ROM monitor interface) will provide the infrastructure required for this to work. Doesn't this argue that this should reside somewhere above remote_open()? --jtc -- J.T. Conklin RedBack Networks