[PATCH] Make breakpoint subclasses inherit from breakpoint, add virtual destructor

Pedro Alves palves@redhat.com
Wed May 3 15:27:00 GMT 2017


On 05/03/2017 04:23 PM, Simon Marchi wrote:

> FYI, I just looked at it, and it looks like the
> momentary_breakpoint/longjmp_breakpoint hierarchy will cause a bit of
> trouble.  longjmp_breakpoint has a dtor, but no struct/class of its own,
> so nowhere to put the destructor.  I think that to do it correctly, I'll
> have to introduce structs/classes for them and have:
> 
>   breakpoint
>       ^
>       |
>   momentary_breakpoint
>       ^
>       |
>   longjmp_breakpoint
> 
> To keep it clean, it might be better if I introduced the structs/classes
> for momentary_breakpoint and longjmp_breakpoint first with the old-style
> inheritance, and then converted them to "real" inheritance along with
> the other types.

That sounds fine to me.

> 
> I'll try that tonight, but if you have ideas in the mean time, I'm all
> ears.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list