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

#include <Variable.h>

Inheritance diagram for lldb_private::Variable:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::Variable:
Collaboration graph
[legend]

Public Types

typedef RangeVector< lldb::addr_t, lldb::addr_tRangeList
 
typedef size_t(* GetVariableCallback) (void *baton, const char *name, VariableList &var_list)
 

Public Member Functions

 Variable (lldb::user_id_t uid, const char *name, const char *mangled, const lldb::SymbolFileTypeSP &symfile_type_sp, lldb::ValueType scope, SymbolContextScope *owner_scope, const RangeList &scope_range, Declaration *decl, const DWARFExpression &location, bool external, bool artificial, bool location_is_constant_data, bool static_member=false)
 Constructors and Destructors. More...
 
virtual ~Variable ()
 
void Dump (Stream *s, bool show_context) const
 
bool DumpDeclaration (Stream *s, bool show_fullpaths, bool show_module)
 
const DeclarationGetDeclaration () const
 
ConstString GetName () const
 
ConstString GetUnqualifiedName () const
 
SymbolContextScopeGetSymbolContextScope () const
 
bool NameMatches (ConstString name) const
 Since a variable can have a basename "i" and also a mangled named "_ZN12_GLOBAL__N_11iE" and a demangled mangled name "(anonymous namespace)::i", this function will allow a generic match function that can be called by commands and expression parsers to make sure we match anything we come across. More...
 
bool NameMatches (const RegularExpression &regex) const
 
TypeGetType ()
 
lldb::LanguageType GetLanguage () const
 
lldb::ValueType GetScope () const
 
const RangeListGetScopeRange () const
 
bool IsExternal () const
 
bool IsArtificial () const
 
bool IsStaticMember () const
 
DWARFExpressionLocationExpression ()
 
const DWARFExpressionLocationExpression () const
 
bool DumpLocationForAddress (Stream *s, const Address &address)
 
size_t MemorySize () const
 
void CalculateSymbolContext (SymbolContext *sc)
 
bool IsInScope (StackFrame *frame)
 
bool LocationIsValidForFrame (StackFrame *frame)
 
bool LocationIsValidForAddress (const Address &address)
 
bool GetLocationIsConstantValueData () const
 
void SetLocationIsConstantValueData (bool b)
 
CompilerDeclContext GetDeclContext ()
 
CompilerDecl GetDecl ()
 
- Public Member Functions inherited from lldb_private::UserID
 UserID (lldb::user_id_t uid=LLDB_INVALID_UID)
 Construct with optional user ID. More...
 
 ~UserID ()=default
 Destructor. More...
 
void Clear ()
 Clears the object state. More...
 
lldb::user_id_t GetID () const
 Get accessor for the user ID. More...
 
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID. More...
 

Static Public Member Functions

static Status GetValuesForVariableExpressionPath (llvm::StringRef variable_expr_path, ExecutionContextScope *scope, GetVariableCallback callback, void *baton, VariableList &variable_list, ValueObjectList &valobj_list)
 
static void AutoComplete (const ExecutionContext &exe_ctx, CompletionRequest &request)
 

Protected Attributes

ConstString m_name
 The basename of the variable (no namespaces). More...
 
Mangled m_mangled
 The mangled name of the variable. More...
 
lldb::SymbolFileTypeSP m_symfile_type_sp
 The type pointer of the variable (int, struct, class, etc) global, parameter, local. More...
 
lldb::ValueType m_scope
 
SymbolContextScopem_owner_scope
 The symbol file scope that this variable was defined in. More...
 
RangeList m_scope_range
 The list of ranges inside the owner's scope where this variable is valid. More...
 
Declaration m_declaration
 Declaration location for this item. More...
 
DWARFExpression m_location
 The location of this variable that can be fed to DWARFExpression::Evaluate(). More...
 
unsigned m_external: 1
 Visible outside the containing compile unit? More...
 
unsigned m_artificial: 1
 Non-zero if the variable is not explicitly declared in source. More...
 
unsigned m_loc_is_const_data: 1
 The m_location expression contains the constant variable value data, not a DWARF location. More...
 
unsigned m_static_member: 1
 Non-zero if variable is static member of a class or struct. More...
 
- Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object. More...
 

Private Member Functions

 Variable (const Variable &rhs)=delete
 
Variableoperator= (const Variable &rhs)=delete
 

Detailed Description

Definition at line 25 of file Variable.h.

Member Typedef Documentation

