Re: [PATCH 5/9] Add support for printing value of DWARF-based fixed-point type objects

Joel Brobecker
2020-11-15T05:31:02Z

> On 2020-11-14 6:30 a.m., Joel Brobecker wrote:
> > Can you tell me if the attached patch corresponds to what you had
> > in mind? As the revlog suggests, it's missing a bit of doc around it,
> > but I wanted to make sure I did this correctly before adding the forms.
>
> Yes, that looks fine, thanks.

Thanks for the pre-review, Simon, and confirming I was on the right
track.

> I would split the following assert in two:
>
> gdb_assert (this->code () == TYPE_CODE_FIXED_POINT
> && this->main_type->type_specific.fixed_point_info != nullptr);
>
> because if it fails, it makes it easier at first glance to know which
> condition was false.

Indeed. That's a good idea.

> Otherwise, that is fine with me. I think the whole type-specific stuff
> management will have to be redesigned at some point anyway, so that we
> can use non-POD types in there.

Agreed.

One even bigger dream of mine was to have our struct type become
a hierarchy of classes, rather than just one. Then the type-specific
stuff gets taken care of via class extension...

--
Joel