From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20999 invoked by alias); 18 May 2012 12:39:49 -0000 Received: (qmail 20991 invoked by uid 22791); 18 May 2012 12:39:48 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 May 2012 12:39:32 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4ICd3BH008816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 May 2012 08:39:03 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4ICd0b1006743; Fri, 18 May 2012 08:39:01 -0400 Message-ID: <4FB642E4.6050106@redhat.com> Date: Fri, 18 May 2012 12:39:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: "Maciej W. Rozycki" CC: Joel Brobecker , Tom Tromey , Mark Kettenis , thomas@codesourcery.com, gdb-patches@sourceware.org, kevinb@redhat.com Subject: Re: [SH] regs command References: <87r4ukox0y.fsf@fleche.redhat.com> <20120516190539.GZ10253@adacore.com> <201205171109.q4HB9Ljc005742@glazunov.sibelius.xs4all.nl> <20120517123827.GB10253@adacore.com> <201205171522.q4HFMWGM026439@glazunov.sibelius.xs4all.nl> <20120517154502.GE10253@adacore.com> <87zk96k2my.fsf@fleche.redhat.com> <20120517203757.GG10253@adacore.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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/msg00679.txt.bz2 On 05/18/2012 01:22 PM, Maciej W. Rozycki wrote: > static struct target_so_ops mips_svr4_so_ops; > [...] > > /* Initialize this lazily, to avoid an initialization order > dependency on solib-svr4.c's _initialize routine. */ > if (mips_svr4_so_ops.in_dynsym_resolve_code == NULL) > { > mips_svr4_so_ops = svr4_so_ops; > mips_svr4_so_ops.in_dynsym_resolve_code > = mips_linux_in_dynsym_resolve_code; > } > set_solib_ops (gdbarch, &mips_svr4_so_ops); > > that I find all but clean -- I can't even tell straight away, without > studying all the code involved and perhaps experimenting, if this indeed > is going to work correctly regardless of whether this is run before or > after the other piece referred. solib-svr4.c is as much target dependent as mips-linux-tdep.c though. The split on file name is a bit arbitrary. It'd make a bit more sense to split around something like COMMON_OBS and TARGET_OBJS, but you'd still bump into such issues. A "don't depend on order" rule appears simpler to understand and maintain than having to worry about hierarchies. -- Pedro Alves