◆ GetVariableCallback

typedef size_t(* lldb_private::Variable::GetVariableCallback) (void *baton, const char *name, VariableList &var_list)

Definition at line 96 of file Variable.h.

◆ RangeList

Definition at line 27 of file Variable.h.

Constructor & Destructor Documentation

◆ Variable() [1/2]

Variable::Variable ( lldb::user_id_t  uid,
const char *  name,
const char *  mangled,
const lldb::SymbolFileTypeSP &  symfile_type_sp,
lldb::ValueType  scope,
SymbolContextScope owner_scope,
const RangeList scope_range,
Declaration decl,
const DWARFExpression location,
bool  external,
bool  artificial,
bool  location_is_constant_data,
bool  static_member = false 
)

Constructors and Destructors.

Parameters
mangledThe mangled or fully qualified name of the variable.

Definition at line 38 of file Variable.cpp.

Referenced by MemorySize().

◆ ~Variable()

Variable::~Variable ( )
virtualdefault

◆ Variable() [2/2]

lldb_private::Variable::Variable ( const Variable rhs)
privatedelete

Member Function Documentation

◆ AutoComplete()

void Variable::AutoComplete ( const ExecutionContext exe_ctx,
CompletionRequest request 
)
static

◆ CalculateSymbolContext()

void Variable::CalculateSymbolContext ( SymbolContext sc)

◆ Dump()

void Variable::Dump ( Stream s,
bool  show_context 
) const

◆ DumpDeclaration()

bool Variable::DumpDeclaration ( Stream s,
bool  show_fullpaths,
bool  show_module 
)

◆ DumpLocationForAddress()

bool Variable::DumpLocationForAddress ( Stream s,
const Address address 
)

◆ GetDecl()

CompilerDecl Variable::GetDecl ( )

◆ GetDeclaration()

const Declaration& lldb_private::Variable::GetDeclaration ( ) const
inline

Definition at line 45 of file Variable.h.

References m_declaration.

◆ GetDeclContext()

CompilerDeclContext Variable::GetDeclContext ( )

◆ GetLanguage()

lldb::LanguageType Variable::GetLanguage ( ) const

◆ GetLocationIsConstantValueData()

bool lldb_private::Variable::GetLocationIsConstantValueData ( ) const
inline

Definition at line 92 of file Variable.h.

References m_loc_is_const_data.

Referenced by lldb_private::ValueObjectVariable::UpdateValue().

◆ GetName()

ConstString Variable::GetName ( ) const

◆ GetScope()

lldb::ValueType lldb_private::Variable::GetScope ( ) const
inline

Definition at line 66 of file Variable.h.

References m_scope.

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

◆ GetScopeRange()

const RangeList& lldb_private::Variable::GetScopeRange ( ) const
inline

Definition at line 68 of file Variable.h.

References m_scope_range.

◆ GetSymbolContextScope()

SymbolContextScope* lldb_private::Variable::GetSymbolContextScope ( ) const
inline

Definition at line 51 of file Variable.h.

References m_owner_scope.

◆ GetType()

Type * Variable::GetType ( )

◆ GetUnqualifiedName()

ConstString Variable::GetUnqualifiedName ( ) const

Definition at line 78 of file Variable.cpp.

References m_name.

◆ GetValuesForVariableExpressionPath()

Status Variable::GetValuesForVariableExpressionPath ( llvm::StringRef  variable_expr_path,
ExecutionContextScope scope,
GetVariableCallback  callback,
void *  baton,
VariableList variable_list,
ValueObjectList valobj_list 
)
static

◆ IsArtificial()

bool lldb_private::Variable::IsArtificial ( ) const
inline

Definition at line 72 of file Variable.h.

References m_artificial.

◆ IsExternal()

bool lldb_private::Variable::IsExternal ( ) const
inline

Definition at line 70 of file Variable.h.

References m_external.

◆ IsInScope()

bool Variable::IsInScope ( StackFrame frame)

◆ IsStaticMember()

bool lldb_private::Variable::IsStaticMember ( ) const
inline

Definition at line 74 of file Variable.h.

References m_static_member.

◆ LocationExpression() [1/2]

DWARFExpression& lldb_private::Variable::LocationExpression ( )
inline

Definition at line 76 of file Variable.h.

References m_location.

Referenced by lldb_private::ValueObjectVariable::UpdateValue().

◆ LocationExpression() [2/2]

