================
@@ -6410,12 +6410,20 @@ GetCoreFileSaveRangesStackOnly(Process &process,
     if (!reg_ctx_sp)
       continue;
     const addr_t sp = reg_ctx_sp->GetSP();
+    const size_t red_zone = process.GetABI()->GetRedZoneSize();
     lldb_private::MemoryRegionInfo sp_region;
     if (process.GetMemoryRegionInfo(sp, sp_region).Success()) {
       // Only add this region if not already added above. If our stack pointer
       // is pointing off in the weeds, we will want this range.
-      if (stack_bases.count(sp_region.GetRange().GetRangeBase()) == 0)
+      if (stack_bases.count(sp_region.GetRange().GetRangeBase()) == 0) {
+        // Take only the start of the stack to the stack pointer and include 
the redzone.
+        // Because stacks grow 'down' to include the red_zone we have to 
subtract it from the sp.
+        const size_t stack_head = (sp - red_zone);
+        const size_t stack_size = sp_region.GetRange().GetRangeEnd() - 
(stack_head);
----------------
clayborg wrote:

remove `()` around `stack_head`

https://github.com/llvm/llvm-project/pull/92002
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to