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]

[PATCH] clear_solib() fixes from Ilya Golubev


I've just committed the following changes from Ilya Golubev.  Note
that the patch below is somewhat different than that which Ilya
originally submitted:

    http://sources.redhat.com/ml/gdb-patches/2001-08/msg00280.html

These changes probably ought to go in the 5.1 branch too, but I'd
prefer to give it some (more) testing in the development sources
first.  (I'd appreciate it if someone could test the irix5-nat.c and
osfsolib.c changes.)

Thanks to Ilya for reporting the ``info target'' segv and providing
this fix.

	From Ilya Golubev <gin@mo.msk.ru>:
	* solib.c (clear_solib): Call `remove_target_sections' to fix
	stale pointers in `struct target_ops'.
	* irix5-nat.c (clear_solib): Likewise.
	* osfsolib.c (clear_solib): Likewise.

Index: irix5-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/irix5-nat.c,v
retrieving revision 1.13
diff -u -p -r1.13 irix5-nat.c
--- irix5-nat.c	2001/05/04 04:15:25	1.13
+++ irix5-nat.c	2001/09/14 00:18:20
@@ -1061,6 +1061,7 @@ clear_solib (void)
 	}
       if (so_list_head->abfd)
 	{
+	  remove_target_sections (so_list_head->abfd);
 	  bfd_filename = bfd_get_filename (so_list_head->abfd);
 	  if (!bfd_close (so_list_head->abfd))
 	    warning ("cannot close \"%s\": %s",
Index: osfsolib.c
===================================================================
RCS file: /cvs/src/src/gdb/osfsolib.c,v
retrieving revision 1.9
diff -u -p -r1.9 osfsolib.c
--- osfsolib.c	2001/05/04 04:15:26	1.9
+++ osfsolib.c	2001/09/14 00:18:21
@@ -802,6 +802,7 @@ clear_solib (void)
 	}
       if (so_list_head->abfd)
 	{
+	  remove_target_sections (so_list_head->abfd);
 	  bfd_filename = bfd_get_filename (so_list_head->abfd);
 	  if (!bfd_close (so_list_head->abfd))
 	    warning ("cannot close \"%s\": %s",
Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.42
diff -u -p -r1.42 solib.c
--- solib.c	2001/06/04 07:45:08	1.42
+++ solib.c	2001/09/14 00:18:22
@@ -730,6 +730,8 @@ clear_solib (void)
     {
       struct so_list *so = so_list_head;
       so_list_head = so->next;
+      if (so->abfd)
+	remove_target_sections (so->abfd);
       free_so (so);
     }
 


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