old-cross-binutils/gdb/testsuite/gdb.ada
Joel Brobecker ab8314b3d9 [testsuite/Ada] stop using project files when building test programs
The current approach when building Ada programs for testing is
based on the use of a project file (testsuite/gdb.ada/gnat_ada.gpr).
To do that, we pass a number of additional arguments to target_compile,
one of them being the project file (via "-P/path/to/gnat_ada.gpr").
This used to work well-enough, but AdaCore is currently working towards
removing project-file support from gnatmake (the prefered tool for
using project files is gprbuild). So, we need to either switch
the compilation to gprbuild, or stop using project files.

First, using gprbuild is not always what users will be using to
build their applications. So having the option of using gnatmake
provides more flexibility towards exactly reproducing past bugs.
If we ever need a testcase that requires the use of gprbuild, then
I believe support for a new target needs to be added to dejagnu's
target_compile.

Also, the only real reason behind using a project file in the first
place is that we wanted to make it easy to specify the directory
where all compilation artifacts get stored. This is a consequence
of the organization choice we made for gdb.ada to keep each testcase
well organized. It is very easy to achieve that goal without using
project files.

This is therefore what this patch does: It change gdb_compile_ada
to build any program using gnatmake without using a project file
(by temporarily changing the current working directory).

There is a small (beneficial) side-effect; in the situation where
GDB is built in-tree, gnatmake is called as...

        % gnatmake [...] unit.adb

... which means that the debugging info in unit.o will say contain
a filename whose name is 'unit.adb', rather than '/path/to/unit.adb'.
This also better matches what users might typically do. But the side-
effect is that the unit name in the GDB output is not always a full
path. This patch tweaks a couple of testcases to make the path part
optional.

gdb/testsuite:

        * 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.

