[Lldb-commits] [lldb] [lldb] Fix crash missing MSInheritanceAttr on CXXRecordDecl with DWARF on Windows (PR #112928)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 22 05:02:27 PDT 2024


Stefan =?utf-8?q?Gränitz?= <stefan.graenitz at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/112928 at github.com>


Michael137 wrote:

> > I guess a follow-up question is how to set the MSInheritanceAttr. Infer it from the class DIE? Or add a new DWARF attribute?
> > Well, maybe, but not sure. I believe it has a set of attributes that convey the information that MSInheritanceAttr has in the MS ABI. Would such duplication be accepted? And as long as it's just about member pointers, it might not be worth the effort. Let's see.
> 
> I did some more digging and now I wonder: Couldn't `TypeSystemClang::GetBitSize()` just return the pointer-size in bits for `clang::Type::MemberPointer`? That shouldn't even depend on the object it refers to, right?

It is ABI dependent, and we probably do want to rely on Clang to tell us this so we don't reimplement all that logic. E.g., for Itanium, the size for would be `sizeof(ptrdiff_t)` for data members (and double that for function pointers). With the MS ABI it gets more complicated it seems.

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


More information about the lldb-commits mailing list