From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9060 invoked by alias); 24 Feb 2004 19:56:17 -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 9045 invoked from network); 24 Feb 2004 19:56:15 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (209.53.17.20) by sources.redhat.com with SMTP; 24 Feb 2004 19:56:15 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 51C8447D62; Tue, 24 Feb 2004 11:56:15 -0800 (PST) Date: Tue, 24 Feb 2004 19:56:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: [RFC/RFA] (testsuite/Ada) Add gdb_compile_ada Message-ID: <20040224195615.GC542@gnat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2004-02/txt/msg00695.txt.bz2 --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 2023 Hello, Hmmm, dejagnu is still quite obscure for me, so I don't think I'll come up with the perfect universal solution to add support for Ada testcases right from the start... So instead I'll proceed tiny steps at a time... First step: Being able to build most Ada programs. Let's first restrict ourselves to Ada-only programs. Such a program necessarily have its main program written in Ada. With GNAT, this main program must be located in its own file. And to build the entire application, one usually does: % gnatmake -g where is the name of the file containing the main subprogram. The extension may be omitted. Dependencies are automatically handled by gnatmake. In this patch, I suggest we defined a new function gdb_compile_ada in lib/gdb.exp which will allow us to build Ada programs using the command above. I have a question: I am uncertain as to how cross targets are handled. Suppose we built a powerpc-elf debugger. How does the testsuite know which compiler to use. Does it have so machinery that will translate gcc into powerpc-elf-gcc by default? Would the same apply to gnatmake in gdb_compile_ada via target_compile? In the medium term, we will want to improve gdb_compile_ada to allow the testsuite to use different runtimes (we have sjlj exceptions vs ZCX exceptions, longcall vs no-longcall, shared vs static) or different options (we want to use -mieee on tru64 for instance). I believe this should be easily done via the options field. As for multilanguage examples, I'll leave that for later as well, but I don't think that would be too big a problem. 2004-02-24 J. Brobecker * lib/gdb.exp (gdb_compile_ada): New function. Tested on x86-linux. I used that function to build a simple program, and I was able to debug it. Comments? Or, one can always dream, ok to apply? The next steps will involve creating the gdb.ada directory, update the configure scripts, and add our first example (the null record one). Thanks, -- Joel --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="gdb.exp.diff" Content-length: 744 Index: lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.49 diff -u -p -r1.49 gdb.exp --- lib/gdb.exp 23 Feb 2004 19:27:46 -0000 1.49 +++ lib/gdb.exp 24 Feb 2004 19:50:10 -0000 @@ -1361,6 +1361,17 @@ proc gdb_compile_objc {source dest type } } +proc gdb_compile_ada {source dest type options} { + + lappend options "compiler=gnatmake" + + set result [target_compile $source $dest $type $options] + if { $result != "" } { + verbose "target_compile failed: $result" 2 + return "gdb_compile_ada failed: $result" + } +} + proc send_gdb { string } { global suppress_flag; if { $suppress_flag } { --yrj/dFKFPuw6o+aM--