[lldb-dev] type completion

Ryan Brown via lldb-dev lldb-dev at lists.llvm.org
Wed Sep 2 15:15:51 PDT 2015


I'm trying to implement a DWARFASTParser for go, and have hit an issue with
fields for structs.
As I understand it, DWARFASTParserClang loads minimal type info for structs
at first, and registers the type in SymbolFileDWARF's
m_forward_decl_clang_type_to_die.
Then later when you call type.GetFullCompilerType() it calls back into the
DWARFASTParser to complete the type.

But it seems like the SBValue's in the python API only get Forward types,
and never complete them. For example, I do:
var = frame.FindVariable('theStruct')
self.assertEqual(2, var.GetNumChildren())

But I get 0 children, because the type is incomplete and there doesn't seem
to be any way to complete it.
ValueObject::GetNumChildren goes through
ValueObject::MaybeCalculateCompleteType, which seems promising. But it only
completes the type for objc.
Would a clang variable already have a full type at this point for some
reason? If so, how do I arrange that for go?

Also, TypeSystem has a GetCompleteType method. I don't understand when this
would be called or how I can implement it without a reference to
SymbolFileDWARF.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150902/5c8ff68e/attachment.html>


More information about the lldb-dev mailing list