From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28783 invoked by alias); 8 Jan 2008 15:37:22 -0000 Received: (qmail 28775 invoked by uid 22791); 8 Jan 2008 15:37:21 -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, 08 Jan 2008 15:36:51 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id BA54998223; Tue, 8 Jan 2008 15:36:49 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 9F99198022; Tue, 8 Jan 2008 15:36:49 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1JCGVU-0005i3-HP; Tue, 08 Jan 2008 10:36:48 -0500 Date: Tue, 08 Jan 2008 15:37:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Need post-processing of parameters for function calls in Ada Message-ID: <20080108153648.GA21928@caradoc.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sourceware.org References: <20080108143622.GG24614@adacore.com> <20080108150114.GA19378@caradoc.them.org> <20080108152900.GB11650@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080108152900.GB11650@adacore.com> User-Agent: Mutt/1.5.17 (2007-12-11) 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: 2008-01/txt/msg00135.txt.bz2 On Tue, Jan 08, 2008 at 07:29:00AM -0800, Joel Brobecker wrote: > I don't think we'll need to move the argument coercion phase... > > > This might allow a useful option, to avoid calling malloc when passing > > strings to a C function. We can not do that in general, since the > > function might save the pointer, but there are some cases (like strcmp). > > ... unless that is needed to allow calling malloc. But this can be > discussed independently, if you prefer. You're right. I misread the code; sp is already properly set up by this point. > I agree. I propose the following: > > - Add a new la_value_arg_coerce method in the language vector. > The prototype would be identical to the current value_arg_coerce > but with the added SP. > > - rename value_arg_coerce c_value_arg_coerce. Possibly move it to > c-lang. > > - Make all languages use c_value_arg_coerce, except for Ada, which > would use our own coerce routine. > > That should take care of everything (except maybe allowing malloc > calls). > > My only concern is that the Ada coerce might be relying on the C coerce > routine to handle the simple cases. So I might need to call the C coerce > routine at the end of the Ada coerce routine. I need to look deeper > into this. Does the existing routine do anything inappropriate for Ada? I suspect it is appropriate for all languages, and we can call a language-specific routine in addition to it. But if it does anything you'd rather it didn't, then we should let Ada avoid it. -- Daniel Jacobowitz CodeSourcery