Correctly print subrange types in generic_value_print
authorTom Tromey <tromey@adacore.com>
Thu, 10 Mar 2022 16:23:45 +0000 (09:23 -0700)
committerTom Tromey <tromey@adacore.com>
Mon, 14 Mar 2022 12:58:12 +0000 (06:58 -0600)
commit79a0742380b5304c734ce6f4359d437325cc7121
treee3184cf4db3b81553d449cd4c4dc100633b80348
parentbab22d0640914384d467e09c3e796585fd08e7c6
Correctly print subrange types in generic_value_print

I noticed that generic_value_print assumes that a subrange type is
always a subrange of an integer type.  However, this isn't necessarily
the case.  In Ada, for example, one has subranges of character and
enumeration types.

This code isn't often exercised, I think, because languages with real
subrange types tend to implement their own printers.  However, it
still seemed worth fixing.
gdb/testsuite/gdb.dwarf2/subrange-enum.exp [new file with mode: 0644]
gdb/valprint.c