Added more functionality to the public API to allow for better

symbolication. Also improved the SBInstruction API to allow
access to the instruction opcode name, mnemonics, comment and
instruction data.

Added the ability to edit SBLineEntry objects (change the file,
line and column), and also allow SBSymbolContext objects to be
modified (set module, comp unit, function, block, line entry
or symbol). 

The SymbolContext and SBSymbolContext can now generate inlined
call stack infomration for symbolication much easier using the
SymbolContext::GetParentInlinedFrameInfo(...) and 
SBSymbolContext::GetParentInlinedFrameInfo(...) methods.

llvm-svn: 140518
This commit is contained in:
Greg Clayton
2011-09-26 07:11:27 +00:00
parent 1748b37acd
commit 8f7180b11e
27 changed files with 774 additions and 79 deletions

View File

@@ -28,33 +28,33 @@ SBLineEntry::SBLineEntry (const SBLineEntry &rhs) :
m_opaque_ap ()
{
if (rhs.IsValid())
m_opaque_ap.reset (new lldb_private::LineEntry (*rhs));
ref() = rhs.ref();
}
SBLineEntry::SBLineEntry (const lldb_private::LineEntry *lldb_object_ptr) :
m_opaque_ap ()
{
if (lldb_object_ptr)
m_opaque_ap.reset (new lldb_private::LineEntry(*lldb_object_ptr));
ref() = *lldb_object_ptr;
}
const SBLineEntry &
SBLineEntry::operator = (const SBLineEntry &rhs)
{
if (this != &rhs && rhs.IsValid())
m_opaque_ap.reset (new lldb_private::LineEntry(*rhs));
if (this != &rhs)
{
if (rhs.IsValid())
ref() = rhs.ref();
else
m_opaque_ap.reset();
}
return *this;
}
void
SBLineEntry::SetLineEntry (const lldb_private::LineEntry &lldb_object_ref)
{
if (m_opaque_ap.get())
(*m_opaque_ap.get()) = lldb_object_ref;
else
m_opaque_ap.reset (new lldb_private::LineEntry (lldb_object_ref));
ref() = lldb_object_ref;
}
@@ -156,6 +156,28 @@ SBLineEntry::GetColumn () const
return 0;
}
void
SBLineEntry::SetFileSpec (lldb::SBFileSpec filespec)
{
if (filespec.IsValid())
ref().file = filespec.ref();
else
ref().file.Clear();
}
void
SBLineEntry::SetLine (uint32_t line)
{
ref().line = line;
}
void
SBLineEntry::SetColumn (uint32_t column)
{
ref().line = column;
}
bool
SBLineEntry::operator == (const SBLineEntry &rhs) const
{
@@ -186,8 +208,16 @@ SBLineEntry::operator->() const
return m_opaque_ap.get();
}
lldb_private::LineEntry &
SBLineEntry::ref()
{
if (m_opaque_ap.get() == NULL)
m_opaque_ap.reset (new lldb_private::LineEntry ());
return *m_opaque_ap;
}
const lldb_private::LineEntry &
SBLineEntry::operator*() const
SBLineEntry::ref() const
{
return *m_opaque_ap;
}