From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23988 invoked by alias); 31 Mar 2004 16:32:02 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23965 invoked from network); 31 Mar 2004 16:31:59 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 31 Mar 2004 16:31:59 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1B8idF-0008Fq-QI; Wed, 31 Mar 2004 11:32:01 -0500 Date: Wed, 31 Mar 2004 16:32:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/testsuite/ada] Add support for building Ada programs Message-ID: <20040331163201.GA31286@nevyn.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sources.redhat.com References: <20040329195523.GE888@gnat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040329195523.GE888@gnat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-03/txt/msg00761.txt.bz2 On Mon, Mar 29, 2004 at 11:55:23AM -0800, Joel Brobecker wrote: > Hello, > > Based on the discussion between Daniel and myself that started with: > > http://sources.redhat.com/ml/gdb-patches/2004-02/msg00695.html > > I suggest the addition of a new file in testsuite/lib: ada.exp. > > This file contains 2 elements: > 1. Two procedure that should be provided by dejagnu. The changes > needed to add support for Ada is not in there yet, so I duplicated > this code here for now. This only affect testing of Ada programs, > since a test would need to include "ada.exp" to see these different > procedures. The plan is also to keep them for a while after they > are part of a released version of dejagnu, to avoid increasing > the dejagnu version number requirement when running the GDB testsuite. There's one problem here. A recurring problem we've had is testcases tainting other tests, because what you say above isn't quite right - once ada.exp is loaded, it will remain loaded for the remainder of the test run. So, it's good to avoid loading these when not necessary. Here's one way to do it: proc gdb_find_gnatmake { } { ... } proc gdb_default_target_compile { } { ... } if {[info procs find_gnatmake] == ""} { proc find_gnatmake { } { return [gdb_find_gnatmake] } proc default_target_compile { source destfile type options } { return [gdb_default_target_compile $source $destfile $type $options] } } Yes, in TCL procedure definitions can be conditional. This way, if a version of DejaGNU which includes your patch is used, the code in GDB will be ignored in favor of DejaGNU's. Does the above work? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer