aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectThread.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2022-02-14 15:49:37 -0800
committerJim Ingham <jingham@apple.com>2022-02-14 15:53:24 -0800
commit793924dd5f2ad0663f77a09f09d11adaa4ce2b91 (patch)
tree694851d4a3a4e3fb3e461c2f7faf71c1d3ddf8cf /lldb/source/Commands/CommandObjectThread.cpp
parent635f03fe976e250cc64999663f47716412dfa029 (diff)
downloadllvm-793924dd5f2ad0663f77a09f09d11adaa4ce2b91.zip
llvm-793924dd5f2ad0663f77a09f09d11adaa4ce2b91.tar.gz
llvm-793924dd5f2ad0663f77a09f09d11adaa4ce2b91.tar.bz2
Fix an incorrect assumption in "thread until": code with debug info is not always in a function.
Some dyld cross library stubs can have line information but no function. Make sure you check that you have a valid Function object before asking it questions. Differential Revision: https://reviews.llvm.org/D119297
Diffstat (limited to 'lldb/source/Commands/CommandObjectThread.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index 4108adf..bd491e5 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -1012,7 +1012,14 @@ protected:
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,