LLDB mainline
lldb_private::SymbolContextScope Class Referenceabstract

"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and can reconstruct its symbol context. More...

#include <SymbolContextScope.h>

Inheritance diagram for lldb_private::SymbolContextScope:
[legend]

Public Member Functions

virtual ~SymbolContextScope ()=default
virtual void CalculateSymbolContext (SymbolContext *sc)=0
 Reconstruct the object's symbol context into sc.
virtual lldb::ModuleSP CalculateSymbolContextModule ()
virtual CompileUnitCalculateSymbolContextCompileUnit ()
virtual FunctionCalculateSymbolContextFunction ()
virtual BlockCalculateSymbolContextBlock ()
virtual SymbolCalculateSymbolContextSymbol ()
virtual void DumpSymbolContext (Stream *s)=0
 Dump the object's symbol context to the stream s.

Detailed Description

"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and can reconstruct its symbol context.

Many objects that are part of a symbol context that have pointers back to parent objects that own them. Any members of a symbol context that, once they are built, will not go away, can inherit from this pure virtual class and can then reconstruct their symbol context without having to keep a complete SymbolContext object in the object.

Examples of these objects include:

Other objects can store a "SymbolContextScope *" using any pointers to one of the above objects. This allows clients to hold onto a pointer that uniquely will identify a symbol context. Those clients can then always reconstruct the symbol context using the pointer, or use it to uniquely identify a symbol context for an object.

Example objects include that currently use "SymbolContextScope *" objects include:

  • Variable objects that can reconstruct where they are scoped by making sure the SymbolContextScope * comes from the scope in which the variable was declared. If a variable is a global, the appropriate CompileUnit * will be used when creating the variable. A static function variables, can the Block scope in which the variable is defined. Function arguments can use the Function object as their scope. The SymbolFile parsers will set these correctly as the variables are parsed.
  • Type objects that know exactly in which scope they originated much like the variables above.
  • StackID objects that are able to know that if the CFA (stack pointer at the beginning of a function) and the start PC for the function/symbol and the SymbolContextScope pointer (a unique pointer that identifies a symbol context location) match within the same thread, that the stack frame is the same as the previous stack frame.

Objects that adhere to this protocol can reconstruct enough of a symbol context to allow functions that take a symbol context to be called. Lists can also be created using a SymbolContextScope* and and object pairs that allow large collections of objects to be passed around with minimal overhead.

Definition at line 64 of file SymbolContextScope.h.

Constructor & Destructor Documentation

◆ ~SymbolContextScope()

virtual lldb_private::SymbolContextScope::~SymbolContextScope ( )
virtualdefault

Member Function Documentation

◆ CalculateSymbolContext()

virtual void lldb_private::SymbolContextScope::CalculateSymbolContext ( SymbolContext * sc)
pure virtual

Reconstruct the object's symbol context into sc.

The object should fill in as much of the SymbolContext as it can so function calls that require a symbol context can be made for the given object.

Parameters
[out]scA symbol context object pointer that gets filled in.

Implemented in lldb_private::Block, lldb_private::CompileUnit, lldb_private::Function, lldb_private::Module, and lldb_private::Symbol.

Referenced by lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::GetTypes(), lldb_private::operator<(), and lldb_private::SymbolContext::SymbolContext().

◆ CalculateSymbolContextBlock()

virtual Block * lldb_private::SymbolContextScope::CalculateSymbolContextBlock ( )
inlinevirtual

Reimplemented in lldb_private::Block.

Definition at line 86 of file SymbolContextScope.h.

Referenced by lldb_private::SymbolContext::SortTypeList().

◆ CalculateSymbolContextCompileUnit()

virtual CompileUnit * lldb_private::SymbolContextScope::CalculateSymbolContextCompileUnit ( )
inlinevirtual

◆ CalculateSymbolContextFunction()

virtual Function * lldb_private::SymbolContextScope::CalculateSymbolContextFunction ( )
inlinevirtual

Reimplemented in lldb_private::Block, and lldb_private::Function.

Definition at line 84 of file SymbolContextScope.h.

Referenced by lldb_private::SymbolContext::SortTypeList().

◆ CalculateSymbolContextModule()

virtual lldb::ModuleSP lldb_private::SymbolContextScope::CalculateSymbolContextModule ( )
inlinevirtual

◆ CalculateSymbolContextSymbol()

virtual Symbol * lldb_private::SymbolContextScope::CalculateSymbolContextSymbol ( )
inlinevirtual

Reimplemented in lldb_private::Symbol.

Definition at line 88 of file SymbolContextScope.h.

◆ DumpSymbolContext()

virtual void lldb_private::SymbolContextScope::DumpSymbolContext ( Stream * s)
pure virtual

Dump the object's symbol context to the stream s.

The object should dump its symbol context to the stream s. This function is widely used in the DumpDebug and verbose output for lldb objects.

Parameters
[in]sThe stream to which to dump the object's symbol context.

Implemented in lldb_private::Block, lldb_private::CompileUnit, lldb_private::Function, lldb_private::Module, and lldb_private::Symbol.


The documentation for this class was generated from the following file: