[Lldb-commits] [PATCH] D116195: [LLDB] Allows overwriting the existing line entry at given file address when inserting

Zequan Wu via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 23 12:14:46 PST 2021

zequanwu added a comment.

In D116195#3207672 <https://reviews.llvm.org/D116195#3207672>, @labath wrote:

> How are you planning to make use of this functionality?
> I'm asking because I'm wondering if it wouldn't be better to do this kind of processing in the PDB code, and then hand this class a finished list of line entries. Inserting entries into the middle of a vector is expensive, which is why our dwarf code no longer uses this function (it uses the vector<LineSequence> constructor instead). If we could get pdb to do something similar, then we could get rid of this function altogether.

My plan was to insert entries when parsing inlined call site(`S_INLINESITE `) in ParseBlocksRecursive, which usually happens after ParseLineTable. In PDB, line entries in inlined call site often have same file addresses as line entries in line table, and the former is better since it describes lines inside inlined function rather than lines in caller. And we could have nested inlined call sites. The line entries from inner call sites would always overwrite the line entries from the outer call sites if they have the same file address.

Maybe it's better to use a set to store the line entries, ordering just by the file address so that insertion is cheaper? Currently, it compares other fields if two lines have same file address (https://github.com/llvm/llvm-project/blob/main/lldb/source/Symbol/LineTable.cpp#L150). Is it necessary? I think line entries in line table always have distinct file address.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list