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

via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 21 09:56:50 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:

If you know lldb a bit at the public layer, you would know that eSymbolContextWhatever is an enum, and if you wanted to find the whole enum and where it is documented you go to include/lldb/include/, etc.  But if you said "these flag is composed of bits from the enum SymbolContextItem", that would lead directly there.

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


More information about the lldb-commits mailing list