#ifndef liblldb_Variable_h_
#define liblldb_Variable_h_
#include <vector>
#include "lldb/lldb-private.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/Core/Mangled.h"
#include "lldb/Core/UserID.h"
#include "lldb/Expression/DWARFExpression.h"
#include "lldb/Symbol/Declaration.h"
namespace lldb_private {
class Variable : public UserID
{
public:
Variable (lldb::user_id_t uid,
const char *name,
const char *mangled, const lldb::SymbolFileTypeSP &symfile_type_sp,
lldb::ValueType scope,
SymbolContextScope *owner_scope,
Declaration* decl,
const DWARFExpression& location,
bool external,
bool artificial);
virtual
~Variable();
void
Dump(Stream *s, bool show_context) const;
bool
DumpDeclaration (Stream *s,
bool show_fullpaths,
bool show_module);
const Declaration&
GetDeclaration() const
{
return m_declaration;
}
const ConstString&
GetName() const;
SymbolContextScope *
GetSymbolContextScope() const
{
return m_owner_scope;
}
bool
NameMatches (const ConstString &name) const
{
if (m_name == name)
return true;
return m_mangled.NameMatches (name);
}
bool
NameMatches (const RegularExpression& regex) const;
Type *
GetType();
lldb::ValueType
GetScope() const
{
return m_scope;
}
bool
IsExternal() const
{
return m_external;
}
bool
IsArtificial() const
{
return m_artificial;
}
DWARFExpression &
LocationExpression()
{
return m_location;
}
const DWARFExpression &
LocationExpression() const
{
return m_location;
}
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
{
return m_loc_is_const_data;
}
void
SetLocationIsConstantValueData (bool b)
{
m_loc_is_const_data = b;
}
typedef uint32_t (*GetVariableCallback) (void *baton,
const char *name,
VariableList &var_list);
static Error
GetValuesForVariableExpressionPath (const char *variable_expr_path,
ExecutionContextScope *scope,
GetVariableCallback callback,
void *baton,
VariableList &variable_list,
ValueObjectList &valobj_list);
protected:
ConstString m_name; Mangled m_mangled; lldb::SymbolFileTypeSP m_symfile_type_sp; lldb::ValueType m_scope; SymbolContextScope *m_owner_scope; Declaration m_declaration; DWARFExpression m_location; uint8_t m_external:1, m_artificial:1, m_loc_is_const_data:1; private:
Variable(const Variable& rhs);
Variable& operator=(const Variable& rhs);
};
}
#endif // liblldb_Variable_h_