9#ifndef LLDB_SYMBOL_SYMBOLCONTEXT_H
10#define LLDB_SYMBOL_SYMBOLCONTEXT_H
22#include "llvm/ADT/DenseMapInfo.h"
23#include "llvm/ADT/Hashing.h"
24#include "llvm/ADT/SetVector.h"
95 void Clear(
bool clear_target);
153 bool show_fullpaths,
bool show_module,
bool show_inlined_frames,
154 bool show_function_arguments,
bool show_function_name,
155 bool show_function_display_name =
false,
156 std::optional<Stream::HighlightSettings> settings = std::nullopt)
const;
196 bool use_inline_block_range,
AddressRange &range)
const;
231 std::optional<Stream::HighlightSettings> settings = std::nullopt)
const;
325 Address &inlined_frame_addr)
const;
417 bool merge_symbol_into_function);
490 llvm::SetVector<SymbolContext, llvm::SmallVector<SymbolContext>>;
507bool operator==(
const SymbolContext &lhs,
const SymbolContext &rhs);
508bool operator!=(
const SymbolContext &lhs,
const SymbolContext &rhs);
510bool operator==(
const SymbolContextList &lhs,
const SymbolContextList &rhs);
511bool operator!=(
const SymbolContextList &lhs,
const SymbolContextList &rhs);
522 sc.
function = DenseMapInfo<lldb_private::Function *>::getEmptyKey();
528 sc.
function = DenseMapInfo<lldb_private::Function *>::getTombstoneKey();
535 auto line_entry_hash =
543 return static_cast<unsigned>(hash_combine(
553 if (lhs.
function == DenseMapInfo<lldb_private::Function *>::getEmptyKey() ||
554 rhs.
function == DenseMapInfo<lldb_private::Function *>::getEmptyKey() ||
556 DenseMapInfo<lldb_private::Function *>::getTombstoneKey() ||
558 DenseMapInfo<lldb_private::Function *>::getTombstoneKey())
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address range class.
Address & GetBaseAddress()
Get accessor for the base address of the range.
lldb::addr_t GetByteSize() const
Get accessor for the byte size of this range.
A section + offset based address class.
lldb::addr_t GetFileAddress() const
Get the file address.
A class that describes a single lexical block.
A class that describes a compilation unit.
A uniqued constant string class.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
A class that describes a function.
A class that handles mangled names.
A stream class that can stream formatted output to a file.
collection m_symbol_contexts
The list of symbol contexts.
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
uint32_t GetSize() const
Get accessor for a symbol context list size.
void SetSymbolAtIndex(size_t idx, Symbol *symbol)
Replace the symbol in the symbol context at index idx.
llvm::SetVector< SymbolContext, llvm::SmallVector< SymbolContext > > collection
llvm::iterator_range< const_iterator > SymbolContextIterable
const_iterator begin() const
void GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target) const
const_iterator end() const
bool RemoveContextAtIndex(size_t idx)
bool AppendIfUnique(const SymbolContext &sc, bool merge_symbol_into_function)
void Dump(Stream *s, Target *target) const
Dump a description of this object to a Stream.
uint32_t NumLineEntriesWithLine(uint32_t line) const
~SymbolContextList()
Destructor.
void Append(const SymbolContext &sc)
Append a new symbol context to the list.
const SymbolContext & operator[](size_t idx) const
Direct const reference accessor for a symbol context at index idx.
SymbolContextIterable SymbolContexts()
collection::const_iterator const_iterator
void Clear()
Clear the object's state.
SymbolContextList()
Default constructor.
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
void GetDescription(Stream *s, lldb::DescriptionLevel level) const
bool AddressMatches(lldb::addr_t addr)
lldb::ModuleSP m_module_sp
std::unique_ptr< AddressRange > m_address_range_up
std::unique_ptr< FileSpec > m_file_spec_up
~SymbolContextSpecifier()
std::string m_module_spec
bool AddLineSpecification(uint32_t line_no, SpecificationType type)
@ eClassOrNamespaceSpecified
bool AddSpecification(const char *spec_string, SpecificationType type)
lldb::TargetSP m_target_sp
std::string m_function_spec
bool SymbolContextMatches(const SymbolContext &sc)
SymbolContextSpecifier(const lldb::TargetSP &target_sp)
Defines a symbol context baton that can be handed other debug core functions.
static bool CompareWithoutSymbol(const SymbolContext &lhs, const SymbolContext &rhs)
Compares the two symbol contexts, except for the symbol field.
LineEntry GetFunctionStartLineEntry() const
Get the line entry that corresponds to the function.
const Symbol * FindBestGlobalDataSymbol(ConstString name, Status &error)
Find the best global data symbol visible from this context.
lldb::LanguageType GetLanguage() const
void GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target, std::optional< Stream::HighlightSettings > settings=std::nullopt) const
llvm::Error GetAddressRangeFromHereToEndLine(uint32_t end_line, AddressRange &range)
Function * function
The Function for a given query.
Block * GetFunctionBlock()
Find a block that defines the function represented by this symbol context.
llvm::StringRef GetInstanceVariableName()
Determines the name of the instance variable for the this decl context.
bool GetParentOfInlinedScope(const Address &curr_frame_pc, SymbolContext &next_frame_sc, Address &inlined_frame_addr) const
Find the block containing the inlined block that contains this block.
ConstString GetFunctionName(Mangled::NamePreference preference=Mangled::ePreferDemangled) const
Find a name of the innermost function for the symbol context.
void SortTypeList(TypeMap &type_map, TypeList &type_list) const
Sorts the types in TypeMap according to SymbolContext to TypeList.
Block * block
The Block for a given query.
lldb::ModuleSP module_sp
The Module for a given query.
CompileUnit * comp_unit
The CompileUnit for a given query.
bool DumpStopContext(Stream *s, ExecutionContextScope *exe_scope, const Address &so_addr, bool show_fullpaths, bool show_module, bool show_inlined_frames, bool show_function_arguments, bool show_function_name, bool show_function_display_name=false, std::optional< Stream::HighlightSettings > settings=std::nullopt) const
Dump the stop context in this object to a Stream.
uint32_t GetResolvedMask() const
void Clear(bool clear_target)
Clear the object's state.
Variable * variable
The global variable matching the given query.
bool GetAddressRange(uint32_t scope, uint32_t range_idx, bool use_inline_block_range, AddressRange &range) const
Get the address range contained within a symbol context.
Symbol * symbol
The Symbol for a given query.
lldb::TargetSP target_sp
The Target for a given query.
LineEntry line_entry
The LineEntry for a given query.
Mangled GetPossiblyInlinedFunctionName() const
If available, will return the function name according to the specified mangling preference.
static bool CompareConsideringPossiblyNullSymbol(const SymbolContext &lhs, const SymbolContext &rhs)
Compares the two symbol contexts, considering that the symbol may or may not be present.
Address GetFunctionOrSymbolAddress() const
Get the address of the function or symbol represented by this symbol context.
SymbolContext()
Default constructor.
A class that represents a running process on the host machine.
bool operator!=(const Address &lhs, const Address &rhs)
bool operator==(const Address &lhs, const Address &rhs)
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::Module > ModuleSP
A line table entry class.
uint16_t column
The column number of the source line, or zero if there is no column information.
bool IsValid() const
Check if a line entry object is valid.
AddressRange range
The section offset address range for this line entry.
uint32_t line
The source line number, or LLDB_INVALID_LINE_NUMBER if there is no line number information.
uint16_t is_terminal_entry
Indicates this entry is that of the first byte after the end of a sequence of target machine instruct...
static unsigned getHashValue(const lldb_private::SymbolContext &sc)
static lldb_private::SymbolContext getTombstoneKey()
static lldb_private::SymbolContext getEmptyKey()
static bool isEqual(const lldb_private::SymbolContext &lhs, const lldb_private::SymbolContext &rhs)