+2015-12-24 Joel Brobecker <brobecker@adacore.com>
+
+ * lib/ada.exp (target_compile_ada_from_dir): New function.
+ (gdb_compile_ada): Reimplement avoiding the use of project files.
+ * gdb.ada/gnat_ada.gpr: Delete.
+ * gdb.ada/cond_lang.exp: Adjust test to make path before
+ filename optional.
+ * gdb.ada/small_reg_param.exp: Likewise.
+
2015-12-22 Simon Marchi <simon.marchi@ericsson.com>
* gdb.base/foll-vork.exp: Remove HP-UX special case.
# current language mode is auto, and the breakpoint is inside Ada code.
set bp_location [gdb_get_line_number "STOP" ${testdir}/mixed.adb]
gdb_test "break mixed.adb:${bp_location} if light = green" \
- "Breakpoint \[0-9\]* at .*: file .*/mixed.adb, line \[0-9\]*\\."
+ "Breakpoint \[0-9\]* at .*: file (.*/)?mixed.adb, line \[0-9\]*\\."
# Now, continue until we hit the breakpoint. If the condition is
# evaluated correctly, the first hit will be ignored, and the debugger
+++ /dev/null
--- Copyright 2004-2015 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 3 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, see <http://www.gnu.org/licenses/>.
-
--- 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;
# Continue until we hit the breakpoint inside `Call_Me'. We verify
# that the parameter value is correct.
gdb_test "continue" \
- "Breakpoint .*, pck\\.call_me \\(w=(w@entry=)?50\\) at .*/pck.adb:.*" \
+ "Breakpoint .*, pck\\.call_me \\(w=(w@entry=)?50\\) at (.*/)?pck.adb:.*" \
"continue to call_me"
# And just to make sure, we also verify that the parameter value
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# Call target_compile with SOURCE DEST TYPE and OPTIONS as argument,
+# after having temporarily changed the current working directory to
+# BUILDDIR.
+
+proc target_compile_ada_from_dir {builddir source dest type options} {
+ set saved_cwd [pwd]
+ catch {
+ cd $builddir
+ return [target_compile $source $dest $type $options]
+ } result options
+ cd $saved_cwd
+ return -options $options $result
+}
+
# Compile some Ada code.
proc gdb_compile_ada {source dest type options} {
set gprdir [file dirname $srcdir]
set objdir [file dirname $dest]
+ # Although strictly not necessary, we force the recompilation
+ # of all units (additional_flags=-f). This is what is done
+ # when using GCC to build programs in the other languages,
+ # and it avoids using a stray objfile file from a long-past
+ # run, for instance.
append options " ada"
- append options " additional_flags=-P$gprdir/gnat_ada"
- append options " additional_flags=-XSRC=[file tail $srcdir]"
- append options " additional_flags=-XOBJ=$objdir"
+ append options " additional_flags=-f"
+ append options " additional_flags=-I$srcdir"
- set result [target_compile [file tail $source] $dest $type $options]
+ set result [target_compile_ada_from_dir \
+ $objdir [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