[Lldb-commits] [lldb] Add the ability to break on call-site locations, improve inline stepping (PR #112939)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 21 11:03:44 PDT 2024


================
@@ -87,6 +87,22 @@ void BreakpointSite::GetDescription(Stream *s, lldb::DescriptionLevel level) {
   m_constituents.GetDescription(s, level);
 }
 
+std::optional<uint32_t> BreakpointSite::GetSuggestedStackFrameIndex() {
+
+  std::optional<uint32_t> result;
+  std::lock_guard<std::recursive_mutex> guard(m_constituents_mutex);
+  for (BreakpointLocationSP loc_sp : m_constituents.BreakpointLocations()) {
+    std::optional<uint32_t> this_result = loc_sp->GetSuggestedStackFrameIndex();
+    if (this_result) {
+      if (!result)
+        result = this_result;
+      else
+        result = std::max(*this_result, *result);
----------------
clayborg wrote:

reverse the logic here?
```
      if (result)
        result = std::max(*this_result, *result);
      else
        result = this_result;
```        

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


More information about the lldb-commits mailing list