aboutsummaryrefslogtreecommitdiff
path: root/gdb/p-typeprint.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2020-11-15 03:16:01 -0500
committerJoel Brobecker <brobecker@adacore.com>2020-11-15 03:16:01 -0500
commit0c9150e4de689066b6d7faf326535f573bd29f07 (patch)
tree62924148c20209d711a6e501d10f787a6db4ffb1 /gdb/p-typeprint.c
parentb26daff97cd885640e23229a3d164cd9d93c49ef (diff)
downloadgdb-0c9150e4de689066b6d7faf326535f573bd29f07.zip
gdb-0c9150e4de689066b6d7faf326535f573bd29f07.tar.gz
gdb-0c9150e4de689066b6d7faf326535f573bd29f07.tar.bz2
Add ptype support for DWARF-based fixed-point types
Note that the ptype information printed for types described via pure DWARF debug info is slightly less informative as the one printed when the information is encoded in the type's name, via the GNAT encoding. As a result, the output in the case of DWARF-described fixed point types is slightly different. In pratice, this is no real loss because the information not available in DWARF has no bearing on how the type is actually stored in memory. gdb/ChangeLog: * ada-typeprint.c (ada_print_type): Add handing of fixed-point range types. * c-typeprint.c (c_type_print_varspec_prefix) (c_type_print_varspec_suffix, c_type_print_base_1): Add TYPE_CODE_FIXED_POINT handling. * p-typeprint.c (pascal_type_print_varspec_prefix) (pascal_type_print_varspec_suffix): Likewise. * typeprint.c (print_type_fixed_point): New function. * typeprint.h (print_type_fixed_point): Add declaration. gdb/testsuite/ChangeLog: * gdb.ada/fixed_points.exp: Add ptype tests. * gdb.dwarf2/dw2-fixed-point.exp: Likewise.
Diffstat (limited to 'gdb/p-typeprint.c')
-rw-r--r--gdb/p-typeprint.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c
index ef0f254..c2c182a 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -296,6 +296,7 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
case TYPE_CODE_STRING:
case TYPE_CODE_COMPLEX:
case TYPE_CODE_TYPEDEF:
+ case TYPE_CODE_FIXED_POINT:
/* These types need no prefix. They are listed here so that
gcc -Wall will reveal any types that haven't been handled. */
break;
@@ -429,6 +430,7 @@ pascal_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
case TYPE_CODE_STRING:
case TYPE_CODE_COMPLEX:
case TYPE_CODE_TYPEDEF:
+ case TYPE_CODE_FIXED_POINT:
/* These types do not need a suffix. They are listed so that
gcc -Wall will report types that may not have been considered. */
break;