From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12036 invoked by alias); 5 Oct 2007 23:59:11 -0000 Received: (qmail 12028 invoked by uid 22791); 5 Oct 2007 23:59:11 -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; Fri, 05 Oct 2007 23:59:07 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id C2694981F4; Fri, 5 Oct 2007 23:59:05 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 8B612981F1; Fri, 5 Oct 2007 23:59:05 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1Idx4S-0006Wr-Cy; Fri, 05 Oct 2007 19:59:04 -0400 Date: Fri, 05 Oct 2007 23:59:00 -0000 From: Daniel Jacobowitz To: Thiago Jung Bauermann Cc: gdb-patches@sourceware.org Subject: Re: [rfc] Use target descriptions for PowerPC Message-ID: <20071005235904.GA24514@caradoc.them.org> Mail-Followup-To: Thiago Jung Bauermann , gdb-patches@sourceware.org References: <20071005163754.GA26041@caradoc.them.org> <1191620446.18959.18.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1191620446.18959.18.camel@localhost.localdomain> 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/msg00079.txt.bz2 On Fri, Oct 05, 2007 at 06:40:46PM -0300, Thiago Jung Bauermann wrote: > Hi Daniel, > > On Fri, 2007-10-05 at 12:37 -0400, Daniel Jacobowitz wrote: > > + /* If we have a 64-bit binary on a 32-bit target, complain. Also > > + complain for a 32-bit binary on a 64-bit target; we do not yet > > + support that. */ > > + if (tdesc_wordsize != -1 && tdesc_wordsize != wordsize) > > + { > > + tdesc_data_cleanup (tdesc_data); > > + return NULL; > > + } > > Sorry if I am confusing things here. This sounds like it affects 64 bit > GDB debugging 32 bit binary. Is this the case? Or only for remote > debugging? Good noticing, it could be a problem, but it works out fine - we don't have a supplied target description in this case, so we pick a default based on the 32-bit binary, and get a 32-bit binary; everything matches. Then the GNU/Linux native code handles the details. I've just tested that. The problem I'm trying to prevent is that we will always use registers of the size described by the target description. And we don't support implementing the 32-bit ABI on top of 64-bit GPRs; we'll copy arguments into the high half of registers when calling functions, for instance. Try connecting a GDB to a 64-bit gdbserver and it will go wrong in a couple of ways. The native targets fake this by knowing how to supply 32-bit registers when expected, even if you'd think there ought to be 64-bit registers. -- Daniel Jacobowitz CodeSourcery