Tested on x86_64-linux, with both in-tree and out-of-tree builds.
2015-12-24 09:25:45 +04:00
..
access_to_packed_array [Ada] Fix the evaluation of access to packed array subscript 2015-09-14 16:28:23 +02:00
addr_arith
aliased_array
arr_arr
array_bounds
array_char_idx
array_of_variable_length [Ada] Enhance type printing for arrays with variable-sized elements 2015-09-15 23:16:22 +02:00
array_ptr_renaming [Ada] Fix handling of array renamings 2015-09-23 22:14:18 +02:00
array_return
array_subscript_addr
arraydim
arrayidx
arrayparam
arrayptr
atomic_enum
attr_ref_and_charlit [Ada] Fix parsing for expressions with attributes and characters 2015-08-20 10:12:24 +02:00
bad-task-bp-keyword
bp_enum_homonym
bp_on_var
bp_range_type
bp_reset
byte_packed_arr
call_pn
catch_ex
char_enum
char_param
complete [Ada] Fix completion for multiple function matches 2015-09-01 14:54:19 +02:00
cond_lang
disc_arr_bound
dot_all
dyn_arrayidx
dyn_loc
enum_idx_packed
exec_changed
expr_delims
exprs
fin_fun_out [Ada] GDB crash during "finish" of function with out parameters 2015-11-09 09:58:16 -08:00
fixed_cmp
fixed_points
float_param
formatted_ref
frame_args
fullname_bp
fun_addr
fun_in_declare
fun_overload_menu Enhance the menu to select function overloads with signatures 2015-12-07 13:32:43 +01:00
fun_renaming [Ada] Add support for subprogram renamings 2015-08-13 09:33:42 +02:00
funcall_char [Ada] Make string_char_type a true TYPE_CODE_CHAR type in Ada 2015-09-03 17:52:05 +02:00
funcall_param
funcall_ref
homonym
info_exc
info_locals_renaming
int_deref
interface
iwide
lang_switch
mi_catch_ex
mi_dyn_arr
mi_ex_cond
mi_exc_info
mi_interface
mi_task_arg
mi_task_info
mi_var_array
mod_from_name
n_arr_bound
nested
null_array
null_record
O2_float_param
operator_bp
optim_drec
out_of_line_in_inlined
packed_array
packed_tagged
pckd_arr_ren
pckd_neg
pkd_arr_elem
pp-rec-component
print_chars
ptr_typedef
ptype_field
ptype_tagged_param
py_range
rdv_wait
rec_comp
rec_return
ref_param
ref_tick_size
same_enum
set_pckd_arr_elt
set_wstr
small_reg_param
start
str_ref_cmp
str_uninit
sym_print_name
taft_type
tagged
tagged_access
tagged_not_init
task_bp
tasks
tick_last_segv
tick_length_array_enum_idx
type_coercion
unc_arr_ptr_in_var_rec
uninitialized_vars
var_arr_attrs
var_arr_typedef gdb/gdbtypes: fix handling of typedef layers between array types 2015-07-23 14:59:58 +02:00
var_rec_arr
variant_record_packed_array
watch_arg
whatis_array_val
widewide
win_fu_syms
access_to_packed_array.exp Fix access_to_packed_array.exp typos/errors 2015-10-27 06:08:45 +01:00
addr_arith.exp
aliased_array.exp
arr_arr.exp
array_bounds.exp
array_char_idx.exp
array_of_variable_length.exp [Ada] Enhance type printing for arrays with variable-sized elements 2015-09-15 23:16:22 +02:00
array_ptr_renaming.exp [Ada] Fix handling of array renamings 2015-09-23 22:14:18 +02:00
array_return.exp
array_subscript_addr.exp
arraydim.exp
arrayidx.exp
arrayparam.exp
arrayptr.exp
assign_1.exp
atomic_enum.exp
attr_ref_and_charlit.exp [Ada] Fix parsing for expressions with attributes and characters 2015-08-20 10:12:24 +02:00
bad-task-bp-keyword.exp
boolean_expr.exp
bp_enum_homonym.exp
bp_on_var.exp
bp_range_type.exp
bp_reset.exp
byte_packed_arr.exp
call_pn.exp
catch_ex.exp
char_enum.exp
char_param.exp
complete.exp [Ada] Fix completion for multiple function matches 2015-09-01 14:54:19 +02:00
cond_lang.exp [testsuite/Ada] stop using project files when building test programs 2015-12-24 09:25:45 +04:00
disc_arr_bound.exp
dot_all.exp
dyn_arrayidx.exp
dyn_loc.exp
enum_idx_packed.exp
exec_changed.exp
expr_delims.exp
exprs.exp
fin_fun_out.exp [Ada] GDB crash during "finish" of function with out parameters 2015-11-09 09:58:16 -08:00
fixed_cmp.exp
fixed_points.exp
float_param.exp
formatted_ref.exp
frame_args.exp
fullname_bp.exp
fun_addr.exp
fun_in_declare.exp
fun_overload_menu.exp Enhance the menu to select function overloads with signatures 2015-12-07 13:32:43 +01:00
fun_renaming.exp [Ada] Add support for subprogram renamings 2015-08-13 09:33:42 +02:00
funcall_char.exp [Ada] Make string_char_type a true TYPE_CODE_CHAR type in Ada 2015-09-03 17:52:05 +02:00
funcall_param.exp
funcall_ref.exp
homonym.exp
info_exc.exp gdb.ada/info_exc.exp: Adjust expected output in "info exception" test. 2015-07-20 15:18:24 -07:00
info_locals_renaming.exp
info_types.c
info_types.exp
int_deref.exp
interface.exp
iwide.exp
lang_switch.exp
Makefile.in
mi_catch_ex.exp
mi_dyn_arr.exp
mi_ex_cond.exp
mi_exc_info.exp
mi_interface.exp
mi_task_arg.exp
mi_task_info.exp
mi_var_array.exp
mod_from_name.exp
n_arr_bound.exp
nested.exp
null_array.exp
null_record.exp
O2_float_param.exp
operator_bp.exp
optim_drec.exp
out_of_line_in_inlined.exp
packed_array.exp
packed_tagged.exp
pckd_arr_ren.exp
pckd_neg.exp
pkd_arr_elem.exp
pp-rec-component.exp
pp-rec-component.py
print_chars.exp
print_pc.exp
ptr_typedef.exp
ptype_arith_binop.exp
ptype_field.exp
ptype_tagged_param.exp
py_range.exp
rdv_wait.exp
rec_comp.exp
rec_return.exp
ref_param.exp
ref_tick_size.exp
same_enum.exp
set_pckd_arr_elt.exp
set_wstr.exp
small_reg_param.exp [testsuite/Ada] stop using project files when building test programs 2015-12-24 09:25:45 +04:00
start.exp
str_ref_cmp.exp
str_uninit.exp
sym_print_name.exp
taft_type.exp
tagged.exp
tagged_access.exp
tagged_not_init.exp
task_bp.exp
tasks.exp
tick_last_segv.exp
tick_length_array_enum_idx.exp
type_coercion.exp
unc_arr_ptr_in_var_rec.exp
uninitialized_vars.exp
var_arr_attrs.exp
var_arr_typedef.exp gdb/gdbtypes: fix handling of typedef layers between array types 2015-07-23 14:59:58 +02:00
var_rec_arr.exp gdb/dwarf2read: Minimal handling of non-constant struct sizes. 2015-11-23 09:44:16 -08:00
variant_record_packed_array.exp
watch_arg.exp
whatis_array_val.exp
widewide.exp
win_fu_syms.exp