From bbcdf9ab73018ff43855945fd72c642a67437d8b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 2 Mar 2021 13:08:24 -0700 Subject: Rewrite GNAT-encoded fixed point types in DWARF reader gdb currently supports two different styles of fixed-point. The original style, where fixed point types are "GNAT encoded", is handled primarily in the Ada code. The newer style, encoded using DWARF, is handled by the core of gdb. This patch changes gdb to read the GNAT encodings in the DWARF reader as well. This removes some code and unifies the two paths. As a result, GNAT-encoded fixed-point now works a bit better. One possible drawback of this change is that, if someone uses stabs, then fixed-point might now stop working. I consider stabs to be fully obsolete, though, so I don't intend to address this. gdb/ChangeLog 2021-03-02 Tom Tromey * ada-lang.c (cast_from_gnat_encoded_fixed_point_type) (cast_to_gnat_encoded_fixed_point_type): Remove. (ada_value_cast, ada_evaluate_subexp): Update. (gnat_encoded_fixed_point_type_info) (ada_is_gnat_encoded_fixed_point_type) (gnat_encoded_fixed_point_delta) (gnat_encoded_fixed_point_scaling_factor): Remove. * ada-lang.h (ada_is_gnat_encoded_fixed_point_type) (gnat_encoded_fixed_point_delta) (gnat_encoded_fixed_point_scaling_factor): Don't declare. * ada-typeprint.c (print_gnat_encoded_fixed_point_type): Remove. (ada_print_type): Update. * ada-valprint.c (ada_value_print_num): Update. * dwarf2/read.c (ada_get_gnat_encoded_number) (ada_get_gnat_encoded_ratio): New functions. (finish_fixed_point_type): Use them. Add parameters. (GNAT_FIXED_POINT_SUFFIX): New define. (gnat_encoded_fixed_point_type_info): New function. (read_base_type): Handle gnat encodings. gdb/testsuite/ChangeLog 2021-03-02 Tom Tromey * gdb.ada/fixed_points.exp: Remove most special cases for minimal encodings. --- gdb/ada-lang.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'gdb/ada-lang.h') diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index 8be4bf4..c380733 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -280,14 +280,8 @@ extern struct type *ada_aligned_type (struct type *); extern const gdb_byte *ada_aligned_value_addr (struct type *, const gdb_byte *); -extern int ada_is_gnat_encoded_fixed_point_type (struct type *); - extern int ada_is_system_address_type (struct type *); -extern struct value *gnat_encoded_fixed_point_delta (struct type *); - -extern struct value *gnat_encoded_fixed_point_scaling_factor (struct type *); - extern int ada_which_variant_applies (struct type *, struct value *); extern struct type *ada_to_fixed_type (struct type *, const gdb_byte *, -- cgit v1.1