This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] Link remote target with svr4 solibs.


"J.T. Conklin" wrote:
> 
> >>>>> "Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:
> Andrew> Assuming ok with J.T. as well, can you add it to those functions along
> Andrew> with a FIXME.  Plenty of other examples can already be found.
> 
> I was going to mention this yesterday as well.  I don't want to be
> unreasonable and make you fix the problems with the _open vector, but
> I do want the code marked so once that is fixed it can be migrated to
> the proper place.  So as long as you add a FIXME, the change is OK by
> me.
> 
>         --jtc

After a long delay, I'm finally checking in this change.  I'll append the 
change again here to save anyone interested from rooting thru the archive.
2001-04-17  Michael Snyder  <msnyder@redhat.com>
	
	* remote.c (remote_open_1): On opening the remote target, activate
	the solib_create_inferior_hook, so that it can detect when the
	target loads shared libraries.
	(remote_async_open_1): Ditto.

Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.44
diff -c -3 -p -r1.44 remote.c
*** remote.c	2001/04/03 01:42:17	1.44
--- remote.c	2001/04/17 20:28:51
***************
*** 50,55 ****
--- 50,57 ----
  #include <signal.h>
  #include "serial.h"
  
+ #include "gdbcore.h" /* for exec_bfd */
+ 
  /* Prototypes for local functions */
  static void cleanup_sigint_signal_handler (void *dummy);
  static void initialize_sigint_signal_handler (void);
*************** serial device is attached to the remote 
*** 2148,2158 ****
  
    if (extended_p)
      {
!       /* tell the remote that we're using the extended protocol.  */
        char *buf = alloca (PBUFSIZ);
        putpkt ("!");
        getpkt (buf, PBUFSIZ, 0);
      }
  }
  
  /* Just like remote_open but with asynchronous support. */
--- 2150,2169 ----
  
    if (extended_p)
      {
!       /* Tell the remote that we are using the extended protocol.  */
        char *buf = alloca (PBUFSIZ);
        putpkt ("!");
        getpkt (buf, PBUFSIZ, 0);
      }
+   /* 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
+      to the open function for any remote target that wants to 
+      support svr4 shared libraries.  */
+ #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. */
*************** serial device is attached to the remote 
*** 2242,2252 ****
  
    if (extended_p)
      {
!       /* tell the remote that we're using the extended protocol.  */
        char *buf = alloca (PBUFSIZ);
        putpkt ("!");
        getpkt (buf, PBUFSIZ, 0);
      }
  }
  
  /* This takes a program previously attached to and detaches it.  After
--- 2253,2272 ----
  
    if (extended_p)
      {
!       /* Tell the remote that we are using the extended protocol.  */
        char *buf = alloca (PBUFSIZ);
        putpkt ("!");
        getpkt (buf, PBUFSIZ, 0);
      }
+   /* 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
+      to the open function for any remote target that wants to 
+      support svr4 shared libraries.  */
+ #ifdef SOLIB_CREATE_INFERIOR_HOOK
+   if (exec_bfd) 	/* No use without an exec file. */
+     SOLIB_CREATE_INFERIOR_HOOK (inferior_pid);
+ #endif
  }
  
  /* This takes a program previously attached to and detaches it.  After

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]