summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/FormatEntity.cpp
diff options
context:
space:
mode:
authorAbhishek Aggarwal <abhishek.a.aggarwal@intel.com>2017-05-29 08:25:46 +0000
committerAbhishek Aggarwal <abhishek.a.aggarwal@intel.com>2017-05-29 08:25:46 +0000
commit5bfee5f1c8b11915b6c2c894b8f938f406c14e93 (patch)
tree631f4c95bcd505406d6483262b04193b32511626 /lldb/source/Core/FormatEntity.cpp
parentbf4aed2c38477758a7c5243f95675d55fe6d1633 (diff)
downloadbcm5719-llvm-5bfee5f1c8b11915b6c2c894b8f938f406c14e93.tar.gz
bcm5719-llvm-5bfee5f1c8b11915b6c2c894b8f938f406c14e93.zip
Added new API to SBStructuredData class
Summary: - Added API to access data types -- integer, double, array, string, boolean and dictionary data types -- Earlier user had to parse through the string output to get these values - Added Test cases for API testing - Added new StructuredDataType enum in public include file -- Replaced locally-defined enum in StructuredData.h with this new one -- Modified other internal files using this locally-defined enum Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com> Reviewers: clayborg, lldb-commits Reviewed By: clayborg Subscribers: labath Differential Revision: https://reviews.llvm.org/D33434 llvm-svn: 304138
Diffstat (limited to 'lldb/source/Core/FormatEntity.cpp')
-rw-r--r--lldb/source/Core/FormatEntity.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp
index 9fb294aad2f..e3c346f79d6 100644
--- a/lldb/source/Core/FormatEntity.cpp
+++ b/lldb/source/Core/FormatEntity.cpp
@@ -1040,24 +1040,24 @@ static bool FormatThreadExtendedInfoRecurse(
thread_info_dictionary->GetObjectForDotSeparatedPath(path);
if (value) {
- if (value->GetType() == StructuredData::Type::eTypeInteger) {
+ if (value->GetType() == eStructuredDataTypeInteger) {
const char *token_format = "0x%4.4" PRIx64;
if (!entry.printf_format.empty())
token_format = entry.printf_format.c_str();
s.Printf(token_format, value->GetAsInteger()->GetValue());
return true;
- } else if (value->GetType() == StructuredData::Type::eTypeFloat) {
+ } else if (value->GetType() == eStructuredDataTypeFloat) {
s.Printf("%f", value->GetAsFloat()->GetValue());
return true;
- } else if (value->GetType() == StructuredData::Type::eTypeString) {
+ } else if (value->GetType() == eStructuredDataTypeString) {
s.Format("{0}", value->GetAsString()->GetValue());
return true;
- } else if (value->GetType() == StructuredData::Type::eTypeArray) {
+ } else if (value->GetType() == eStructuredDataTypeArray) {
if (value->GetAsArray()->GetSize() > 0) {
s.Printf("%zu", value->GetAsArray()->GetSize());
return true;
}
- } else if (value->GetType() == StructuredData::Type::eTypeDictionary) {
+ } else if (value->GetType() == eStructuredDataTypeDictionary) {
s.Printf("%zu",
value->GetAsDictionary()->GetKeys()->GetAsArray()->GetSize());
return true;
@@ -1346,7 +1346,7 @@ bool FormatEntity::Format(const Entry &entry, Stream &s,
if (thread) {
StructuredData::ObjectSP object_sp = thread->GetExtendedInfo();
if (object_sp &&
- object_sp->GetType() == StructuredData::Type::eTypeDictionary) {
+ object_sp->GetType() == eStructuredDataTypeDictionary) {
if (FormatThreadExtendedInfoRecurse(entry, object_sp, sc, exe_ctx, s))
return true;
}
OpenPOWER on IntegriCloud