[Lldb-commits] [lldb] [lldb] Fix "in function" detection in "thread until" (PR #123622)

via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 29 10:46:00 PST 2025


================
@@ -1007,29 +1009,29 @@ class CommandObjectThreadUntil : public CommandObjectParsed {
             addr_t address =
                 line_entry.range.GetBaseAddress().GetLoadAddress(target);
             if (address != LLDB_INVALID_ADDRESS) {
-              if (fun_addr_range.ContainsLoadAddress(address, target))
+              AddressRange unused;
+              if (sc.function->GetRangeContainingLoadAddress(address, *target,
+                                                             unused))
                 address_list.push_back(address);
-              else
-                all_in_function = false;
             }
             start_idx_ptr++;
           }
         }
 
         for (lldb::addr_t address : m_options.m_until_addrs) {
-          if (fun_addr_range.ContainsLoadAddress(address, target))
+          AddressRange unused;
+          if (sc.function->GetRangeContainingLoadAddress(address, *target,
+                                                         unused))
             address_list.push_back(address);
-          else
-            all_in_function = false;
         }
 
         if (address_list.empty()) {
----------------
jimingham wrote:

Since you only care here about `found_something` and `address_list.size > 0` could you short-circuit this search when you find the first address that matches the line?

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


More information about the lldb-commits mailing list