llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Pavel Labath (labath)

<details>
<summary>Changes</summary>

No test because generating discontinous functions is tedious and there's 
nothing particularly interesting happening in here. As long as the analyzer 
stays within a single basic block. it doesn't really care whether the function 
is discontinous or not. I could create cases where the algorithm breaks when 
going across basic blocks, but that's more of inherent limitation of the 
algorithm (the inability to follow jumps "backwards") than something specific 
to discontinous functions.

At this point, I'm more interested in cleaning up the last few remaining uses 
of the deprecated function that I'm about improving "frame diagnose".

---
Full diff: https://github.com/llvm/llvm-project/pull/130949.diff


1 Files Affected:

- (modified) lldb/source/Target/StackFrame.cpp (+6-10) 


``````````diff
diff --git a/lldb/source/Target/StackFrame.cpp 
b/lldb/source/Target/StackFrame.cpp
index d92b7d8b9d899..bab36e9aa1033 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -1783,15 +1783,11 @@ lldb::ValueObjectSP 
StackFrame::GuessValueForRegisterAndOffset(ConstString reg,
     return ValueObjectSP();
   }
 
-  AddressRange pc_range = function->GetAddressRange();
-
-  if (GetFrameCodeAddress().GetFileAddress() <
-          pc_range.GetBaseAddress().GetFileAddress() ||
-      GetFrameCodeAddress().GetFileAddress() -
-              pc_range.GetBaseAddress().GetFileAddress() >=
-          pc_range.GetByteSize()) {
+  AddressRange unused_range;
+  if (!function->GetRangeContainingLoadAddress(
+          GetFrameCodeAddress().GetLoadAddress(target_sp.get()), *target_sp,
+          unused_range))
     return ValueObjectSP();
-  }
 
   const char *plugin_name = nullptr;
   const char *flavor = nullptr;
@@ -1799,8 +1795,8 @@ lldb::ValueObjectSP 
StackFrame::GuessValueForRegisterAndOffset(ConstString reg,
   const char *features = nullptr;
   const bool force_live_memory = true;
   DisassemblerSP disassembler_sp = Disassembler::DisassembleRange(
-      target_arch, plugin_name, flavor, cpu, features, *target_sp, pc_range,
-      force_live_memory);
+      target_arch, plugin_name, flavor, cpu, features, *target_sp,
+      function->GetAddressRanges(), force_live_memory);
 
   if (!disassembler_sp || !disassembler_sp->GetInstructionList().GetSize()) {
     return ValueObjectSP();

``````````

</details>


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

Reply via email to