From cc57a383258d1f1d5ed7308268a0eda4d49aba61 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Thu, 1 Nov 2012 23:35:19 +0000 Subject: [PATCH] Change DataExtractor::Dump() to use a series of if..else if statements instead of a switch for the size of the floating point types; some architectures sizeof double and sizeof long double are the same and that's invalid in a switch. Fix the LLDB_DISABLE_PYTHON ifdef block in FormatManager::LoadObjCFormatters so it builds on arm again. llvm-svn: 167263 --- lldb/source/Core/DataExtractor.cpp | 22 ++++++++++++---------- lldb/source/Core/FormatManager.cpp | 3 +-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp index d08679c..d9255a4 100644 --- a/lldb/source/Core/DataExtractor.cpp +++ b/lldb/source/Core/DataExtractor.cpp @@ -1710,23 +1710,25 @@ DataExtractor::Dump (Stream *s, case eFormatFloat: { std::ostringstream ss; - switch (item_byte_size) + if (item_byte_size == sizeof(float)) { - default: - s->Printf("error: unsupported byte size (%u) for float format", item_byte_size); - return offset; - case sizeof(float): ss.precision(std::numeric_limits::digits10); ss << GetFloat(&offset); - break; - case sizeof(double): + } + else if (item_byte_size == sizeof(double)) + { ss.precision(std::numeric_limits::digits10); ss << GetDouble(&offset); - break; - case sizeof(long double): + } + else if (item_byte_size == sizeof(long double)) + { ss.precision(std::numeric_limits::digits10); ss << GetLongDouble(&offset); - break; + } + else + { + s->Printf("error: unsupported byte size (%u) for float format", item_byte_size); + return offset; } ss.flush(); s->Printf("%s", ss.str().c_str()); diff --git a/lldb/source/Core/FormatManager.cpp b/lldb/source/Core/FormatManager.cpp index e28c0d4..c93e94b 100644 --- a/lldb/source/Core/FormatManager.cpp +++ b/lldb/source/Core/FormatManager.cpp @@ -955,7 +955,7 @@ FormatManager::LoadObjCFormatters() objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL *"), ObjC_BOOL_summary); - +#ifndef LLDB_DISABLE_PYTHON // we need to skip pointers here since we are special casing a SEL* when retrieving its value objc_flags.SetSkipPointers(true); AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider, "SEL summary", ConstString("SEL"), objc_flags); @@ -963,7 +963,6 @@ FormatManager::LoadObjCFormatters() AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider, "SEL summary", ConstString("objc_selector"), objc_flags); AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider, "SEL summary", ConstString("objc_selector *"), objc_flags); -#ifndef LLDB_DISABLE_PYTHON AddScriptSummary(objc_category_sp, "lldb.formatters.objc.Class.Class_Summary", ConstString("Class"), objc_flags); #endif // LLDB_DISABLE_PYTHON -- 2.7.4