diff options
author | Joel Brobecker <brobecker@adacore.com> | 2020-11-01 02:29:27 -0500 |
---|---|---|
committer | Joel Brobecker <brobecker@adacore.com> | 2020-11-01 02:29:27 -0500 |
commit | 75f24e86bacd5b4832b8af12e2aef59c9f769335 (patch) | |
tree | 99214130d9f1bbf6617f62335b1c6dba39824a00 /gdb/ada-lang.c | |
parent | 80630624b4c224908b745b8a5396ff2e40896a30 (diff) | |
download | gdb-75f24e86bacd5b4832b8af12e2aef59c9f769335.zip gdb-75f24e86bacd5b4832b8af12e2aef59c9f769335.tar.gz gdb-75f24e86bacd5b4832b8af12e2aef59c9f769335.tar.bz2 |
ada-lang.c: Renaming some fixed-point-related routines
This patch renames some of the fixed-point-related subprograms in ada-lang.c
so as to make it obvious that those routines only handle the case where
the types are encoded using the GNAT encoding.
No function change; this patch is preparation work for adding support
for fixed-point types purely based on standard DWARF debug info.
gdb/ChangeLog:
* ada-lang.c (cast_from_gnat_encoded_fixed_point_type): Renames
cast_from_fixed. Update all callers.
(cast_to_gnat_encoded_fixed_point_type): Renames cast_to_fixed.
Update all callers.
(gnat_encoded_fixed_point_scaling_factor): Renames ada_scaling_factor.
Update all callers.
* ada-lang.h (gnat_encoded_fixed_point_scaling_factor): Renames
ada_scaling_factor.
* ada-typeprint.c: Replace call to ada_scaling_factor by call
to print_gnat_encoded_fixed_point_type.
* ada-valprint.c: Likewise.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 9aba814..c0c440d 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -9170,9 +9170,9 @@ unwrap_value (struct value *val) } static struct value * -cast_from_fixed (struct type *type, struct value *arg) +cast_from_gnat_encoded_fixed_point_type (struct type *type, struct value *arg) { - struct value *scale = ada_scaling_factor (value_type (arg)); + struct value *scale = gnat_encoded_fixed_point_scaling_factor (value_type (arg)); arg = value_cast (value_type (scale), arg); arg = value_binop (arg, scale, BINOP_MUL); @@ -9180,14 +9180,14 @@ cast_from_fixed (struct type *type, struct value *arg) } static struct value * -cast_to_fixed (struct type *type, struct value *arg) +cast_to_gnat_encoded_fixed_point_type (struct type *type, struct value *arg) { if (type == value_type (arg)) return arg; - struct value *scale = ada_scaling_factor (type); + struct value *scale = gnat_encoded_fixed_point_scaling_factor (type); if (ada_is_gnat_encoded_fixed_point_type (value_type (arg))) - arg = cast_from_fixed (value_type (scale), arg); + arg = cast_from_gnat_encoded_fixed_point_type (value_type (scale), arg); else arg = value_cast (value_type (scale), arg); @@ -9735,10 +9735,10 @@ ada_value_cast (struct type *type, struct value *arg2) return arg2; if (ada_is_gnat_encoded_fixed_point_type (type)) - return cast_to_fixed (type, arg2); + return cast_to_gnat_encoded_fixed_point_type (type, arg2); if (ada_is_gnat_encoded_fixed_point_type (value_type (arg2))) - return cast_from_fixed (type, arg2); + return cast_from_gnat_encoded_fixed_point_type (type, arg2); return value_cast (type, arg2); } @@ -10138,7 +10138,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, /* Nothing. */ } else if (ada_is_gnat_encoded_fixed_point_type (value_type (arg1))) - arg2 = cast_to_fixed (value_type (arg1), arg2); + arg2 = cast_to_gnat_encoded_fixed_point_type (value_type (arg1), arg2); else if (ada_is_gnat_encoded_fixed_point_type (value_type (arg2))) error (_("Fixed-point values must be assigned to fixed-point variables")); @@ -10216,9 +10216,9 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, { type = builtin_type (exp->gdbarch)->builtin_double; if (ada_is_gnat_encoded_fixed_point_type (value_type (arg1))) - arg1 = cast_from_fixed (type, arg1); + arg1 = cast_from_gnat_encoded_fixed_point_type (type, arg1); if (ada_is_gnat_encoded_fixed_point_type (value_type (arg2))) - arg2 = cast_from_fixed (type, arg2); + arg2 = cast_from_gnat_encoded_fixed_point_type (type, arg2); binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2); return ada_value_binop (arg1, arg2, op); } @@ -11188,7 +11188,7 @@ gnat_encoded_fixed_point_delta (struct type *type) the scaling factor ('SMALL value) associated with the type. */ struct value * -ada_scaling_factor (struct type *type) +gnat_encoded_fixed_point_scaling_factor (struct type *type) { const char *encoding = gnat_encoded_fixed_type_info (type); struct type *scale_type = ada_scaling_type (type); |