From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24689 invoked by alias); 18 May 2012 12:49:12 -0000 Received: (qmail 24677 invoked by uid 22791); 18 May 2012 12:49:11 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 May 2012 12:48:59 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 66EA41C64E6; Fri, 18 May 2012 08:48:58 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DFGofAXO7gvU; Fri, 18 May 2012 08:48:58 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 186991C641B; Fri, 18 May 2012 08:48:57 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 6E5B7145616; Fri, 18 May 2012 05:48:43 -0700 (PDT) Date: Fri, 18 May 2012 12:49:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: "Maciej W. Rozycki" , Tom Tromey , Mark Kettenis , thomas@codesourcery.com, gdb-patches@sourceware.org, kevinb@redhat.com Subject: Re: [SH] regs command Message-ID: <20120518124843.GK10253@adacore.com> References: <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> <4FB642E4.6050106@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FB642E4.6050106@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00681.txt.bz2 > > /* 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); > 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. And I *think* we solved that problem elsewhere, right? Basically, we call functions to get the ops vector. That way, no matter the init order, we always access initialized data... See the inf-* files IIRC. -- Joel