observer_notify_solib_unloaded (gdb);
update_solib_list (int from_tty, struct target_ops *target){  struct so_list *inferior = TARGET_SO_CURRENT_SOS ();  struct so_list *gdb, **gdb_link;  /* If we are attaching to a running process for which we      have not opened a symbol file, we may be able to get its      symbols now!  */  if (attach_flag &&      symfile_objfile == NULL)    catch_errors (TARGET_SO_OPEN_SYMBOL_FILE_OBJECT, &from_tty, 		  "Error reading attached process's symbol file.\n",		  RETURN_MASK_ALL);  /* Since this function might actually add some elements to the     so_list_head list, arrange for it to be cleaned up when     appropriate.  */  if (!solib_cleanup_queued)    {      make_run_cleanup (do_clear_solib, NULL);      solib_cleanup_queued = 1;    }  /* GDB and the inferior's dynamic linker each maintain their own     list of currently loaded shared objects; we want to bring the     former in sync with the latter.  Scan both lists, seeing which     shared objects appear where.  There are three cases:     - A shared object appears on both lists.  This means that GDB     knows about it already, and it's still loaded in the inferior.     Nothing needs to happen.     - A shared object appears only on GDB's list.  This means that     the inferior has unloaded it.  We should remove the shared     object from GDB's tables.     - A shared object appears only on the inferior's list.  This     means that it's just been loaded.  We should add it to GDB's     tables.     So we walk GDB's list, checking each entry to see if it appears     in the inferior's list too.  If it does, no action is needed, and     we remove it from the inferior's list.  If it doesn't, the     inferior has unloaded it, and we remove it from GDB's list.  By     the time we're done walking GDB's list, the inferior's list     contains only the new shared objects, which we then add.  */  gdb = so_list_head;  gdb_link = &so_list_head;  while (gdb)    {      struct so_list *i = inferior;      struct so_list **i_link = &inferior;      /* Check to see whether the shared object *gdb also appears in	 the inferior's current list.  */      while (i)	{	  if (! strcmp (gdb->so_original_name, i->so_original_name))	    break;	  i_link = &i->next;	  i = *i_link;	}      /* If the shared object appears on the inferior's list too, then         it's still loaded, so we don't need to do anything.  Delete         it from the inferior's list, and leave it on GDB's list.  */      if (i)	{	  *i_link = i->next;	  free_so (i);	  gdb_link = &gdb->next;	  gdb = *gdb_link;	}      /* If it's not on the inferior's list, remove it from GDB's tables.  */      else	{	  *gdb_link = gdb->next;	  /* Unless the user loaded it explicitly, free SO's objfile.  */	  if (gdb->objfile && ! (gdb->objfile->flags & OBJF_USERLOADED))	    free_objfile (gdb->objfile);	  /* Some targets' section tables might be referring to	     sections from so->abfd; remove them.  */	  remove_target_sections (gdb->abfd);	  free_so (gdb);	  gdb = *gdb_link;	}    }  /* Now the inferior's list contains only shared objects that don't     appear in GDB's list --- those that are newly loaded.  Add them     to GDB's shared object list.  */  if (inferior)    {      struct so_list *i;      /* Add the new shared objects to GDB's list.  */      *gdb_link = inferior;      /* Fill in the rest of each of the `struct so_list' nodes.  */      for (i = inferior; i; i = i->next)	{	  i->from_tty = from_tty;	  /* Fill in the rest of the `struct so_list' node.  */	  catch_errors (solib_map_sections, i,			"Error while mapping shared library sections:\n",			RETURN_MASK_ALL);	  /* If requested, add the shared object's sections to the TARGET's	     section table.  Do this immediately after mapping the object so	     that later nodes in the list can query this object, as is needed	     in solib-osf.c.  */	  if (target)	    {	      int count = (i->sections_end - i->sections);	      if (count > 0)		{		  int space = target_resize_to_sections (target, count);		  memcpy (target->to_sections + space,			  i->sections,			  count * sizeof (i->sections[0]));		}	    }	}    }}