From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3244 invoked by alias); 2 Feb 2005 14:03:35 -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 2898 invoked from network); 2 Feb 2005 14:02:47 -0000 Received: from unknown (HELO smtp11.wanadoo.fr) (193.252.22.31) by sourceware.org with SMTP; 2 Feb 2005 14:02:47 -0000 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1103.wanadoo.fr (SMTP Server) with ESMTP id 359A51C000BF for ; Wed, 2 Feb 2005 15:02:47 +0100 (CET) Received: from takamaka.act-europe.fr (ABesancon-102-1-2-180.w80-11.abo.wanadoo.fr [80.11.91.180]) by mwinf1103.wanadoo.fr (SMTP Server) with ESMTP id B16181C000B0 for ; Wed, 2 Feb 2005 15:02:44 +0100 (CET) X-ME-UUID: 20050202140244726.B16181C000B0@mwinf1103.wanadoo.fr Received: by takamaka.act-europe.fr (Postfix, from userid 507) id DB46347DB9; Wed, 2 Feb 2005 18:02:36 +0400 (RET) Date: Wed, 02 Feb 2005 14:03:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: [RFA/testsuite/ada] Put testcase code in own directory (2) Message-ID: <20050202140236.GG1147@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2005-02/txt/msg00005.txt.bz2 --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1774 Hello, Here is a updated patch that moves the code used by each Ada testcase into its own subdirectory. See this message for the motivation: http://sources.redhat.com/ml/gdb-patches/2004-11/msg00138.html Note that I introduced a new variable "testdir", which will contain the name of the subdir where the sources used by this testcase are stored. I found it useful when I modified fixed_points.exp to the new scheme, as the testcase searches the line number for one of the source files. Also, "srcfile" doesn't really apply all that much to ada, since we have more than one src file. I kept this variable for now for better consistency with the non-ada testcases, with the meaning being the name of the main unit in our program. 2005-02-02 Joel Brobecker * gdb.ada/gnat_ada.gpr: New file. * gdb.ada/gnat_ada.gin: Delete, no longer used. * lib/ada.exp (gdb_compile_ada): Minor adaptation to new project file. * configure.ac: No longer generate gnat_ada.gpr. * gdb.ada/Makefile.in: Minor adaptations due to new project file. * gdb.ada/null_record/null_record.adb: Moved here from gdb.ada. * gdb.ada/null_record/bar.ads: Likewise. * gdb.ada/null_record/bar.adb: Likewise. * gdb.ada/fixed_points/fixed_points.adb: Likewise. * gdb.ada/null_record.exp (testdir): New variable. (testfile): executable is now in testdir subdirectory. (srcfile): Use full path to the main compilation unit. * gdb.ada/fixed_points.exp: Same changes as above. Tested on x86-linux, no regression for these testcases. OK to apply? (note that I didn't attach the .ads and .adb files, since they remain identical to the current ones, I just move them) Thanks, -- Joel --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="gnat_ada.gpr" Content-length: 1047 -- Copyright 2004 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- This project file allows us to control the location where the -- compilation artifacts produced when building the Ada examples -- are stored. project Gnat_Ada is for Source_Dirs use (external ("SRC")); for Object_Dir use external ("OBJ"); end Gnat_Ada; --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="gdb.ada.1.diff" Content-length: 4668 Index: lib/ada.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/ada.exp,v retrieving revision 1.3 diff -u -p -r1.3 ada.exp --- lib/ada.exp 1 Apr 2004 18:42:08 -0000 1.3 +++ lib/ada.exp 2 Feb 2005 13:44:41 -0000 @@ -409,12 +409,16 @@ if {[info procs find_gnatmake] == ""} { proc gdb_compile_ada {source dest type options} { + set srcdir [file dirname $source] + set gprdir [file dirname $srcdir] set objdir [file dirname $dest] append options " ada" - append options " additional_flags=-P$objdir/gnat_ada" + append options " additional_flags=-P$gprdir/gnat_ada" + append options " additional_flags=-XSRC=[file tail $srcdir]" + append options " additional_flags=-XOBJ=$objdir" - set result [target_compile $source $dest $type $options] + set result [target_compile [file tail $source] $dest $type $options] # The Ada build always produces some output, even when the build # succeeds. Thus, we can not use the output the same way we do in Index: configure.ac =================================================================== RCS file: /cvs/src/src/gdb/testsuite/configure.ac,v retrieving revision 1.1 diff -u -p -r1.1 configure.ac --- configure.ac 7 Jan 2005 21:53:23 -0000 1.1 +++ configure.ac 2 Feb 2005 13:42:41 -0000 @@ -109,7 +109,7 @@ AC_CHECK_HEADERS(pthread.h) AC_EXEEXT AC_OUTPUT([Makefile \ - gdb.ada/Makefile gdb.ada/gnat_ada.gpr:gdb.ada/gnat_ada.gin \ + gdb.ada/Makefile \ gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \ Index: gdb.ada/Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/Makefile.in,v retrieving revision 1.1 diff -u -p -r1.1 Makefile.in --- gdb.ada/Makefile.in 1 Apr 2004 00:53:50 -0000 1.1 +++ gdb.ada/Makefile.in 2 Feb 2005 13:44:41 -0000 @@ -1,7 +1,7 @@ VPATH = @srcdir@ srcdir = @srcdir@ -EXECUTABLES = null_record +EXECUTABLES = null_record/null_record fixed_points/fixed_points MISCELLANEOUS = @@ -9,13 +9,16 @@ all info install-info dvi install uninst @echo "Nothing to be done for $@..." clean mostlyclean: - -gnatclean -Pgnat_ada -q $(EXECUTABLES) + -find . -name '*.o' -print | xargs rm -f + -find . -name '*.ali' -print | xargs rm -f + -find . -name 'b~*.ad[sb]' -print | xargs rm -f + -rm -f *~ a.out xgdb *.x *.ci *.tmp -rm -f *~ *.o a.out xgdb *.x *.ci *.tmp -rm -f core core.coremaker coremaker.core corefile $(EXECUTABLES) -rm -f $(MISCELLANEOUS) twice-tmp.c distclean maintainer-clean realclean: clean -rm -f *~ core - -rm -f Makefile config.status config.log gnat_ada.gpr + -rm -f Makefile config.status config.log -rm -f *-init.exp -rm -fr *.log summary detail *.plog *.sum *.psum site.* Index: gdb.ada/null_record.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/null_record.exp,v retrieving revision 1.4 diff -u -p -r1.4 null_record.exp --- gdb.ada/null_record.exp 21 Oct 2004 03:55:07 -0000 1.4 +++ gdb.ada/null_record.exp 2 Feb 2005 13:44:41 -0000 @@ -21,8 +21,9 @@ if $tracelevel then { load_lib "ada.exp" -set testfile "null_record" -set srcfile ${testfile}.adb +set testdir "null_record" +set testfile "${testdir}/null_record" +set srcfile ${srcdir}/${subdir}/${testfile}.adb set binfile ${objdir}/${subdir}/${testfile} if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { Index: gdb.ada/fixed_points.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/fixed_points.exp,v retrieving revision 1.1 diff -u -p -r1.1 fixed_points.exp --- gdb.ada/fixed_points.exp 13 Dec 2004 16:04:20 -0000 1.1 +++ gdb.ada/fixed_points.exp 2 Feb 2005 13:44:41 -0000 @@ -21,8 +21,9 @@ if $tracelevel then { load_lib "ada.exp" -set testfile "fixed_points" -set srcfile ${testfile}.adb +set testdir "fixed_points" +set testfile "${testdir}/fixed_points" +set srcfile ${srcdir}/${subdir}/${testfile}.adb set binfile ${objdir}/${subdir}/${testfile} if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { @@ -34,8 +35,8 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -set bp_location [gdb_get_line_number "Set breakpoint here"] -runto "${srcfile}:$bp_location" +set bp_location [gdb_get_line_number "Set breakpoint here" ${testdir}/fixed_points.adb] +runto "fixed_points.adb:$bp_location" gdb_test "print base_object" \ ".* = -50" \ --7AUc2qLy4jB3hD7Z--