diff options
author | Pavel Labath <pavel@labath.sk> | 2025-03-13 13:35:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-13 13:35:00 +0100 |
commit | a413ef83a16b1069ca953613f1ff495f702970b4 (patch) | |
tree | cf05e67bbaa741fe5d128bb17f50215e6a1faea7 /lldb/source/Target/StackFrame.cpp | |
parent | d3255474be3ea24d876eadb6e97a6424c132b23d (diff) | |
download | llvm-a413ef83a16b1069ca953613f1ff495f702970b4.zip llvm-a413ef83a16b1069ca953613f1ff495f702970b4.tar.gz llvm-a413ef83a16b1069ca953613f1ff495f702970b4.tar.bz2 |
[lldb] Use Function::GetAddressRange*s* in "frame diagnose" (#130949)
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".
Diffstat (limited to 'lldb/source/Target/StackFrame.cpp')
-rw-r--r-- | lldb/source/Target/StackFrame.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp index d92b7d8..bab36e9 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(); |