[Lldb-commits] [PATCH] D125437: [lldb/API] Add SBCompileUnit::GetIndexForLineEntry method to SB API

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 11 17:41:05 PDT 2022


mib added inline comments.


================
Comment at: lldb/source/API/SBCompileUnit.cpp:94
+
+    if (!exact ||
+        (exact && !LineEntry::Compare(line_entry.ref(), found_line_entry)))
----------------
jingham wrote:
> Why do you have to do this Compare?  You already passed exact to FindLineEntry, does FindLineEntry really return line entries that fail your Compare test when exact is passed in as true?  That doesn't seem right.
`exact` could be false, in which case the line entry index returned by `FindLineEntry` will be different from the one provided by the user.

But if the user really wants the exact line entry index, we need to compare the returned line entry and the one provided by the user.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125437/new/

https://reviews.llvm.org/D125437



More information about the lldb-commits mailing list