[PATCH] Move `_initialize_varobj' to the end of varobj.c
Maciej W. Rozycki
macro@codesourcery.com
Tue Aug 26 17:01:00 GMT 2014
Hi,
We keep initialisers at the end of the respective files they are in,
however in varobj.c someone has stuffed code below. The change included
here moves _initialize_varobj back to the end. This went just fine having
been pushed through some regression testing along other stuff, so there
shouldn't be any hidden traps; nothing is meant to refer to an initialiser
explicitly anyway as they're handled specially by the build scriptery.
This probably counts as obvious, so I'll just wait 48 hours for any
objections before going ahead and pushing it.
2014-08-26 Maciej W. Rozycki <macro@codesourcery.com>
gdb/
* varobj.c (_initialize_varobj): Move to the end of file.
Maciej
gdb-varobj-invalidate-move.diff
Index: gdb-fsf-trunk-quilt/gdb/varobj.c
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/varobj.c 2014-08-23 01:11:20.568972186 +0100
+++ gdb-fsf-trunk-quilt/gdb/varobj.c 2014-08-23 01:43:52.277555347 +0100
@@ -2726,24 +2726,6 @@ all_root_varobjs (void (*func) (struct v
(*func) (var_root->rootvar, data);
}
}
-
-extern void _initialize_varobj (void);
-void
-_initialize_varobj (void)
-{
- int sizeof_table = sizeof (struct vlist *) * VAROBJ_TABLE_SIZE;
-
- varobj_table = xmalloc (sizeof_table);
- memset (varobj_table, 0, sizeof_table);
-
- add_setshow_zuinteger_cmd ("varobj", class_maintenance,
- &varobjdebug,
- _("Set varobj debugging."),
- _("Show varobj debugging."),
- _("When non-zero, varobj debugging is enabled."),
- NULL, show_varobjdebug,
- &setdebuglist, &showdebuglist);
-}
/* Invalidate varobj VAR if it is tied to locals and re-create it if it is
defined on globals. It is a helper for varobj_invalidate.
@@ -2786,3 +2768,21 @@ varobj_invalidate (void)
{
all_root_varobjs (varobj_invalidate_iter, NULL);
}
+
+extern void _initialize_varobj (void);
+void
+_initialize_varobj (void)
+{
+ int sizeof_table = sizeof (struct vlist *) * VAROBJ_TABLE_SIZE;
+
+ varobj_table = xmalloc (sizeof_table);
+ memset (varobj_table, 0, sizeof_table);
+
+ add_setshow_zuinteger_cmd ("varobj", class_maintenance,
+ &varobjdebug,
+ _("Set varobj debugging."),
+ _("Show varobj debugging."),
+ _("When non-zero, varobj debugging is enabled."),
+ NULL, show_varobjdebug,
+ &setdebuglist, &showdebuglist);
+}
More information about the Gdb-patches
mailing list