From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16497 invoked by alias); 19 Mar 2007 20:17:19 -0000 Received: (qmail 16488 invoked by uid 22791); 19 Mar 2007 20:17:18 -0000 X-Spam-Check-By: sourceware.org Received: from return.false.org (HELO return.false.org) (66.207.162.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 19 Mar 2007 20:17:15 +0000 Received: from return.false.org (localhost [127.0.0.1]) by return.false.org (Postfix) with ESMTP id C5EE74B267; Mon, 19 Mar 2007 15:17:13 -0500 (CDT) Received: from caradoc.them.org (dsl093-172-095.pit1.dsl.speakeasy.net [66.93.172.95]) by return.false.org (Postfix) with ESMTP id 72D124B262; Mon, 19 Mar 2007 15:17:13 -0500 (CDT) Received: from drow by caradoc.them.org with local (Exim 4.63) (envelope-from ) id 1HTOI4-0004zh-VN; Mon, 19 Mar 2007 16:17:12 -0400 Date: Mon, 19 Mar 2007 20:17:00 -0000 From: Daniel Jacobowitz To: jagorak Cc: Joel Brobecker , gdb@sourceware.org Subject: Re: Calling an Ada subprogram with complex parameters Message-ID: <20070319201712.GA19091@caradoc.them.org> Mail-Followup-To: jagorak , Joel Brobecker , gdb@sourceware.org References: <1827236609.20070317231124@wp.pl> <20070319021557.GA26173@caradoc.them.org> <1905422578.20070319200802@wp.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1905422578.20070319200802@wp.pl> User-Agent: Mutt/1.5.14+cvs20070313 (2007-03-13) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-03/txt/msg00222.txt.bz2 On Mon, Mar 19, 2007 at 08:08:02PM +0000, jagorak wrote: > >> where $myRec is a convenience variable of type "Rec", but this > >> wouldn't work either since convenience variable resides in > >> gdb-specific memory space, complex types seem to be passed by > >> reference and myProc cannot access memory address of $myRec. > > DJ> Actually, that's not true - convenience variables which have a > DJ> memory location are put into the target's memory. Sometimes GDB > DJ> uses the stack, other times malloc is called under the hood. > > That is very good news to me, as using absolute addressess is much > less convenient than using convenience variables. It depends on what you've done with them. As you see below, it's possible in some cases to have a convenience variable of a compound type. If you do that, it does not have a memory location. GDB would need support for pushing the variable into target memory at the appropriate time (and deciding what "appropriate" meant). This is made rather tricky, because (A) calling malloc perturbs the program, so we want to do it as little as possible, but (B) putting a variable on the stack breaks if the called function saves its address. -- Daniel Jacobowitz CodeSourcery