From patchwork Tue Aug 26 17:01:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 2539 Received: (qmail 6631 invoked by alias); 26 Aug 2014 17:01:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 6615 invoked by uid 89); 26 Aug 2014 17:01:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL, BAYES_00, SUBJ_OBFU_PUNCT_FEW autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Aug 2014 17:01:53 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1XMK7x-00000e-Vk from Maciej_Rozycki@mentor.com for gdb-patches@sourceware.org; Tue, 26 Aug 2014 10:01:50 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 26 Aug 2014 10:01:49 -0700 Received: from localhost (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.2.247.3; Tue, 26 Aug 2014 18:01:47 +0100 Date: Tue, 26 Aug 2014 18:01:43 +0100 From: "Maciej W. Rozycki" To: Subject: [PATCH] Move `_initialize_varobj' to the end of varobj.c Message-ID: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 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 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); +}