[Lldb-commits] [lldb] [lldb][DWARF] Delay struct/class/union definition DIE searching when parsing declaration DIEs. (PR #90663)

Zequan Wu via lldb-commits lldb-commits at lists.llvm.org
Mon May 6 08:11:35 PDT 2024


ZequanWu wrote:

> You could enable logging and check for specific logging after steps. In the test I described above if you just print the "Foo *foo" variable, it won't need to complete the definition, you could check for logging, and then if you print "*foo", then it should complete the definition and you should see logging. Not sure if that is what you meant

Added a test with simple template names. 

The example you gave doesn't delay definition DIE searching because even when `p foo`, lldb calls `ValueObject::GetNumChildren` which requires complete type, which I think is also a point of unnecessary operation. The `ValueObjectPrinter::PrintChildrenIfNeeded` below ultimately calls `GetNumChildren`: https://github.com/llvm/llvm-project/blob/1241e7692a466ceb420be2780f1c3e8bbab7d469/lldb/source/DataFormatters/ValueObjectPrinter.cpp#L90-L94. I don't see a setting to disable this. If we could avoid this, this patch could further reduce unnecessary definition DIE searching when user just want to print the value of a pointer (declaration DIE should be enough). 

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


More information about the lldb-commits mailing list