summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBBlock.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/SBBlock.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/SBBlock.cpp')
-rw-r--r--lldb/source/API/SBBlock.cpp71
1 files changed, 69 insertions, 2 deletions
diff --git a/lldb/source/API/SBBlock.cpp b/lldb/source/API/SBBlock.cpp
index 860f9b9f74f..bc7392c11f9 100644
--- a/lldb/source/API/SBBlock.cpp
+++ b/lldb/source/API/SBBlock.cpp
@@ -8,8 +8,10 @@
//===----------------------------------------------------------------------===//
#include "lldb/API/SBBlock.h"
+#include "lldb/API/SBAddress.h"
#include "lldb/API/SBFileSpec.h"
#include "lldb/API/SBStream.h"
+#include "lldb/Core/AddressRange.h"
#include "lldb/Symbol/Block.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/SymbolContext.h"
@@ -127,6 +129,15 @@ SBBlock::GetParent ()
return sb_block;
}
+lldb::SBBlock
+SBBlock::GetContainingInlinedBlock ()
+{
+ SBBlock sb_block;
+ if (m_opaque_ptr)
+ sb_block.m_opaque_ptr = m_opaque_ptr->GetContainingInlinedBlock ();
+ return sb_block;
+}
+
SBBlock
SBBlock::GetSibling ()
{
@@ -145,8 +156,8 @@ SBBlock::GetFirstChild ()
return sb_block;
}
-const lldb_private::Block *
-SBBlock::get () const
+lldb_private::Block *
+SBBlock::get ()
{
return m_opaque_ptr;
}
@@ -181,3 +192,59 @@ SBBlock::GetDescription (SBStream &description)
return true;
}
+
+uint32_t
+SBBlock::GetNumRanges ()
+{
+ if (m_opaque_ptr)
+ return m_opaque_ptr->GetNumRanges();
+ return 0;
+}
+
+lldb::SBAddress
+SBBlock::GetRangeStartAddress (uint32_t idx)
+{
+ lldb::SBAddress sb_addr;
+ if (m_opaque_ptr)
+ {
+ AddressRange range;
+ if (m_opaque_ptr->GetRangeAtIndex(idx, range))
+ {
+ sb_addr.ref() = range.GetBaseAddress();
+ }
+ }
+ return sb_addr;
+}
+
+lldb::SBAddress
+SBBlock::GetRangeEndAddress (uint32_t idx)
+{
+ lldb::SBAddress sb_addr;
+ if (m_opaque_ptr)
+ {
+ AddressRange range;
+ if (m_opaque_ptr->GetRangeAtIndex(idx, range))
+ {
+ sb_addr.ref() = range.GetBaseAddress();
+ sb_addr.ref().Slide(range.GetByteSize());
+ }
+ }
+ return sb_addr;
+}
+
+uint32_t
+SBBlock::GetRangeIndexForBlockAddress (lldb::SBAddress block_addr)
+{
+ if (m_opaque_ptr && block_addr.IsValid())
+ {
+ uint32_t range_idx = UINT32_MAX;
+ AddressRange range;
+ if (m_opaque_ptr->GetRangeContainingAddress (block_addr.ref(), range, &range_idx))
+ {
+ return range_idx;
+ }
+ }
+
+ return UINT32_MAX;
+}
+
OpenPOWER on IntegriCloud