From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1655 invoked by alias); 17 May 2012 00:59:58 -0000 Received: (qmail 1646 invoked by uid 22791); 17 May 2012 00:59:57 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 17 May 2012 00:59:43 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SUp49-0003XH-Sc from Maciej_Rozycki@mentor.com ; Wed, 16 May 2012 17:59:41 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 16 May 2012 17:59:26 -0700 Received: from [172.30.0.201] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Thu, 17 May 2012 01:59:39 +0100 Date: Thu, 17 May 2012 00:59:00 -0000 From: "Maciej W. Rozycki" To: Joel Brobecker , Thomas Schwinge CC: Tom Tromey , , Kevin Buettner Subject: Re: [SH] regs command In-Reply-To: Message-ID: References: <87ehqkrzzw.fsf@schwinge.name> <20120516142633.GV10253@adacore.com> <87zk98qe8t.fsf@schwinge.name> <20120516165730.GY10253@adacore.com> <87pqa4qbzp.fsf@schwinge.name> <87r4ukox0y.fsf@fleche.redhat.com> <20120516190539.GZ10253@adacore.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00644.txt.bz2 On Wed, 16 May 2012, Maciej W. Rozycki wrote: > > > This means you registered "regs" before the thing it aliases was > > > registered. This can happen because _initialize_xxx order is not > > > defined. > > > > > > There's no easy fix :(. You could move "regs" initialization to a > > > better spot but then it will be visible in all builds of gdb, not just > > > those with this target compiled in. > > > > It seems better in that case to just go with what Thomas had initially, > > maybe just adding a comment why we don't use an alias? It's only for > > a few weeks... > > I think a fix is actually very easy. All that has to be done is to tweak > the init.c scriptery such that *_tdep initialisers are run last. And > actually I think it is worth the while regardless of this particular issue > as this way all the target-dependent bits can rely on generic stuff to > have been initialised. > > Of course tweaking the scriptery can be horribly boring, but there you > go. I'll see if I can give it a shot -- unless anyone beats me to it. So here it is, this change moves *_tdep initialisers to the end while otherwise keeping the order the same (IOW within the two groups the order remains the same as before). I've checked it against autoconf's tool portability list and also verified it with Solaris sed to make sure there are no surprises. Thomas, can you give it a shot and see if this fixes your alias issue? I'll add some commentary if this works for you and gets a go-ahead. 2012-05-17 Maciej W. Rozycki gdb/ * Makefile.in (init.c): Reorder *_tdep initialisers to the end. Maciej gdb-init-tdep.diff Index: gdb-fsf-trunk-quilt/gdb/Makefile.in =================================================================== --- gdb-fsf-trunk-quilt.orig/gdb/Makefile.in 2012-05-17 01:08:19.000000000 +0100 +++ gdb-fsf-trunk-quilt/gdb/Makefile.in 2012-05-17 01:43:27.325562969 +0100 @@ -1121,6 +1121,12 @@ init.c: $(INIT_FILES) while read f; do \ sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/\1/p' $$f 2>/dev/null; \ done | \ + sed -n \ + -e '/_tdep$$/H' \ + -e '//!p' \ + -e '$$x' \ + -e '$$s/\n//' \ + -e '$$p' | \ while read f; do \ case " $$fs " in \ *" $$f "* ) ;; \