Re: [RFC/RFA] (testsuite/Ada) Add gdb_compile_ada

Joel Brobecker
2004-02-24T22:40:37Z

Hello,

> 2004-02-24 J. Brobecker <brobecker@gnat.com>
>
> * lib/gdb.exp (gdb_compile_ada): New function.

Please ignore this patch. It has a few problems:

- Object files are placed in the testsuite directory. I'd rather
see them being placed in gdb.ada.

- There is a problem with gdb_compile_ada. In Ada target_compile
always returns some output, so the current implementation thinks
the compilation fails, while it is not necessarily the case.
I changed the test to check for the dest file, rather than
analyzing the output.

Will send an updated patch when I have a complete ada testcase working.

> 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 } {

--
Joel