[Lldb-commits] [lldb] [lldb] Add SymbolContext::GetAddress (PR #123340)

via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 17 10:00:22 PST 2025


================
@@ -192,6 +192,33 @@ class SymbolContext {
   bool GetAddressRange(uint32_t scope, uint32_t range_idx,
                        bool use_inline_block_range, AddressRange &range) const;
 
+  /// Get the address represented by this symbol context.
+  ///
+  /// The exact meaning of the address depends on object being queried and the
+  /// flags. Priority is as follows:
+  ///     - The beginning (lowest address) of the line_entry if line_entry is
+  ///     valid and eSymbolContextLineEntry is set in \a scope
+  ///     - The beginning of the block if block is not nullptr and
+  ///     eSymbolContextBlock is set in \a scope
+  ///     - function address (entry point) if function is not nullptr and
+  ///     eSymbolContextFunction is set in \a scope
+  ///     - symbol address if symbol is not nullptr and eSymbolContextSymbol is
+  ///     set in \a scope
+  ///
+  /// \param[in] scope
+  ///     A mask of symbol context bits telling this function which
----------------
jimingham wrote:

Might explicitly name the enum these bits come from to help people new to the codebase?

https://github.com/llvm/llvm-project/pull/123340


More information about the lldb-commits mailing list