From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4148 invoked by alias); 23 Oct 2007 21:15:34 -0000 Received: (qmail 4137 invoked by uid 22791); 23 Oct 2007 21:15:34 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 23 Oct 2007 21:15:31 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id BA22B9833F; Tue, 23 Oct 2007 21:15:29 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 97BB398153; Tue, 23 Oct 2007 21:15:29 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1IkR60-0001da-Em; Tue, 23 Oct 2007 17:15:28 -0400 Date: Tue, 23 Oct 2007 21:55:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: Markus Deuling , gdb-patches@sourceware.org, uweigand@de.ibm.com Subject: Re: [rfc] [17/17] Get rid of current_gdbarch in go32-nat.c Message-ID: <20071023211528.GA5996@caradoc.them.org> Mail-Followup-To: Eli Zaretskii , Markus Deuling , gdb-patches@sourceware.org, uweigand@de.ibm.com References: <470DE4C1.9070509@de.ibm.com> <471C3E2C.3010509@de.ibm.com> <471DCAAB.7080603@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes 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: 2007-10/txt/msg00553.txt.bz2 On Tue, Oct 23, 2007 at 10:53:03PM +0200, Eli Zaretskii wrote: > Well, that just says its purpose is to get rid of current_gdbarch, but > there's no serious discussion of the issue. So I'm still wondering: > was this discussed, and if so, where can I read it? I believe it was Andrew's goal as long ago as when he started adding "gdbarch" arguments to methods. I can't think of any specific discussion, but I've been aware of this trend as long as I can remember working on GDB. > I can understand why this is a Good Thing for ports that can actually > support multiple architectures. But why is this a good idea for > single-architecture ports? You are replacing a variable reference > with a function call, which is a slowdown. That's the downside; > what's the upside, please? Even a single-architecture port may have more than one current_gdbarch. A gdbarch is fine-grained and e.g. different executables can lead to different gdbarches. So a GDB for DJGPP which supported debugging two programs at once might need more than one "current" gdbarch. Also, getting rid of current_gdbarch is hard. If we leave it in some targets then we have to continue making it work; it'll creep back in to ports that were trying to get rid of it. I think having more than one way to do this is not worthwhile. > Good God! you don't really mean that, do you? What kind of bloated > GDB executable will we have when this happens? FYI, I'd love to ship a single GDB binary that supported multiple targets. That's practical for our case. I don't know if we would turn on all targets or just a set list. > > This is a cool feature ;-) Whereas I cannot imagine a scenario > > where GDB debugs for example an x86 binary and a PowerPC binary in one session. > > If we cannot imagine such a scenario, why are we trying to support it? I can imagine it; people build such systems today, and some of CodeSourcery's customers are interested in debugging them. Of course, that's not a terribly frequent example, but there's all sorts of weird hybrids out there. An ARM and a signal processor or a PowerPC and eight SPUs are both real cases I'm familiar with. -- Daniel Jacobowitz CodeSourcery