labath wrote:

IIUC, your debugger parses all of debug info upfront and builds up a vtable 
pointer->class DIE map. That's not something we would want to do in lldb, but I 
think we could still make use of this by first searching for the type using the 
name from the vtable (like we do now) and then confirming the match using the 
new information. It would be better if we could go from the vtable pointer 
straight to the right type DIE, but I don't think we can do that without 
inventing a new sort of an accelerator table (which I guess we don't have an 
appetite for).

> To work out which class A this refers to would involve parsing the template 
> parameter correctly and matching to the correct anonymous namespace. While 
> this technically isn’t impossible

Are you sure about that? Anonymous types are confined to a single CU 
statically, but their values can definitely leak out at runtime. So if I'm 
stopped in a random CU and I see am object whose dynamic type is `(anonymous 
namespace)::X`, I don't see how one could determine which type (out of possibly 
many) is that vtable referring to.

https://github.com/llvm/llvm-project/pull/130255
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to