public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  gbenson/rtld-probes: More
@ 2013-07-05 14:44 gary
  0 siblings, 0 replies; only message in thread
From: gary @ 2013-07-05 14:44 UTC (permalink / raw)
  To: archer-commits

The branch, gbenson/rtld-probes has been updated
       via  71daecee6226a434bdc8addd941aacde66324f98 (commit)
       via  ad19830a2caf34a9c65c1e68fb5324e393f8f7fa (commit)
       via  7e60baa764af49770e09a6e1afe7ff151c976833 (commit)
       via  e5bb4b9c4c8b8f2e79c3010ad31c3b6a95af96ea (commit)
       via  152db092f009754f73efefdb00550498ec1159db (commit)
      from  bdbfa45acbce73bcebbbd053cfb6579344ebe83f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 71daecee6226a434bdc8addd941aacde66324f98
Author: Gary Benson <gbenson@redhat.com>
Date:   Fri Jul 5 15:40:41 2013 +0100

    More

commit ad19830a2caf34a9c65c1e68fb5324e393f8f7fa
Author: Gary Benson <gbenson@redhat.com>
Date:   Fri Jul 5 15:34:04 2013 +0100

    Start documenting this

commit 7e60baa764af49770e09a6e1afe7ff151c976833
Author: Gary Benson <gbenson@redhat.com>
Date:   Fri Jul 5 15:06:42 2013 +0100

    Current status

commit e5bb4b9c4c8b8f2e79c3010ad31c3b6a95af96ea
Author: Gary Benson <gbenson@redhat.com>
Date:   Fri Jul 5 15:01:24 2013 +0100

    More

commit 152db092f009754f73efefdb00550498ec1159db
Author: Gary Benson <gbenson@redhat.com>
Date:   Fri Jul 5 15:01:14 2013 +0100

    Notes I made yesterday

-----------------------------------------------------------------------

Summary of changes:
 LIST             |  104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/solib-svr4.c |   26 ++++++++++++--
 2 files changed, 127 insertions(+), 3 deletions(-)
 create mode 100644 LIST

