#ifndef liblldb_Symbol_h_
#define liblldb_Symbol_h_
#include "lldb/lldb-private.h"
#include "lldb/Core/AddressRange.h"
#include "lldb/Core/Mangled.h"
#include "lldb/Core/UserID.h"
#include "lldb/Symbol/SymbolContextScope.h"
namespace lldb_private {
class Symbol :
public SymbolContextScope
{
public:
Symbol();
Symbol (uint32_t symID,
const char *name,
bool name_is_mangled,
lldb::SymbolType type,
bool external,
bool is_debug,
bool is_trampoline,
bool is_artificial,
const lldb::SectionSP §ion_sp,
lldb::addr_t value,
lldb::addr_t size,
bool size_is_valid,
uint32_t flags);
Symbol (uint32_t symID,
const char *name,
bool name_is_mangled,
lldb::SymbolType type,
bool external,
bool is_debug,
bool is_trampoline,
bool is_artificial,
const AddressRange &range,
bool size_is_valid,
uint32_t flags);
Symbol (const Symbol& rhs);
const Symbol&
operator= (const Symbol& rhs);
void
Clear();
bool
Compare (const ConstString& name, lldb::SymbolType type) const;
void
Dump (Stream *s, Target *target, uint32_t index) const;
bool
ValueIsAddress() const;
Address &
GetAddress()
{
return m_addr_range.GetBaseAddress();
}
const Address &
GetAddress() const
{
return m_addr_range.GetBaseAddress();
}
const ConstString &
GetName () const
{
return m_mangled.GetName();
}
uint32_t
GetID() const
{
return m_uid;
}
void
SetID(uint32_t uid)
{
m_uid = uid;
}
Mangled&
GetMangled ()
{
return m_mangled;
}
const Mangled&
GetMangled () const
{
return m_mangled;
}
ConstString
GetReExportedSymbolName() const;
FileSpec
GetReExportedSymbolSharedLibrary () const;
bool
SetReExportedSymbolName(const ConstString &name);
bool
SetReExportedSymbolSharedLibrary (const FileSpec &fspec);
Symbol *
ResolveReExportedSymbol (Target &target);
uint32_t
GetSiblingIndex () const;
lldb::SymbolType
GetType () const
{
return (lldb::SymbolType)m_type;
}
void
SetType (lldb::SymbolType type)
{
m_type = (lldb::SymbolType)type;
}
const char *
GetTypeAsString () const;
uint32_t
GetFlags () const
{
return m_flags;
}
void
SetFlags (uint32_t flags)
{
m_flags = flags;
}
void
GetDescription (Stream *s, lldb::DescriptionLevel level, Target *target) const;
bool
IsSynthetic () const
{
return m_is_synthetic;
}
void
SetIsSynthetic (bool b)
{
m_is_synthetic = b;
}
bool
GetSizeIsSynthesized() const
{
return m_size_is_synthesized;
}
void
SetSizeIsSynthesized(bool b)
{
m_size_is_synthesized = b;
}
bool
IsDebug () const
{
return m_is_debug;
}
void
SetDebug (bool b)
{
m_is_debug = b;
}
bool
IsExternal () const
{
return m_is_external;
}
void
SetExternal (bool b)
{
m_is_external = b;
}
bool
IsTrampoline () const;
bool
IsIndirect () const;
bool
GetByteSizeIsValid () const
{
return m_size_is_valid;
}
lldb::addr_t
GetByteSize () const;
void
SetByteSize (lldb::addr_t size)
{
m_size_is_valid = size > 0;
m_addr_range.SetByteSize(size);
}
bool
GetSizeIsSibling () const
{
return m_size_is_sibling;
}
void
SetSizeIsSibling (bool b)
{
m_size_is_sibling = b;
}
uint32_t
GetPrologueByteSize ();
bool
GetDemangledNameIsSynthesized() const
{
return m_demangled_is_synthesized;
}
void
SetDemangledNameIsSynthesized(bool b)
{
m_demangled_is_synthesized = b;
}
virtual void
CalculateSymbolContext (SymbolContext *sc);
virtual lldb::ModuleSP
CalculateSymbolContextModule ();
virtual Symbol *
CalculateSymbolContextSymbol ();
virtual void
DumpSymbolContext (Stream *s);
protected:
uint32_t m_uid; uint16_t m_type_data; uint16_t m_type_data_resolved:1, m_is_synthetic:1, m_is_debug:1, m_is_external:1, m_size_is_sibling:1, m_size_is_synthesized:1, m_size_is_valid:1,
m_demangled_is_synthesized:1, m_type:8;
Mangled m_mangled; AddressRange m_addr_range; uint32_t m_flags; };
}
#endif // liblldb_Symbol_h_