const DWARFExpression& lldb_private::Variable::LocationExpression ( ) const
inline

Definition at line 78 of file Variable.h.

References m_location.

◆ LocationIsValidForAddress()

bool Variable::LocationIsValidForAddress ( const Address address)

◆ LocationIsValidForFrame()

bool Variable::LocationIsValidForFrame ( StackFrame frame)

◆ MemorySize()

size_t Variable::MemorySize ( ) const

Definition at line 202 of file Variable.cpp.

References Variable().

◆ NameMatches() [1/2]

bool Variable::NameMatches ( const RegularExpression regex) const

◆ NameMatches() [2/2]

bool Variable::NameMatches ( ConstString  name) const

Since a variable can have a basename "i" and also a mangled named "_ZN12_GLOBAL__N_11iE" and a demangled mangled name "(anonymous namespace)::i", this function will allow a generic match function that can be called by commands and expression parsers to make sure we match anything we come across.

Definition at line 80 of file Variable.cpp.

References lldb_private::SymbolContextScope::CalculateSymbolContext(), m_mangled, m_name, and m_owner_scope.

◆ operator=()

Variable& lldb_private::Variable::operator= ( const Variable rhs)
privatedelete

◆ SetLocationIsConstantValueData()

void lldb_private::Variable::SetLocationIsConstantValueData ( bool  b)
inline

Definition at line 94 of file Variable.h.

References m_loc_is_const_data.

Member Data Documentation

◆ m_artificial

unsigned lldb_private::Variable::m_artificial
protected

Non-zero if the variable is not explicitly declared in source.

Definition at line 133 of file Variable.h.

Referenced by Dump(), and IsArtificial().

◆ m_declaration

Declaration lldb_private::Variable::m_declaration
protected

Declaration location for this item.

Definition at line 126 of file Variable.h.

Referenced by Dump(), DumpDeclaration(), and GetDeclaration().

◆ m_external

unsigned lldb_private::Variable::m_external
protected

Visible outside the containing compile unit?

Definition at line 131 of file Variable.h.

Referenced by Dump(), and IsExternal().

◆ m_loc_is_const_data

unsigned lldb_private::Variable::m_loc_is_const_data
protected

The m_location expression contains the constant variable value data, not a DWARF location.

Definition at line 136 of file Variable.h.

Referenced by GetLocationIsConstantValueData(), and SetLocationIsConstantValueData().

◆ m_location

DWARFExpression lldb_private::Variable::m_location
protected

The location of this variable that can be fed to DWARFExpression::Evaluate().

Definition at line 129 of file Variable.h.

Referenced by Dump(), DumpLocationForAddress(), LocationExpression(), LocationIsValidForAddress(), and LocationIsValidForFrame().

◆ m_mangled

Mangled lldb_private::Variable::m_mangled
protected

The mangled name of the variable.

Definition at line 115 of file Variable.h.

Referenced by GetLanguage(), GetName(), and NameMatches().

◆ m_name

ConstString lldb_private::Variable::m_name
protected

The basename of the variable (no namespaces).

Definition at line 113 of file Variable.h.

Referenced by Dump(), GetName(), GetUnqualifiedName(), and NameMatches().

◆ m_owner_scope

SymbolContextScope* lldb_private::Variable::m_owner_scope
protected

The symbol file scope that this variable was defined in.

Definition at line 121 of file Variable.h.

Referenced by CalculateSymbolContext(), Dump(), DumpDeclaration(), DumpLocationForAddress(), GetLanguage(), GetSymbolContextScope(), and NameMatches().

◆ m_scope

lldb::ValueType lldb_private::Variable::m_scope
protected

Definition at line 119 of file Variable.h.

Referenced by Dump(), GetScope(), and IsInScope().

◆ m_scope_range

RangeList lldb_private::Variable::m_scope_range
protected

The list of ranges inside the owner's scope where this variable is valid.

Definition at line 124 of file Variable.h.

Referenced by GetScopeRange(), and IsInScope().

◆ m_static_member

unsigned lldb_private::Variable::m_static_member
protected

Non-zero if variable is static member of a class or struct.

Definition at line 138 of file Variable.h.

Referenced by IsStaticMember().

◆ m_symfile_type_sp

lldb::SymbolFileTypeSP lldb_private::Variable::m_symfile_type_sp
protected

The type pointer of the variable (int, struct, class, etc) global, parameter, local.

Definition at line 118 of file Variable.h.

Referenced by Dump(), and GetType().


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