From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129908 invoked by alias); 28 Aug 2015 19:16:48 -0000 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 Received: (qmail 129893 invoked by uid 89); 28 Aug 2015 19:16:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f172.google.com Received: from mail-yk0-f172.google.com (HELO mail-yk0-f172.google.com) (209.85.160.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 28 Aug 2015 19:16:46 +0000 Received: by ykay144 with SMTP id y144so9881942yka.2 for ; Fri, 28 Aug 2015 12:16:44 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.129.157.67 with SMTP id u64mr6505377ywg.11.1440789404596; Fri, 28 Aug 2015 12:16:44 -0700 (PDT) Received: by 10.13.254.195 with HTTP; Fri, 28 Aug 2015 12:16:44 -0700 (PDT) In-Reply-To: <20150828172156.D6FB98775@oc7340732750.ibm.com> References: <20150828172156.D6FB98775@oc7340732750.ibm.com> Date: Fri, 28 Aug 2015 19:16:00 -0000 Message-ID: Subject: Re: [PATCH] Remove only use of current_inferior ()->gdbarch outside of gdbarch.* From: Doug Evans To: Ulrich Weigand Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00820.txt.bz2 On Fri, Aug 28, 2015 at 10:21 AM, Ulrich Weigand wrote: > Doug Evans wrote: >> On Thu, Aug 27, 2015 at 10:15 PM, Doug Evans wrote: >> > 2015-08-27 Doug Evans >> > >> > * ravenscar-thread.c (ravenscar_inferior_created): Replace >> > current_inferior ()->gdbarch with its wrapper target_gdbarch. > > Just as a quick comment: this goes exactly into the opposite direction > from what we discussed in the other thread. I think we should replace > target_gdbarch () with current_inferior ()->gdbarch *everywhere*, > instead of reverting that here ... This does nothing to fix the underlying problem, which is the referencing of global state instead obtaining the needed state (inferior, gdbarch, or whatever) from the passed in context. That's what I was talking about in the other thread at any rate. *In the mean time*, let's be consistent, and this patch is simpler. When we do go to properly fix this (or at least take the next step to properly fixing this), *then* we can go through and remove all the target_gdbarch calls.