[Lldb-commits] [lldb] [lldb/Interpreter] Surface Python exceptions from scripted extensions (PR #198153)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 27 17:03:21 PDT 2026


================
@@ -14,7 +14,7 @@
 #include "ScriptedInterface.h"
 
 namespace lldb_private {
-class ScriptedHookInterface : public ScriptedInterface {
+class ScriptedHookInterface : virtual public ScriptedInterface {
----------------
medismailben wrote:

> That talk didn't in fact mention that both ScriptedInterfaceBreakpoint and ScriptedInterfacePython (which seems more like a helper than an interface per se) both inherit from ScriptedInterface...

I don't think ScriptedInterfaceBreakpoint existed back then.

> I couldn't see anything in this patch that would require you have a diamond graph rather than two copies of the ScriptedInterface data. What required that?

Without the virtual inheritance, each leaf class (derived from 2 subclasses of `ScriptedInterface`) would see each of the `ScriptedInterface` members (`m_object_instance_sp`) & methods twice. Virtual inheritance collapses that into a single shared `ScriptedInterface` subobject at the top of the hierarchy so every path down to it resolves to the same instance.

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


More information about the lldb-commits mailing list