[Lldb-commits] [PATCH] D119297: "thread until": make sure the current function is valid before asking it questions

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 14 15:54:17 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG793924dd5f2a: Fix an incorrect assumption in "thread until": code with debug info is not… (authored by jingham).

Changed prior to commit:
  https://reviews.llvm.org/D119297?vs=406995&id=408660#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119297

Files:
  lldb/source/Commands/CommandObjectThread.cpp


Index: lldb/source/Commands/CommandObjectThread.cpp
===================================================================
--- lldb/source/Commands/CommandObjectThread.cpp
+++ lldb/source/Commands/CommandObjectThread.cpp
@@ -1012,7 +1012,14 @@
         uint32_t index_ptr = 0, end_ptr;
         std::vector<addr_t> address_list;
 
-        // Find the beginning & end index of the        
+        // Find the beginning & end index of the function, but first make
+        // sure it is valid:
+        if (!sc.function) {
+          result.AppendErrorWithFormat("Have debug information but no "
+                                       "function info - can't get until range.");
+          return false;
+        }
+
         AddressRange fun_addr_range = sc.function->GetAddressRange();
         Address fun_start_addr = fun_addr_range.GetBaseAddress();
         line_table->FindLineEntryByAddress(fun_start_addr, function_start,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119297.408660.patch
Type: text/x-patch
Size: 928 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220214/813482b8/attachment.bin>


More information about the lldb-commits mailing list