[RFA] Link remote target with svr4 solibs.

Michael Snyder msnyder@cygnus.com
Tue Mar 13 16:02:00 GMT 2001


"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.

How's the following?  Sorry, the context for the patch is snafu -- 
they are in remote_open_1 and remote_async_open_1, at the end of each.
Also I changed the comment because the appostrophe was messing up
auto-indent in emacs (dunno why, emacs bug I guess).
2001-03-12  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.41
diff -c -3 -p -r1.41 remote.c
*** remote.c	2001/03/06 08:21:13	1.41
--- remote.c	2001/03/13 23:58:56
*************** serial device is attached to the remote 
*** 2114,2124 ****
  
    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. */
--- 2114,2133 ----
  
    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 
*** 2208,2218 ****
  
    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
--- 2217,2236 ----
  
    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


More information about the Gdb-patches mailing list