[RFA v2 16/17] Convert dwarf_expr_context_funcs to methods

Tom Tromey tom@tromey.com
Wed Oct 19 22:29:00 GMT 2016


>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> Hmm.  I guess the actual code smell is that these are internal_errors
Pedro> instead of normal errors in the first place?  I.e., why are these two
Pedro> cases internal_errors when the rest of the virtual methods have
Pedro> defaults that call normal error instead?

Pedro> Put another way, is there something in the inheritance design that
Pedro> makes calling these default implementations a gdb bug?

Pedro> So I'm wondering whether invalid dwarf (i.e., input) or something
Pedro> like that could trigger these internal errors?

I looked at this more concretely today by changing the
internal_error-calling methods to be pure virtual, then rebuilding.

This showed that the only missing overrides were in dwarf2-frame, where
I think both push_dwarf_reg_entry_value and get_object_address don't
make sense.

So, I'll send a follow-up patch that implements these using error and
uses pure virtuals.

Tom



More information about the Gdb-patches mailing list