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]

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 DWARFExpressionList &location, bool external, bool artificial, bool location_is_constant_data, bool static_member=false)
 Constructors and Destructors.
 
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.
 
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
 
DWARFExpressionListLocationExpressionList ()
 
const DWARFExpressionListLocationExpressionList () const
 
bool DumpLocations (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.
 
 ~UserID ()=default
 Destructor.
 
void Clear ()
 Clears the object state.
 
lldb::user_id_t GetID () const
 Get accessor for the user ID.
 
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID.
 

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

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 100 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 DWARFExpressionList 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 40 of file Variable.cpp.

◆ ~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 
)

◆ DumpLocations()

bool Variable::DumpLocations ( 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 96 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.

Referenced by LocationIsValidForAddress().

◆ 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 80 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.

◆ LocationExpressionList() [1/2]

DWARFExpressionList & lldb_private::Variable::LocationExpressionList ( )
inline

Definition at line 76 of file Variable.h.

References m_location_list.

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

◆ LocationExpressionList() [2/2]

const DWARFExpressionList & lldb_private::Variable::LocationExpressionList ( ) const
inline

Definition at line 78 of file Variable.h.

References m_location_list.

◆ LocationIsValidForAddress()

bool Variable::LocationIsValidForAddress ( const Address address)

◆ LocationIsValidForFrame()

bool Variable::LocationIsValidForFrame ( StackFrame frame)

◆ MemorySize()

size_t Variable::MemorySize ( ) const

Definition at line 194 of file Variable.cpp.

◆ 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 82 of file Variable.cpp.

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

◆ operator=()

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

◆ SetLocationIsConstantValueData()

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

Definition at line 98 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 137 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 130 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 135 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 140 of file Variable.h.

Referenced by GetLocationIsConstantValueData(), and SetLocationIsConstantValueData().

◆ m_location_list

DWARFExpressionList lldb_private::Variable::m_location_list
protected

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

Definition at line 133 of file Variable.h.

Referenced by Dump(), DumpLocations(), LocationExpressionList(), LocationIsValidForAddress(), and LocationIsValidForFrame().

◆ m_mangled

Mangled lldb_private::Variable::m_mangled
protected

The mangled name of the variable.

Definition at line 119 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 117 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 125 of file Variable.h.

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

◆ m_scope

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

Definition at line 123 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 128 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 142 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 122 of file Variable.h.

Referenced by Dump(), and GetType().


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