From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24706 invoked by alias); 17 May 2012 11:10:10 -0000 Received: (qmail 24693 invoked by uid 22791); 17 May 2012 11:10:09 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 17 May 2012 11:09:54 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id q4HB9Oa9027297; Thu, 17 May 2012 13:09:24 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id q4HB9Ljc005742; Thu, 17 May 2012 13:09:21 +0200 (CEST) Date: Thu, 17 May 2012 11:10:00 -0000 Message-Id: <201205171109.q4HB9Ljc005742@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: macro@codesourcery.com CC: brobecker@adacore.com, thomas@codesourcery.com, tromey@redhat.com, gdb-patches@sourceware.org, kevinb@redhat.com In-reply-to: (macro@codesourcery.com) Subject: Re: [SH] regs command 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> 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/msg00646.txt.bz2 > Date: Thu, 17 May 2012 01:59:29 +0100 > From: "Maciej W. Rozycki" > > 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. Sorry, but we've always considered it a mistake to rely on a specific order of running the initialization functions. Implicit dependencies between modules like that really are a bad idea.