[Lldb-commits] [lldb] [LLDB/Coredump] Only take the Pthread from stack start to the stackpointer + red_zone (PR #92002)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu May 16 10:45:25 PDT 2024


================
@@ -490,9 +491,12 @@ findStackHelper(const lldb::ProcessSP &process_sp, uint64_t rsp) {
     return llvm::createStringError(
         std::errc::not_supported,
         "unable to load stack segment of the process");
-
-  const addr_t addr = range_info.GetRange().GetRangeBase();
-  const addr_t size = range_info.GetRange().GetByteSize();
+  // This is a duplicate of the logic in Process::SaveOffRegionsWithStackPointers
+  // but ultimately, we need to only save up from the start of `the stack down to the stack pointer.
+  const addr_t range_end = range_info.GetRange().GetRangeEnd();
+  const size_t red_zone = process_sp->GetABI()->GetRedZoneSize();
----------------
clayborg wrote:

In general we don't want to use `size_t`, it is 32 bits on 32 bit system and 64 on 64 bit systems. Change to `addr_t`

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


More information about the lldb-commits mailing list