summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBLineEntry.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-09-26 07:11:27 +0000
committerGreg Clayton <gclayton@apple.com>2011-09-26 07:11:27 +0000
commit8f7180b11e024406e50ed53e27c95af461e6ec4d (patch)
tree58923ba4e035f927163db21665e0d69d20699317 /lldb/source/API/SBLineEntry.cpp
parent1748b37acd1826d9f02f75fbace1be49a596eae1 (diff)
downloadbcm5719-llvm-8f7180b11e024406e50ed53e27c95af461e6ec4d.tar.gz
bcm5719-llvm-8f7180b11e024406e50ed53e27c95af461e6ec4d.zip
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
Diffstat (limited to 'lldb/source/API/SBLineEntry.cpp')
-rw-r--r--lldb/source/API/SBLineEntry.cpp52
1 files changed, 41 insertions, 11 deletions
diff --git a/lldb/source/API/SBLineEntry.cpp b/lldb/source/API/SBLineEntry.cpp
index 3567a3839c5..6915f58b24d 100644
--- a/lldb/source/API/SBLineEntry.cpp
+++ b/lldb/source/API/SBLineEntry.cpp
@@ -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;
}
OpenPOWER on IntegriCloud