Re: [PATCH 7/9] Add ptype support for DWARF-based fixed-point types

Joel Brobecker
2020-11-15T07:09:09Z

> > > + gdb_test_no_output "set language $lang" \
> > > + "set language to $lang for ptype test"
> > > +
> > > + gdb_test "ptype pck__fp1_var" $fp1_re
> > > +
> > > + gdb_test "ptype pck__fp2_var" $fp2_re
> > > +
> > > + gdb_test "ptype pck__fp3_var" $fp3_re
> > > +
> > > + if { $lang == "modula-2" || $lang == "pascal" } {
> > > + setup_xfail "*-*-*" "not supported by language"
> > > + }
> >
> > Can you give more details about this? What prevents these languages
> > from printing <range type>? I'm confused, because as far as I can tell
> > C doesn't support range types more than these two languages, and it's
> > able to print <range type>.
>
> Both trigger the following error:
>
> (gdb) ptype pck__fp1_range_var
> type = [Invalid type code in symbol table.
>
> It didn't seem to be worth the effort of going any further than that,
> because I didn't didn't think either language would have fixed point
> types.

I should probably expand a bit: I tried to make the implementation
of this feature as generic as possible, so that all current and
future languages that provide support for these kinds of types can
benefit from it with as little work as possible. For some reason,
this doesn't work for M2 and Pascal, and the decision I made at
the time was to ignore these issues on the basis that these are errors
a real user is unlikely to hit.

--
Joel