LLDB  mainline
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
lldb_private::ClangExpressionVariable Class Reference

"lldb/Expression/ClangExpressionVariable.h" Encapsulates one variable for the expression parser. More...

#include <ClangExpressionVariable.h>

Inheritance diagram for lldb_private::ClangExpressionVariable:
Inheritance graph
Collaboration diagram for lldb_private::ClangExpressionVariable:
Collaboration graph


struct  JITVars
 The following values are valid if the variable is used by JIT code. More...
class  ParserVars
 The following values should not live beyond parsing. More...

Public Member Functions

 ClangExpressionVariable (ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size)
 ClangExpressionVariable (ExecutionContextScope *exe_scope, Value &value, ConstString name, uint16_t flags=EVNone)
 ClangExpressionVariable (const lldb::ValueObjectSP &valobj_sp)
 ClangExpressionVariable (ExecutionContextScope *exe_scope, ConstString name, const TypeFromUser &user_type, lldb::ByteOrder byte_order, uint32_t addr_byte_size)
bool PointValueAtData (Value &value, ExecutionContext *exe_ctx)
 If the variable contains its own data, make a Value point at it. More...
void EnableParserVars (uint64_t parser_id)
 Make this variable usable by the parser by allocating space for parser- specific variables. More...
void DisableParserVars (uint64_t parser_id)
 Deallocate parser-specific variables. More...
ParserVarsGetParserVars (uint64_t parser_id)
 Access parser-specific variables. More...
void EnableJITVars (uint64_t parser_id)
 Make this variable usable for materializing for the JIT by allocating space for JIT-specific variables. More...
void DisableJITVars (uint64_t parser_id)
 Deallocate JIT-specific variables. More...
JITVarsGetJITVars (uint64_t parser_id)
TypeFromUser GetTypeFromUser ()
 ClangExpressionVariable (const ClangExpressionVariable &)=delete
 Members. More...
const ClangExpressionVariableoperator= (const ClangExpressionVariable &)=delete
- Public Member Functions inherited from lldb_private::ExpressionVariable
LLVMCastKind getKind () const
 ExpressionVariable (LLVMCastKind kind)
virtual ~ExpressionVariable ()
size_t GetByteSize ()
ConstString GetName ()
lldb::ValueObjectSP GetValueObject ()
uint8_t * GetValueBytes ()
void ValueUpdated ()
RegisterInfo * GetRegisterInfo ()
void SetRegisterInfo (const RegisterInfo *reg_info)
CompilerType GetCompilerType ()
void SetCompilerType (const CompilerType &compiler_type)
void SetName (ConstString name)
void TransferAddress (bool force=false)

Static Public Member Functions

static ClangExpressionVariableFindVariableInList (ExpressionVariableList &list, const clang::NamedDecl *decl, uint64_t parser_id)
 Utility functions for dealing with ExpressionVariableLists in Clang- specific ways. More...
static bool classof (const ExpressionVariable *ev)

Private Types

typedef std::map< uint64_t, ParserVarsParserVarMap
typedef std::map< uint64_t, JITVarsJITVarMap

Private Attributes

ParserVarMap m_parser_vars
JITVarMap m_jit_vars

Additional Inherited Members

