[Lldb-commits] [lldb] [lldb] Add SymbolContext::GetAddress (PR #123340)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Fri Jan 17 05:33:25 PST 2025
================
@@ -370,6 +370,31 @@ bool SymbolContext::GetAddressRange(uint32_t scope, uint32_t range_idx,
return false;
}
+Address SymbolContext::GetAddress(uint32_t scope,
+ bool use_inline_block_range) const {
+ if ((scope & eSymbolContextLineEntry) && line_entry.IsValid())
+ return line_entry.range.GetBaseAddress();
+
+ if (scope & eSymbolContextBlock) {
+ Block *block_to_use = (block && use_inline_block_range)
+ ? block->GetContainingInlinedBlock()
+ : block;
+ if (block_to_use) {
+ Address addr;
+ block_to_use->GetStartAddress(addr);
+ return addr;
+ }
+ }
----------------
labath wrote:
I have very mixed opinions about this part. The symmetry with GetAddressRange is very nice, but OTOH I'm having trouble imagining a use of these flags which wouldn't be a bug.
https://github.com/llvm/llvm-project/pull/123340
More information about the lldb-commits
mailing list