old-cross-binutils/gdb/testsuite/gdb.ada
Joel Brobecker c40cc657bc [Ada] Error adding/subtracting pointer value to/from integral.
When trying to evaluate an expression which adds a pointer and
an integral, the evaluation succeeds if the pointer is on
the left handside of the operator, but not when it is on the right
handside:

    (gdb) p something'address + 0
    $1 = (system.address) 0x613418 <pck.something>
    (gdb) p 0 + something'address
    Argument to arithmetic operation not a number or boolean.

Same issue when doing subtractions:

    (gdb) p something'address - 0
    $2 = (system.address) 0x613418 <pck.something>
    (gdb) p 0 - something'address
    Argument to arithmetic operation not a number or boolean.

This patch enhances the Ada expression evaluator to handle
these two situations.

gdb/ChangeLog:

        * ada-lang.c (ada_evaluate_subexp) <BINOP_ADD>: Add handling
        of the case where the second operand is a pointer.
        <BINOP_SUB>: Likewise.

gdb/testsuite/ChangeLog:

        * gdb.ada/addr_arith: New testcase.

Tested on x86_64-linux.
2014-10-14 14:05:11 -07:00
..
addr_arith [Ada] Error adding/subtracting pointer value to/from integral. 2014-10-14 14:05:11 -07:00
aliased_array Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
array_bounds Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
array_char_idx Try printing array range using the name of its index type 2014-01-27 08:27:21 +04:00
array_return Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
array_subscript_addr Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arraydim Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arrayidx Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arrayparam Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arrayptr Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
atomic_enum Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bad-task-bp-keyword Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_enum_homonym Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_on_var Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_range_type Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_reset Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
call_pn Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
catch_ex Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
char_enum Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
char_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
complete Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
cond_lang Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dot_all Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dyn_arrayidx Add gdb.ada/dyn_arrayidx testcase. 2014-04-28 15:48:11 -04:00
dyn_loc Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
enum_idx_packed Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
exec_changed Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
expr_delims Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
exprs Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fixed_cmp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fixed_points Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
float_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
formatted_ref Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
frame_args Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fullname_bp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fun_addr Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fun_in_declare Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
funcall_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
homonym Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info_exc Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info_locals_renaming Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
int_deref Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
interface Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
iwide Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
lang_switch Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_catch_ex Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_dyn_arr [varobj] false type-changed status for reference to Ada array 2014-03-28 06:22:24 -07:00
mi_ex_cond Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_exc_info Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_interface varobj/Ada: Missing children for interface-wide tagged types 2014-01-07 08:29:04 +04:00
mi_task_arg Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_task_info Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mod_from_name Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
nested Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
null_array Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
null_record Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
O2_float_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
operator_bp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
optim_drec Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
packed_array Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
packed_tagged Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pckd_arr_ren [testsuite/Ada] New testcase for packed array renaming. 2014-03-17 08:45:55 -07:00
pp-rec-component Ada: Fix missing call to pretty-printer for fields of records. 2014-01-07 08:17:40 +04:00
print_chars Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptr_typedef Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptype_field Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptype_tagged_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py_range Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
rdv_wait Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
rec_return Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ref_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ref_tick_size Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
same_enum Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
set_pckd_arr_elt Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
set_wstr Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
small_reg_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
start Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
str_ref_cmp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
sym_print_name Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
taft_type Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tagged Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tagged_access [Ada] Full view of tagged type with ptype 2014-03-10 14:40:35 +01:00
tagged_not_init Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
task_bp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tasks Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tick_last_segv Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tick_length_array_enum_idx Wrong type for 'Length result. 2014-02-10 13:15:43 +04:00
type_coercion Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
unc_arr_ptr_in_var_rec Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
uninitialized_vars Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
variant_record_packed_array Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watch_arg Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
whatis_array_val Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
widewide Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
win_fu_syms Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
addr_arith.exp [Ada] Error adding/subtracting pointer value to/from integral. 2014-10-14 14:05:11 -07:00
aliased_array.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
array_bounds.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
array_char_idx.exp Try printing array range using the name of its index type 2014-01-27 08:27:21 +04:00
array_return.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
array_subscript_addr.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arraydim.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arrayidx.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arrayparam.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arrayptr.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
assign_1.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
atomic_enum.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bad-task-bp-keyword.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
boolean_expr.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_enum_homonym.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_on_var.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_range_type.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_reset.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
call_pn.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
catch_ex.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
char_enum.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
char_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
complete.exp Skip tests on completion and readline when readline lib isn't used 2014-03-26 21:11:08 +08:00
cond_lang.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dot_all.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dyn_arrayidx.exp Add gdb.ada/dyn_arrayidx testcase. 2014-04-28 15:48:11 -04:00
dyn_loc.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
enum_idx_packed.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
exec_changed.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
expr_delims.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
exprs.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fixed_cmp.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fixed_points.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
float_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
formatted_ref.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
frame_args.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fullname_bp.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fun_addr.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fun_in_declare.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
funcall_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
gnat_ada.gpr Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
homonym.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info_exc.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info_locals_renaming.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info_types.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info_types.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
int_deref.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
interface.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
iwide.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
lang_switch.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Makefile.in * Makefile.in (clean): Remove Fission .dwo and .dwp files. 2012-05-17 19:03:59 +00:00
mi_catch_ex.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_dyn_arr.exp [varobj] false type-changed status for reference to Ada array 2014-03-28 06:22:24 -07:00
mi_ex_cond.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_exc_info.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_interface.exp varobj/Ada: Missing children for interface-wide tagged types 2014-01-07 08:29:04 +04:00
mi_task_arg.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_task_info.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mod_from_name.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
nested.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
null_array.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
null_record.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
O2_float_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
operator_bp.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
optim_drec.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
packed_array.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
packed_tagged.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pckd_arr_ren.exp [testsuite/Ada] New testcase for packed array renaming. 2014-03-17 08:45:55 -07:00
pp-rec-component.exp Remove path from gdb.ada/pp-rec-component.exp "source" test 2014-01-10 07:57:11 +04:00
pp-rec-component.py Ada: Fix missing call to pretty-printer for fields of records. 2014-01-07 08:17:40 +04:00
print_chars.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
print_pc.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptr_typedef.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptype_arith_binop.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptype_field.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptype_tagged_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py_range.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
rdv_wait.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
rec_return.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ref_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ref_tick_size.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
same_enum.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
set_pckd_arr_elt.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
set_wstr.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
small_reg_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
start.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
str_ref_cmp.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
sym_print_name.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
taft_type.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tagged.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tagged_access.exp [Ada] Full view of tagged type with ptype 2014-03-10 14:40:35 +01:00
tagged_not_init.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
task_bp.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tasks.exp Multiple Ada task-specific breakpoints at the same address. 2014-02-26 14:22:33 +00:00
tick_last_segv.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tick_length_array_enum_idx.exp Wrong type for 'Length result. 2014-02-10 13:15:43 +04:00
type_coercion.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
unc_arr_ptr_in_var_rec.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
uninitialized_vars.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
variant_record_packed_array.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watch_arg.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
whatis_array_val.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
widewide.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
win_fu_syms.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00