diff src/alloc.c @ 4934:714f7c9fabb1

make it easier to debug staticpro crashes. Add functions to print out the variable names saved during calls to staticpro(), and change the order of enumerating staticpros to start from 0 to make it easier to get a count to pass to the new functions.
author Ben Wing <ben@xemacs.org>
date Tue, 19 Jan 2010 01:21:39 -0600
parents ae81a2c00f4f
children 299dce99bdad
line wrap: on
line diff
--- a/src/alloc.c	Sun Jan 24 22:06:20 2010 -0600
+++ b/src/alloc.c	Tue Jan 19 01:21:39 2010 -0600
@@ -3281,6 +3281,13 @@
   dump_add_root_lisp_object (varaddress);
 }
 
+/* External debugging function: Return the name of the variable at offset
+   COUNT. */
+char *
+staticpro_name (int count)
+{
+  return Dynarr_at (staticpro_names, count);
+}
 
 Lisp_Object_ptr_dynarr *staticpros_nodump;
 char_ptr_dynarr *staticpro_nodump_names;
@@ -3294,6 +3301,14 @@
   Dynarr_add (staticpro_nodump_names, varname);
 }
 
+/* External debugging function: Return the name of the variable at offset
+   COUNT. */
+char *
+staticpro_nodump_name (int count)
+{
+  return Dynarr_at (staticpro_nodump_names, count);
+}
+
 #ifdef HAVE_SHLIB
 /* Stop treating the Lisp_Object at non-heap VARADDRESS as a root object
    for garbage collection, but not for dumping. */
@@ -3418,6 +3433,14 @@
   Dynarr_add (mcpro_names, varname);
 }
 
+/* External debugging function: Return the name of the variable at offset
+   COUNT. */
+char *
+mcpro_name (int count)
+{
+  return Dynarr_at (mcpro_names, count);
+}
+
 #else /* not DEBUG_XEMACS */
 
 Lisp_Object_dynarr *mcpros;