From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5566 invoked by alias); 8 Oct 2007 14:10:47 -0000 Received: (qmail 5555 invoked by uid 22791); 8 Oct 2007 14:10:47 -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; Mon, 08 Oct 2007 14:10:42 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id A9589982FB; Mon, 8 Oct 2007 14:10:40 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 45882980BD; Mon, 8 Oct 2007 14:10:40 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IetJf-0003Ea-FG; Mon, 08 Oct 2007 10:10:39 -0400 Date: Mon, 08 Oct 2007 14:10:00 -0000 From: Daniel Jacobowitz To: Ulrich Weigand Cc: Markus Deuling , GDB Patches , Eli Zaretskii , Joel Brobecker , Jim Blandy , rearnsha@arm.com, Mark Kettenis Subject: Re: [rfc] [00/16] Get rid of current gdbarch Message-ID: <20071008141039.GA12235@caradoc.them.org> Mail-Followup-To: Ulrich Weigand , Markus Deuling , GDB Patches , Eli Zaretskii , Joel Brobecker , Jim Blandy , rearnsha@arm.com, Mark Kettenis References: <20071008133525.GA10323@caradoc.them.org> <200710081401.l98E1a77021006@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200710081401.l98E1a77021006@d12av02.megacenter.de.ibm.com> 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/msg00152.txt.bz2 On Mon, Oct 08, 2007 at 04:01:36PM +0200, Ulrich Weigand wrote: > Agreed for that particular usage. In general, the reg_to_regnum > routines should probably still be converted to "m" -- e.g. the > rs6000 versions do make non-trivial use of the gdbarch ... Isn't that problematic? We do not know what the architecture will be at this point. Only the bits common to all architectures using the same init routine are safe to use. As for the rs6000 version, the patches I posted last week allow a followup patch which propogates some constants. Most of the values being read from the tdep are now constants. Some (e.g. ppc_mq_regnum) are not constants, but have either a single constant value or -1 if the register is not present; for those the constant is appropriate in the reg_to_regnum routines anyway. For a concrete example, suppose the default PowerPC architecture selected by GDB did not include AltiVec registers. Variables living in such registers would get bogus locations from the reg_to_regnum routine and it would not be fixed up when we connected to an AltiVec-capable target. -- Daniel Jacobowitz CodeSourcery