summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/SBAddress.cpp6
-rw-r--r--lldb/source/API/SBBlock.cpp10
-rw-r--r--lldb/source/API/SBBreakpointLocation.cpp9
-rw-r--r--lldb/source/API/SBCommandReturnObject.cpp16
-rw-r--r--lldb/source/API/SBCompileUnit.cpp7
-rw-r--r--lldb/source/API/SBData.cpp25
-rw-r--r--lldb/source/API/SBDebugger.cpp6
-rw-r--r--lldb/source/API/SBEvent.cpp14
-rw-r--r--lldb/source/API/SBFileSpec.cpp6
-rw-r--r--lldb/source/API/SBFileSpecList.cpp9
-rw-r--r--lldb/source/API/SBFrame.cpp7
-rw-r--r--lldb/source/API/SBLineEntry.cpp8
-rw-r--r--lldb/source/API/SBModule.cpp7
-rw-r--r--lldb/source/API/SBProcess.cpp16
-rw-r--r--lldb/source/API/SBSection.cpp8
-rw-r--r--lldb/source/API/SBSymbol.cpp7
-rw-r--r--lldb/source/API/SBSymbolContext.cpp7
-rw-r--r--lldb/source/API/SBTarget.cpp20
-rw-r--r--lldb/source/API/SBThread.cpp7
-rw-r--r--lldb/source/API/SBType.cpp71
-rw-r--r--lldb/source/API/SBValue.cpp19
-rw-r--r--lldb/source/API/SBWatchpoint.cpp9
22 files changed, 175 insertions, 119 deletions
diff --git a/lldb/source/API/SBAddress.cpp b/lldb/source/API/SBAddress.cpp
index 9066bb448fb..dcd9581d6b5 100644
--- a/lldb/source/API/SBAddress.cpp
+++ b/lldb/source/API/SBAddress.cpp
@@ -277,11 +277,11 @@ SBAddress::GetDescription (SBStream &description)
{
// Call "ref()" on the stream to make sure it creates a backing stream in
// case there isn't one already...
- description.ref();
+ Stream &strm = description.ref();
if (m_opaque_ap.get())
- m_opaque_ap->GetAddress().Dump (description.get(), NULL, Address::DumpStyleModuleWithFileAddress, Address::DumpStyleInvalid, 4);
+ m_opaque_ap->GetAddress().Dump (&strm, NULL, Address::DumpStyleModuleWithFileAddress, Address::DumpStyleInvalid, 4);
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBBlock.cpp b/lldb/source/API/SBBlock.cpp
index 580d2b5a213..eeae1d3b02b 100644
--- a/lldb/source/API/SBBlock.cpp
+++ b/lldb/source/API/SBBlock.cpp
@@ -171,24 +171,26 @@ SBBlock::reset (lldb_private::Block *block)
bool
SBBlock::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (m_opaque_ptr)
{
lldb::user_id_t id = m_opaque_ptr->GetID();
- description.Printf ("Block: {id: %llu} ", id);
+ strm.Printf ("Block: {id: %llu} ", id);
if (IsInlined())
{
- description.Printf (" (inlined, '%s') ", GetInlinedName());
+ strm.Printf (" (inlined, '%s') ", GetInlinedName());
}
lldb_private::SymbolContext sc;
m_opaque_ptr->CalculateSymbolContext (&sc);
if (sc.function)
{
- m_opaque_ptr->DumpAddressRanges (description.get(),
+ m_opaque_ptr->DumpAddressRanges (&strm,
sc.function->GetAddressRange().GetBaseAddress().GetFileAddress());
}
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBBreakpointLocation.cpp b/lldb/source/API/SBBreakpointLocation.cpp
index 20e4ac870d4..619428eb8c8 100644
--- a/lldb/source/API/SBBreakpointLocation.cpp
+++ b/lldb/source/API/SBBreakpointLocation.cpp
@@ -275,15 +275,16 @@ SBBreakpointLocation::SetLocation (const lldb::BreakpointLocationSP &break_loc_s
bool
SBBreakpointLocation::GetDescription (SBStream &description, DescriptionLevel level)
{
+ Stream &strm = description.ref();
+
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex());
- description.ref();
- m_opaque_sp->GetDescription (description.get(), level);
- description.get()->EOL();
+ m_opaque_sp->GetDescription (&strm, level);
+ strm.EOL();
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBCommandReturnObject.cpp b/lldb/source/API/SBCommandReturnObject.cpp
index d17de941935..ffff751a10a 100644
--- a/lldb/source/API/SBCommandReturnObject.cpp
+++ b/lldb/source/API/SBCommandReturnObject.cpp
@@ -221,27 +221,29 @@ SBCommandReturnObject::SetLLDBObjectPtr (CommandReturnObject *ptr)
bool
SBCommandReturnObject::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (m_opaque_ap.get())
{
description.Printf ("Status: ");
lldb::ReturnStatus status = m_opaque_ap->GetStatus();
if (status == lldb::eReturnStatusStarted)
- description.Printf ("Started");
+ strm.PutCString ("Started");
else if (status == lldb::eReturnStatusInvalid)
- description.Printf ("Invalid");
+ strm.PutCString ("Invalid");
else if (m_opaque_ap->Succeeded())
- description.Printf ("Success");
+ strm.PutCString ("Success");
else
- description.Printf ("Fail");
+ strm.PutCString ("Fail");
if (GetOutputSize() > 0)
- description.Printf ("\nOutput Message:\n%s", GetOutput());
+ strm.Printf ("\nOutput Message:\n%s", GetOutput());
if (GetErrorSize() > 0)
- description.Printf ("\nError Message:\n%s", GetError());
+ strm.Printf ("\nError Message:\n%s", GetError());
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBCompileUnit.cpp b/lldb/source/API/SBCompileUnit.cpp
index 15903627016..b1bb447753d 100644
--- a/lldb/source/API/SBCompileUnit.cpp
+++ b/lldb/source/API/SBCompileUnit.cpp
@@ -189,13 +189,14 @@ SBCompileUnit::reset (lldb_private::CompileUnit *lldb_object_ptr)
bool
SBCompileUnit::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (m_opaque_ptr)
{
- description.ref();
- m_opaque_ptr->Dump (description.get(), false);
+ m_opaque_ptr->Dump (&strm, false);
}
else
- description.Printf ("No Value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBData.cpp b/lldb/source/API/SBData.cpp
index e5c29a9ea01..f8735266236 100644
--- a/lldb/source/API/SBData.cpp
+++ b/lldb/source/API/SBData.cpp
@@ -13,6 +13,8 @@
#include "lldb/Core/DataExtractor.h"
#include "lldb/Core/Log.h"
+#include "lldb/Core/Stream.h"
+
using namespace lldb;
using namespace lldb_private;
@@ -414,21 +416,22 @@ SBData::GetString (lldb::SBError& error, uint32_t offset)
bool
SBData::GetDescription (lldb::SBStream &description, lldb::addr_t base_addr)
{
+ Stream &strm = description.ref();
+
if (m_opaque_sp)
{
- description.ref();
- m_opaque_sp->Dump(description.get(),
- 0,
- lldb::eFormatBytesWithASCII,
- 1,
- m_opaque_sp->GetByteSize(),
- 16,
- base_addr,
- 0,
- 0);
+ m_opaque_sp->Dump (&strm,
+ 0,
+ lldb::eFormatBytesWithASCII,
+ 1,
+ m_opaque_sp->GetByteSize(),
+ 16,
+ base_addr,
+ 0,
+ 0);
}
else
- description.Printf ("No Value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index dfef7eb3178..b15bc3d7611 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -965,14 +965,16 @@ SBDebugger::GetUseExternalEditor ()
bool
SBDebugger::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (m_opaque_sp)
{
const char *name = m_opaque_sp->GetInstanceName().AsCString();
user_id_t id = m_opaque_sp->GetID();
- description.Printf ("Debugger (instance: \"%s\", id: %llu)", name, id);
+ strm.Printf ("Debugger (instance: \"%s\", id: %llu)", name, id);
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBEvent.cpp b/lldb/source/API/SBEvent.cpp
index 19073e8c3ec..f9d0e0cc3a8 100644
--- a/lldb/source/API/SBEvent.cpp
+++ b/lldb/source/API/SBEvent.cpp
@@ -205,13 +205,14 @@ SBEvent::GetCStringFromEvent (const SBEvent &event)
bool
SBEvent::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (get())
{
- description.ref();
- m_opaque_ptr->Dump (description.get());
+ m_opaque_ptr->Dump (&strm);
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
@@ -219,13 +220,14 @@ SBEvent::GetDescription (SBStream &description)
bool
SBEvent::GetDescription (SBStream &description) const
{
+ Stream &strm = description.ref();
+
if (get())
{
- description.ref();
- m_opaque_ptr->Dump (description.get());
+ m_opaque_ptr->Dump (&strm);
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp
index a3a503dd601..a6c753caa00 100644
--- a/lldb/source/API/SBFileSpec.cpp
+++ b/lldb/source/API/SBFileSpec.cpp
@@ -13,6 +13,7 @@
#include "lldb/API/SBStream.h"
#include "lldb/Host/FileSpec.h"
#include "lldb/Core/Log.h"
+#include "lldb/Core/Stream.h"
using namespace lldb;
using namespace lldb_private;
@@ -200,14 +201,15 @@ SBFileSpec::SetFileSpec (const lldb_private::FileSpec& fs)
bool
SBFileSpec::GetDescription (SBStream &description) const
{
+ Stream &strm = description.ref();
if (m_opaque_ap.get())
{
char path[PATH_MAX];
if (m_opaque_ap->GetPath(path, sizeof(path)))
- description.Printf ("%s", path);
+ strm.PutCString (path);
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBFileSpecList.cpp b/lldb/source/API/SBFileSpecList.cpp
index a4250bc4c59..5f65bf51ef1 100644
--- a/lldb/source/API/SBFileSpecList.cpp
+++ b/lldb/source/API/SBFileSpecList.cpp
@@ -14,6 +14,7 @@
#include "lldb/API/SBStream.h"
#include "lldb/Core/FileSpecList.h"
#include "lldb/Core/Log.h"
+#include "lldb/Core/Stream.h"
#include "lldb/Host/FileSpec.h"
using namespace lldb;
@@ -121,19 +122,21 @@ SBFileSpecList::ref() const
bool
SBFileSpecList::GetDescription (SBStream &description) const
{
+ Stream &strm = description.ref();
+
if (m_opaque_ap.get())
{
uint32_t num_files = m_opaque_ap->GetSize();
- description.Printf ("%d files: ", num_files);
+ strm.Printf ("%d files: ", num_files);
for (uint32_t i = 0; i < num_files; i++)
{
char path[PATH_MAX];
if (m_opaque_ap->GetFileSpecAtIndex(i).GetPath(path, sizeof(path)))
- description.Printf ("\n %s", path);
+ strm.Printf ("\n %s", path);
}
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp
index 300ae2edd0c..a541047e9ad 100644
--- a/lldb/source/API/SBFrame.cpp
+++ b/lldb/source/API/SBFrame.cpp
@@ -708,14 +708,15 @@ SBFrame::GetRegisters ()
bool
SBFrame::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetThread().GetProcess().GetTarget().GetAPIMutex());
- Stream &s = description.ref();
- m_opaque_sp->DumpUsingSettingsFormat (&s);
+ m_opaque_sp->DumpUsingSettingsFormat (&strm);
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBLineEntry.cpp b/lldb/source/API/SBLineEntry.cpp
index 6915f58b24d..db288bc6f0c 100644
--- a/lldb/source/API/SBLineEntry.cpp
+++ b/lldb/source/API/SBLineEntry.cpp
@@ -225,16 +225,18 @@ SBLineEntry::ref() const
bool
SBLineEntry::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (m_opaque_ap.get())
{
char file_path[PATH_MAX*2];
m_opaque_ap->file.GetPath (file_path, sizeof (file_path));
- description.Printf ("%s:%u", file_path, GetLine());
+ strm.Printf ("%s:%u", file_path, GetLine());
if (GetColumn() > 0)
- description.Printf (":%u", GetColumn());
+ strm.Printf (":%u", GetColumn());
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index 98bb195ca72..a42989757e1 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -255,13 +255,14 @@ SBModule::ResolveSymbolContextForAddress (const SBAddress& addr, uint32_t resolv
bool
SBModule::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (m_opaque_sp)
{
- description.ref();
- m_opaque_sp->GetDescription (description.get());
+ m_opaque_sp->GetDescription (&strm);
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp
index d6bdfe162c7..66abd086c40 100644
--- a/lldb/source/API/SBProcess.cpp
+++ b/lldb/source/API/SBProcess.cpp
@@ -814,6 +814,8 @@ SBProcess::get() const
bool
SBProcess::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (m_opaque_sp)
{
char path[PATH_MAX];
@@ -823,15 +825,15 @@ SBProcess::GetDescription (SBStream &description)
if (exe_module)
exe_name = exe_module->GetFileSpec().GetFilename().AsCString();
- description.Printf ("SBProcess: pid = %llu, state = %s, threads = %d%s%s",
- m_opaque_sp->GetID(),
- lldb_private::StateAsCString (GetState()),
- GetNumThreads(),
- exe_name ? ", executable = " : "",
- exe_name ? exe_name : "");
+ strm.Printf ("SBProcess: pid = %llu, state = %s, threads = %d%s%s",
+ m_opaque_sp->GetID(),
+ lldb_private::StateAsCString (GetState()),
+ GetNumThreads(),
+ exe_name ? ", executable = " : "",
+ exe_name ? exe_name : "");
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBSection.cpp b/lldb/source/API/SBSection.cpp
index 3a6efb4d5f1..bdcf422e333 100644
--- a/lldb/source/API/SBSection.cpp
+++ b/lldb/source/API/SBSection.cpp
@@ -326,16 +326,18 @@ SBSection::operator != (const SBSection &rhs)
bool
SBSection::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (IsValid())
{
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());
+ strm.Printf ("[0x%16.16llx-0x%16.16llx) ", file_addr, file_addr + section->GetByteSize());
+ section->DumpName(&strm);
}
else
{
- description.Printf ("No value");
+ strm.PutCString ("No value");
}
return true;
diff --git a/lldb/source/API/SBSymbol.cpp b/lldb/source/API/SBSymbol.cpp
index ce232bf3f6a..1765dbddd8e 100644
--- a/lldb/source/API/SBSymbol.cpp
+++ b/lldb/source/API/SBSymbol.cpp
@@ -100,14 +100,15 @@ SBSymbol::operator != (const SBSymbol &rhs) const
bool
SBSymbol::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (m_opaque_ptr)
{
- description.ref();
- m_opaque_ptr->GetDescription (description.get(),
+ m_opaque_ptr->GetDescription (&strm,
lldb::eDescriptionLevelFull, NULL);
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBSymbolContext.cpp b/lldb/source/API/SBSymbolContext.cpp
index 01118c86483..1ec79df1ac0 100644
--- a/lldb/source/API/SBSymbolContext.cpp
+++ b/lldb/source/API/SBSymbolContext.cpp
@@ -254,13 +254,14 @@ SBSymbolContext::get() const
bool
SBSymbolContext::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (m_opaque_ap.get())
{
- description.ref();
- m_opaque_ap->GetDescription (description.get(), lldb::eDescriptionLevelFull, NULL);
+ m_opaque_ap->GetDescription (&strm, lldb::eDescriptionLevelFull, NULL);
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index f79d4f3c01c..58d89b197ae 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -1152,32 +1152,18 @@ SBTarget::GetBroadcaster () const
bool
SBTarget::GetDescription (SBStream &description, lldb::DescriptionLevel description_level)
{
- if (m_opaque_sp)
- {
- description.ref();
- m_opaque_sp->Dump (description.get(), description_level);
- }
- else
- description.Printf ("No value");
-
- return true;
-}
+ Stream &strm = description.ref();
-bool
-SBTarget::GetDescription (SBStream &description, lldb::DescriptionLevel description_level) const
-{
if (m_opaque_sp)
{
- description.ref();
- m_opaque_sp->Dump (description.get(), description_level);
+ m_opaque_sp->Dump (&strm, description_level);
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
-
uint32_t
SBTarget::FindFunctions (const char *name,
uint32_t name_type_mask,
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp
index cc3b84171c1..5fcd6379d0b 100644
--- a/lldb/source/API/SBThread.cpp
+++ b/lldb/source/API/SBThread.cpp
@@ -951,13 +951,14 @@ SBThread::operator*()
bool
SBThread::GetDescription (SBStream &description) const
{
+ Stream &strm = description.ref();
+
if (m_opaque_sp)
{
- StreamString strm;
- description.Printf("SBThread: tid = 0x%4.4llx", m_opaque_sp->GetID());
+ strm.Printf("SBThread: tid = 0x%4.4llx", m_opaque_sp->GetID());
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp
index 3064398e574..36fcfa7792f 100644
--- a/lldb/source/API/SBType.cpp
+++ b/lldb/source/API/SBType.cpp
@@ -18,6 +18,7 @@
#include "lldb/API/SBStream.h"
#include "lldb/Core/ConstString.h"
#include "lldb/Core/Log.h"
+#include "lldb/Core/Stream.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/ClangASTType.h"
#include "lldb/Symbol/Type.h"
@@ -342,6 +343,23 @@ SBType::GetNumberOfFields ()
return 0;
}
+bool
+SBType::GetDescription (SBStream &description, lldb::DescriptionLevel description_level)
+{
+ Stream &strm = description.ref();
+
+ if (m_opaque_sp)
+ {
+ m_opaque_sp->GetDescription (strm, description_level);
+ }
+ else
+ strm.PutCString ("No value");
+
+ return true;
+}
+
+
+
SBTypeMember
SBType::GetDirectBaseClassAtIndex (uint32_t idx)
{
@@ -349,12 +367,12 @@ SBType::GetDirectBaseClassAtIndex (uint32_t idx)
if (IsValid())
{
clang::ASTContext* ast = m_opaque_sp->GetASTContext();
- uint32_t byte_offset = 0;
- clang_type_t clang_type = ClangASTContext::GetDirectBaseClassAtIndex (ast, m_opaque_sp->GetOpaqueQualType(), idx, &byte_offset);
+ uint32_t bit_offset = 0;
+ clang_type_t clang_type = ClangASTContext::GetDirectBaseClassAtIndex (ast, m_opaque_sp->GetOpaqueQualType(), idx, &bit_offset);
if (clang_type)
{
TypeImplSP type_impl_sp (new TypeImpl(ClangASTType (ast, clang_type)));
- sb_type_member.reset (new TypeMemberImpl (type_impl_sp, byte_offset));
+ sb_type_member.reset (new TypeMemberImpl (type_impl_sp, bit_offset));
}
}
return sb_type_member;
@@ -367,13 +385,13 @@ SBType::GetVirtualBaseClassAtIndex (uint32_t idx)
SBTypeMember sb_type_member;
if (IsValid())
{
- uint32_t byte_offset = 0;
+ uint32_t bit_offset = 0;
clang::ASTContext* ast = m_opaque_sp->GetASTContext();
- clang_type_t clang_type = ClangASTContext::GetVirtualBaseClassAtIndex (ast, m_opaque_sp->GetOpaqueQualType(), idx, &byte_offset);
+ clang_type_t clang_type = ClangASTContext::GetVirtualBaseClassAtIndex (ast, m_opaque_sp->GetOpaqueQualType(), idx, &bit_offset);
if (clang_type)
{
TypeImplSP type_impl_sp (new TypeImpl(ClangASTType (ast, clang_type)));
- sb_type_member.reset (new TypeMemberImpl (type_impl_sp, byte_offset));
+ sb_type_member.reset (new TypeMemberImpl (type_impl_sp, bit_offset));
}
}
return sb_type_member;
@@ -385,17 +403,17 @@ SBType::GetFieldAtIndex (uint32_t idx)
SBTypeMember sb_type_member;
if (IsValid())
{
- uint32_t byte_offset = 0;
+ uint32_t bit_offset = 0;
clang::ASTContext* ast = m_opaque_sp->GetASTContext();
std::string name_sstr;
- clang_type_t clang_type = ClangASTContext::GetFieldAtIndex (ast, m_opaque_sp->GetOpaqueQualType(), idx, name_sstr, &byte_offset);
+ clang_type_t clang_type = ClangASTContext::GetFieldAtIndex (ast, m_opaque_sp->GetOpaqueQualType(), idx, name_sstr, &bit_offset);
if (clang_type)
{
ConstString name;
if (!name_sstr.empty())
name.SetCString(name_sstr.c_str());
TypeImplSP type_impl_sp (new TypeImpl(ClangASTType (ast, clang_type)));
- sb_type_member.reset (new TypeMemberImpl (type_impl_sp, byte_offset, name));
+ sb_type_member.reset (new TypeMemberImpl (type_impl_sp, bit_offset, name));
}
}
return sb_type_member;
@@ -545,13 +563,46 @@ SBTypeMember::GetType ()
}
uint64_t
-SBTypeMember::GetOffsetByteSize()
+SBTypeMember::GetOffsetInBytes()
{
if (m_opaque_ap.get())
return (m_opaque_ap->GetBitOffset() + 7) / 8u;
return 0;
}
+uint64_t
+SBTypeMember::GetOffsetInBits()
+{
+ if (m_opaque_ap.get())
+ return m_opaque_ap->GetBitOffset();
+ return 0;
+}
+
+bool
+SBTypeMember::GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level)
+{
+ Stream &strm = description.ref();
+
+ if (m_opaque_ap.get())
+ {
+ const uint32_t byte_offset = (m_opaque_ap->GetBitOffset() + 7) / 8u;
+ const char *name = m_opaque_ap->GetName().GetCString();
+ strm.Printf ("+%u: (", byte_offset);
+
+ TypeImplSP type_impl_sp (m_opaque_ap->GetTypeImpl());
+ if (type_impl_sp)
+ type_impl_sp->GetDescription(strm, description_level);
+
+ strm.Printf (") %s", name);
+ }
+ else
+ {
+ strm.PutCString ("No value");
+ }
+ return true;
+}
+
+
void
SBTypeMember::reset(TypeMemberImpl *type_member_impl)
{
diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp
index dc594cbfcba..6ef4c387258 100644
--- a/lldb/source/API/SBValue.cpp
+++ b/lldb/source/API/SBValue.cpp
@@ -917,25 +917,14 @@ SBValue::GetExpressionPath (SBStream &description, bool qualify_cxx_base_classes
bool
SBValue::GetDescription (SBStream &description)
{
+ Stream &strm = description.ref();
+
if (m_opaque_sp)
{
- /*uint32_t ptr_depth = 0;
- uint32_t curr_depth = 0;
- uint32_t max_depth = UINT32_MAX;
- bool show_types = false;
- bool show_location = false;
- bool use_objc = false;
- lldb::DynamicValueType use_dynamic = eNoDynamicValues;
- bool scope_already_checked = false;
- bool flat_output = false;
- bool use_synthetic = true;
- uint32_t no_summary_depth = 0;
- bool ignore_cap = false;*/
- ValueObject::DumpValueObject (description.ref(),
- m_opaque_sp.get());
+ ValueObject::DumpValueObject (strm, m_opaque_sp.get());
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
diff --git a/lldb/source/API/SBWatchpoint.cpp b/lldb/source/API/SBWatchpoint.cpp
index ec2dc128f15..f7885753641 100644
--- a/lldb/source/API/SBWatchpoint.cpp
+++ b/lldb/source/API/SBWatchpoint.cpp
@@ -229,15 +229,16 @@ SBWatchpoint::SetCondition (const char *condition)
bool
SBWatchpoint::GetDescription (SBStream &description, DescriptionLevel level)
{
+ Stream &strm = description.ref();
+
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
- description.ref();
- m_opaque_sp->GetDescription (description.get(), level);
- description.get()->EOL();
+ m_opaque_sp->GetDescription (&strm, level);
+ strm.EOL();
}
else
- description.Printf ("No value");
+ strm.PutCString ("No value");
return true;
}
OpenPOWER on IntegriCloud