[Lldb-commits] [PATCH] D49410: [PDB] Parse UDT symbols and pointers to members

Hui Huang via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 18 22:03:00 PDT 2018

Hui added inline comments.

Comment at: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp:588
+    if (result->GetID() == type_uid) {
+      pdb->CompleteRecordTypeForPDBSymbol(*pdb_type, result);
+    }
aleksandr.urakov wrote:
> What are the advantages and disadvantages of immediate (here) and deferred (at the `CompleteType` function) completions? I thought that deferred completion is a kind of lazy optimization, so we lost its advantages?
I think the initial purpose was that the 'incomplete' can be detected immediately after 'first' parsing and then solved immediately. 

The deferred type completion can encounter a drawback (maybe be worked around by using lock)

a. the deferred procedure could happen during the 'm_types' (TypeList)" dumping
b. the deferred output could add new types to the 'm_types'.
c. see below. The dump implementation of TypeList. 
It will result in undefined behavior if a list is expanded while accessing it with iterator.

void TypeList::Dump(Stream *s, bool show_context) {
  for (iterator pos = m_types.begin(), end = m_types.end(); pos != end; ++pos) {
    pos->get()->Dump(s, show_context);

In this sense, https://reviews.llvm.org/D49368 has a better solution.


More information about the lldb-commits mailing list