- Public Types inherited from lldb_private::ExpressionVariable
enum  LLVMCastKind { eKindClang, eKindSwift, eKindGo, kNumKinds }
enum  Flags {
  EVNone = 0, EVIsLLDBAllocated = 1 << 0, EVIsProgramReference = 1 << 1, EVNeedsAllocation = 1 << 2,
  EVIsFreezeDried = 1 << 3, EVNeedsFreezeDry, EVKeepInTarget = 1 << 5, EVTypeIsReference = 1 << 6,
  EVBareRegister = 1 << 7
typedef uint16_t FlagType
- Public Attributes inherited from lldb_private::ExpressionVariable
FlagType m_flags
lldb::ValueObjectSP m_frozen_sp
lldb::ValueObjectSP m_live_sp
LLVMCastKind m_kind

Detailed Description

"lldb/Expression/ClangExpressionVariable.h" Encapsulates one variable for the expression parser.

The expression parser uses variables in three different contexts:

First, it stores persistent variables along with the process for use in expressions. These persistent variables contain their own data and are typed.

Second, in an interpreted expression, it stores the local variables for the expression along with the expression. These variables contain their own data and are typed.

Third, in a JIT-compiled expression, it stores the variables that the expression needs to have materialized and dematerialized at each execution. These do not contain their own data but are named and typed.

This class supports all of these use cases using simple type polymorphism, and provides necessary support methods. Its interface is RTTI-neutral.

Definition at line 60 of file ClangExpressionVariable.h.

Member Typedef Documentation

◆ JITVarMap

typedef std::map<uint64_t, JITVars> lldb_private::ClangExpressionVariable::JITVarMap

Definition at line 170 of file ClangExpressionVariable.h.

◆ ParserVarMap

Definition at line 135 of file ClangExpressionVariable.h.

Constructor & Destructor Documentation

◆ ClangExpressionVariable() [1/5]

ClangExpressionVariable::ClangExpressionVariable ( ExecutionContextScope exe_scope,
lldb::ByteOrder  byte_order,
uint32_t  addr_byte_size 

◆ ClangExpressionVariable() [2/5]

ClangExpressionVariable::ClangExpressionVariable ( ExecutionContextScope exe_scope,
Value value,
ConstString  name,
uint16_t  flags = EVNone 

◆ ClangExpressionVariable() [3/5]

ClangExpressionVariable::ClangExpressionVariable ( const lldb::ValueObjectSP &  valobj_sp)

◆ ClangExpressionVariable() [4/5]

ClangExpressionVariable::ClangExpressionVariable ( ExecutionContextScope exe_scope,
ConstString  name,
const TypeFromUser user_type,
lldb::ByteOrder  byte_order,
uint32_t  addr_byte_size 

◆ ClangExpressionVariable() [5/5]

lldb_private::ClangExpressionVariable::ClangExpressionVariable ( const ClangExpressionVariable )


Member Function Documentation

◆ classof()

static bool lldb_private::ClangExpressionVariable::classof ( const ExpressionVariable ev)

◆ DisableJITVars()

void lldb_private::ClangExpressionVariable::DisableJITVars ( uint64_t  parser_id)

Deallocate JIT-specific variables.

Definition at line 181 of file ClangExpressionVariable.h.

◆ DisableParserVars()

void lldb_private::ClangExpressionVariable::DisableParserVars ( uint64_t  parser_id)

Deallocate parser-specific variables.

Definition at line 146 of file ClangExpressionVariable.h.

◆ EnableJITVars()

void lldb_private::ClangExpressionVariable::EnableJITVars ( uint64_t  parser_id)

Make this variable usable for materializing for the JIT by allocating space for JIT-specific variables.

Definition at line 176 of file ClangExpressionVariable.h.

Referenced by lldb_private::ClangExpressionDeclMap::AddPersistentVariable().

◆ EnableParserVars()

void lldb_private::ClangExpressionVariable::EnableParserVars ( uint64_t  parser_id)

Make this variable usable by the parser by allocating space for parser- specific variables.

Definition at line 141 of file ClangExpressionVariable.h.

Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::ClangExpressionDeclMap::AddOneRegister(), and lldb_private::ClangExpressionDeclMap::AddPersistentVariable().

◆ FindVariableInList()

static ClangExpressionVariable* lldb_private::ClangExpressionVariable::FindVariableInList ( ExpressionVariableList list,
const clang::NamedDecl *  decl,
uint64_t  parser_id 

Utility functions for dealing with ExpressionVariableLists in Clang- specific ways.

Finds a variable by NamedDecl in the list.

The variable requested, or NULL if that variable is not in the list.

Definition at line 83 of file ClangExpressionVariable.h.

References lldb_private::ExpressionVariableList::GetSize(), lldb_private::ExpressionVariableList::GetVariableAtIndex(), and lldb_private::ClangExpressionVariable::ParserVars::m_named_decl.

Referenced by lldb_private::ClangExpressionDeclMap::AddValueToStruct(), and lldb_private::ClangExpressionDeclMap::GetFunctionInfo().

◆ GetJITVars()

JITVars* lldb_private::ClangExpressionVariable::GetJITVars ( uint64_t  parser_id)

◆ GetParserVars()

ParserVars* lldb_private::ClangExpressionVariable::GetParserVars ( uint64_t  parser_id)

◆ GetTypeFromUser()

TypeFromUser ClangExpressionVariable::GetTypeFromUser ( )

◆ operator=()

const ClangExpressionVariable& lldb_private::ClangExpressionVariable::operator= ( const ClangExpressionVariable )

◆ PointValueAtData()

bool lldb_private::ClangExpressionVariable::PointValueAtData ( Value value,
ExecutionContext exe_ctx 

If the variable contains its own data, make a Value point at it.

If exe_ctx in not NULL, the value will be resolved in with that execution context.

[in]valueThe value to point at the data.
[in]exe_ctxThe execution context to use to resolve value.
True on success; false otherwise (in particular, if this variable does not contain its own data).

Member Data Documentation

◆ m_jit_vars

JITVarMap lldb_private::ClangExpressionVariable::m_jit_vars

Definition at line 171 of file ClangExpressionVariable.h.

◆ m_parser_vars

ParserVarMap lldb_private::ClangExpressionVariable::m_parser_vars

Definition at line 136 of file ClangExpressionVariable.h.

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