First 500 lines of diff:
diff --git a/LIST b/LIST
new file mode 100644
index 0000000..269b355
--- /dev/null
+++ b/LIST
@@ -0,0 +1,104 @@
+1. free_so (in solib.c) ALWAYS calls ops->free_so (so);
+
+2. Here are the places ops->free_so are set:
+
+  gdb/solib-aix.c:  solib_aix_so_ops.free_so = solib_aix_free_so;
+
+  gdb/solib-darwin.c:  darwin_so_ops.free_so = darwin_free_so;
+
+  gdb/solib-dsbt.c:  dsbt_so_ops.free_so = dsbt_free_so;
+
+  gdb/solib-frv.c:  frv_so_ops.free_so = frv_free_so;
+
+  gdb/solib-ia64-hpux.c:  ops->free_so = ia64_hpux_free_so;
+
+  gdb/solib-irix.c:  irix_so_ops.free_so = irix_free_so;
+
+  gdb/solib-osf.c:  osf_so_ops.free_so = osf_free_so;
+
+  gdb/solib-pa64.c:  pa64_so_ops.free_so = pa64_free_so;
+
+  gdb/solib-som.c:  som_so_ops.free_so = som_free_so;
+
+  gdb/solib-spu.c:      spu_so_ops.free_so = spu_free_so;
+  gdb/solib-spu.c:    svr4_so_ops.free_so (so);
+
+  gdb/solib-sunos.c:  sunos_so_ops.free_so = sunos_free_so;
+
+  gdb/solib-svr4.c:  svr4_so_ops.free_so = svr4_free_so;
+
+  gdb/solib-target.c:  solib_target_so_ops.free_so = solib_target_free_so;
+
+3. Here is everything called *_free_so:
+
+  gdb/solib-aix.c:solib_aix_free_so (struct so_list *so)
+  gdb/solib-aix.c:  solib_aix_so_ops.free_so = solib_aix_free_so;
+    # Never called directly
+    # xfree(so) added
+
+  gdb/solib-darwin.c:darwin_free_so (struct so_list *so)
+  gdb/solib-darwin.c:  darwin_so_ops.free_so = darwin_free_so;
+    # Never called directly
+    # xfree(so) added
+
+  gdb/solib-dsbt.c:dsbt_free_so (struct so_list *so)
+  gdb/solib-dsbt.c:  dsbt_so_ops.free_so = dsbt_free_so;
+    # Never called directly
+    # xfree(so) added
+
+  gdb/solib-frv.c:frv_free_so (struct so_list *so)
+  gdb/solib-frv.c:  frv_so_ops.free_so = frv_free_so;
+    # Never called directly
+    # xfree(so) added
+
+  gdb/solib-ia64-hpux.c:      ia64_hpux_free_so (so);
+  gdb/solib-ia64-hpux.c:ia64_hpux_free_so (struct so_list *so)
+  gdb/solib-ia64-hpux.c:  ops->free_so = ia64_hpux_free_so;
+    # Called directly, but followed immediately by xfree(so)
+    # xfree(so) added
+    # xfree(so) removed from after direct call
+
+  gdb/solib-irix.c:irix_free_so (struct so_list *so)
+  gdb/solib-irix.c:  irix_so_ops.free_so = irix_free_so;
+    # Never called directly
+    # xfree(so) added
+
+  gdb/solib-osf.c:   not freed by osf_free_so().  */
+  gdb/solib-osf.c:      osf_free_so (&so);
+  gdb/solib-osf.c:  osf_free_so (so);
+  gdb/solib-osf.c:	  osf_free_so (&so);
+  gdb/solib-osf.c:osf_free_so (struct so_list *so)
+  gdb/solib-osf.c:  osf_so_ops.free_so = osf_free_so;
+    # XXX
+
+  gdb/solib-pa64.c:pa64_free_so (struct so_list *so)
+  gdb/solib-pa64.c:  pa64_so_ops.free_so = pa64_free_so;
+    # Never called directly
+    # xfree(so) added
+
+  gdb/solib-som.c:som_free_so (struct so_list *so)
+  gdb/solib-som.c:  som_so_ops.free_so = som_free_so;
+    # Never called directly
+    # XXX
+
+  gdb/solib-spu.c:spu_free_so (struct so_list *so)
+  gdb/solib-spu.c:      spu_so_ops.free_so = spu_free_so;
+    # XXX
+
+  gdb/solib-sunos.c:sunos_free_so (struct so_list *so)
+  gdb/solib-sunos.c:  sunos_so_ops.free_so = sunos_free_so;
+    # XXX
+
+  gdb/solib-svr4.c:	svr4_free_so (so->lm_info->copy);
+  gdb/solib-svr4.c:svr4_free_so (struct so_list *so)
+  gdb/solib-svr4.c:  svr4_so_ops.free_so = svr4_free_so;
+    # XXX needs documentation
+
+  gdb/solib-target.c:solib_target_free_so (struct so_list *so)
+  gdb/solib-target.c:  solib_target_so_ops.free_so = solib_target_free_so;
+    # Never called directly
+    # xfree(so) added
+
+  gdb/windows-nat.c:	windows_free_so (sodel);
+  gdb/windows-nat.c:windows_free_so (struct so_list *so)
+    # not using the same framework as everything else
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 2bbf4f7..cab46f1 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -73,10 +73,13 @@ struct lm_info
     /* Values read in from inferior's fields of the same name.  */
     CORE_ADDR l_ld, l_next, l_prev, l_name;
 
-    /* XXX.  */
+    /* A copy of the solib containing this lm_info, if one exists.
+       See comment in svr4_current_sos for more information.  */
     struct so_list *copy;
 
-    /* XXX.  */
+    /* Nonzero if the solib containing this lm_info is an acquired
+       copy of another solib.  See comment in svr4_current_sos for
+       more information.  */
     unsigned int acquired : 1;
   };
 
@@ -1468,11 +1471,28 @@ svr4_current_sos (void)
   struct svr4_info *info = get_svr4_info ();
 
   /* If the solib list has been read and stored by the probes
-     interface then XXX.  */
+     interface then we return a copy of the stored list.  */
   if (info->solib_list != NULL)
     {
       struct so_list *so, *result, **link = &result;
 
+      /* To avoid copying each solib each time the list is updated,
+	 we retain pointers to the copies and mark each copy as
+	 "acquired" before returning the list to update_solib_list.
+	 Then, for each copy:
+
+         - If the solib has already been added to the program space's
+           so_list then update_solib_list will free the copy we
+           returned using free_so.  This releases the acquired copy
+           for re-use by the next call to svr4_current_sos.
+
+         - If the solib has not been added to the program space's
+           so_list then update_solib_list will not free the copy we
+           returned.  The next call to svr4_current_sos will note that
+           the copy is still acquired and create a fresh copy to
+           return.
+
+         This ensures no solib is copied more than twice. */
       for (so = info->solib_list; so; so = so->next)
 	{
 	  gdb_assert (so->lm_info != NULL);


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-05 14:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-05 14:44 [SCM] gbenson/rtld-probes: More gary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).