[Lldb-commits] [lldb] [lldb] Add DWARFExpressionEntry and GetExpressionEntryAtAddress() to … (PR #144238)
Abdullah Mohammad Amin via lldb-commits
lldb-commits at lists.llvm.org
Sat Jun 28 10:17:58 PDT 2025
================
@@ -53,6 +54,29 @@ bool DWARFExpressionList::ContainsAddress(lldb::addr_t func_load_addr,
return GetExpressionAtAddress(func_load_addr, addr) != nullptr;
}
+llvm::Expected<DWARFExpressionList::DWARFExpressionEntry>
+DWARFExpressionList::GetExpressionEntryAtAddress(lldb::addr_t func_load_addr,
+ lldb::addr_t load_addr) const {
+ if (const DWARFExpression *always = GetAlwaysValidExpr()) {
+ AddressRange full_range(m_func_file_addr, /*size=*/LLDB_INVALID_ADDRESS);
+ return DWARFExpressionEntry{full_range, always};
+ }
+
+ if (func_load_addr == LLDB_INVALID_ADDRESS)
+ func_load_addr = m_func_file_addr;
+ lldb::addr_t file_pc = load_addr - func_load_addr + m_func_file_addr;
+
+ uint32_t idx = m_exprs.FindEntryIndexThatContains(file_pc);
----------------
UltimateForce21 wrote:
for sure, seems like it would be easier for implementation, i was just following the same logic, as
```
const DWARFExpression *
DWARFExpressionList::GetExpressionAtAddress(lldb::addr_t func_load_addr,
lldb::addr_t load_addr) const
```
will update to use `const Entry *FindEntryThatContains(B addr) const ()` instead
https://github.com/llvm/llvm-project/pull/144238
More information about the lldb-commits
mailing list