[Lldb-commits] [lldb] [lldb] Make StoppointSite class non-polymorphic (PR #190206)

Sergei Barannikov via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 3 04:04:39 PDT 2026


s-barannikov wrote:

> The lack of code sharing between Watchpoints and Breakpoint is a longstanding issue. I'd rather fix that (in which case we _may_ start using StoppointSite polymorphically) rather than accept defeat and go in the opposite direction.

> On top of that, I think this is rather confusing and looks more like a mistake than something intentional. If we don't want to use the class polymorphically, I would expect private inheritance instead.

The base class provides a couple of methods that are common to both BreakpointSite and Watchpoint, they have to be public. In its current form, the only purpose of this class is to reduce minor code duplication. I guess we can share more, but that doesn't mean that the base class has to be polymorphic.

I still think there is something that can be cleaned up (like removing `virtual` on `GetLoadAddress()`/`SetLoadAddress()` and unused `ShouldStop()` methods), but it's not worth the effort. Closing.


https://github.com/llvm/llvm-project/pull/190206


More information about the lldb-commits mailing list