Added the ability to get all section contents, or the section
contents starting at an offset (2 separate methods). This helps
the scripting interface stay more natural by allowing both from
Python.
Added the ability to dump data with address annotations when
call SBData::GetDescription().
Hooked up the SBSection to the __repr__ so you can print section
objects from within python.
Improved the dumping of symbols from python.
Fixed the .i interface references which were set to "Relative to this Group"
which somehow included Jim's "lldb-clean" root directory in the path. The
interfaces are now in a folder called "interfaces" withing the Xcode API
subfolder.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140451 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBData.cpp b/source/API/SBData.cpp
index 5859341..e3c1e43 100644
--- a/source/API/SBData.cpp
+++ b/source/API/SBData.cpp
@@ -412,7 +412,7 @@
}
bool
-SBData::GetDescription (lldb::SBStream &description)
+SBData::GetDescription (lldb::SBStream &description, lldb::addr_t base_addr)
{
if (m_opaque_sp)
{
@@ -423,7 +423,7 @@
1,
m_opaque_sp->GetByteSize(),
16,
- LLDB_INVALID_ADDRESS,
+ base_addr,
0,
0);
}
diff --git a/source/API/SBSection.cpp b/source/API/SBSection.cpp
index 2636dd0..3a6efb4 100644
--- a/source/API/SBSection.cpp
+++ b/source/API/SBSection.cpp
@@ -12,8 +12,9 @@
#include "lldb/Core/DataBuffer.h"
#include "lldb/Core/DataExtractor.h"
#include "lldb/Core/Log.h"
-#include "lldb/Core/Section.h"
#include "lldb/Core/Module.h"
+#include "lldb/Core/Section.h"
+#include "lldb/Core/StreamString.h"
namespace lldb_private
{
@@ -238,6 +239,12 @@
}
SBData
+SBSection::GetSectionData ()
+{
+ return GetSectionData (0, UINT64_MAX);
+}
+
+SBData
SBSection::GetSectionData (uint64_t offset, uint64_t size)
{
SBData sb_data;
@@ -319,9 +326,12 @@
bool
SBSection::GetDescription (SBStream &description)
{
- if (m_opaque_ap.get())
+ if (IsValid())
{
- description.Printf ("SBSection");
+ const Section *section = m_opaque_ap->GetSection();
+ const addr_t file_addr = section->GetFileAddress();
+ description.Printf ("[0x%16.16llx-0x%16.16llx) ", file_addr, file_addr + section->GetByteSize());
+ section->DumpName(description.get());
}
else
{