From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5180 invoked by alias); 25 Feb 2004 18:32:14 -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 5100 invoked from network); 25 Feb 2004 18:32:11 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by sources.redhat.com with SMTP; 25 Feb 2004 18:32:11 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 9273247D62; Wed, 25 Feb 2004 10:32:11 -0800 (PST) Date: Wed, 25 Feb 2004 18:32:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: Re: [RFC/RFA] (testsuite/Ada) Add gdb_compile_ada Message-ID: <20040225183211.GH1105@gnat.com> References: <20040224195615.GC542@gnat.com> <20040224230812.GE542@gnat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="FCuugMFkClbJLl1L" Content-Disposition: inline In-Reply-To: <20040224230812.GE542@gnat.com> User-Agent: Mutt/1.4i X-SW-Source: 2004-02/txt/msg00730.txt.bz2 --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1526 Continuing my fascinating monologous with myself :) > - Object files are placed in the testsuite directory. I'd rather > see them being placed in gdb.ada. > > I managed to do this, but I a not completely sure that it's such > a good idea after all. See patch below. On the one hand, the object > files et al are placed in gdb.ada rather than gdb/testsuite, but > on the other hand this has a slight impact in the debug info generated > by the compiler, since the source file name is no longer absolute. > So this change is not completely transparent for the debugger... > What do you think? Actually, I just noticed that the few tests that do generate object files and other compilation artifacts actually leave them in the testsuite directory, not inside the gdb.* directories. So I would be tempted to discard the idea above of making sure that all these artifacts be placed in the gdb.ada directory for all Ada testcases. Hence the attached patch. One note, however: contrary to C where temporary .o files are automatically deleted, gnatmake leaves behind. This is to allow incremental builds, similar what make does. This will cause a much higher number of object files to be created in the testsuite directory. I hope this is fine? Otherwise, we'll can use the previous approach, but I believe it should be done consistently across all languages. 2004-02-24 J. Brobecker * lib/gdb.exp (gdb_compile_ada): New function. Tested on x86-linux. -- Joel --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="gdb.exp.diff" Content-length: 886 Index: lib/gdb.exp =================================================================== RCS file: /nile.c/cvs/Dev/gdb/gdb-6.0/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 gdb.exp --- lib/gdb.exp 5 Oct 2003 10:40:20 -0000 1.1.1.1 +++ lib/gdb.exp 25 Feb 2004 18:24:38 -0000 @@ -1323,6 +1323,23 @@ proc gdb_compile_objc {source dest type } } +# +# Compile some Ada code. +# +proc gdb_compile_ada {source dest type options} { + + lappend options "compiler=gnatmake" + + set result [target_compile $source $dest $type $options] + + # Make sure that the dest file has been created. Otherwise, + # the build has failed. + if ![file exists $dest] { + verbose "Ada compilation failed: $result" + return "Ada compilation failed." + } +} + proc send_gdb { string } { global suppress_flag; if { $suppress_flag } { --FCuugMFkClbJLl1L--