Skip to content

Commit a413ef8

Browse files
authored
[lldb] Use Function::GetAddressRange*s* in "frame diagnose" (llvm#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".
1 parent d325547 commit a413ef8

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

lldb/source/Target/StackFrame.cpp

+6-10
Original file line numberDiff line numberDiff line change
@@ -1783,24 +1783,20 @@ lldb::ValueObjectSP StackFrame::GuessValueForRegisterAndOffset(ConstString reg,
17831783
return ValueObjectSP();
17841784
}
17851785

1786-
AddressRange pc_range = function->GetAddressRange();
1787-
1788-
if (GetFrameCodeAddress().GetFileAddress() <
1789-
pc_range.GetBaseAddress().GetFileAddress() ||
1790-
GetFrameCodeAddress().GetFileAddress() -
1791-
pc_range.GetBaseAddress().GetFileAddress() >=
1792-
pc_range.GetByteSize()) {
1786+
AddressRange unused_range;
1787+
if (!function->GetRangeContainingLoadAddress(
1788+
GetFrameCodeAddress().GetLoadAddress(target_sp.get()), *target_sp,
1789+
unused_range))
17931790
return ValueObjectSP();
1794-
}
17951791

17961792
const char *plugin_name = nullptr;
17971793
const char *flavor = nullptr;
17981794
const char *cpu = nullptr;
17991795
const char *features = nullptr;
18001796
const bool force_live_memory = true;
18011797
DisassemblerSP disassembler_sp = Disassembler::DisassembleRange(
1802-
target_arch, plugin_name, flavor, cpu, features, *target_sp, pc_range,
1803-
force_live_memory);
1798+
target_arch, plugin_name, flavor, cpu, features, *target_sp,
1799+
function->GetAddressRanges(), force_live_memory);
18041800

18051801
if (!disassembler_sp || !disassembler_sp->GetInstructionList().GetSize()) {
18061802
return ValueObjectSP();

0 commit comments

Comments
 (0)