[Lldb-commits] [lldb] r167263 - in /lldb/trunk/source/Core: DataExtractor.cpp FormatManager.cpp
Jason Molenda
jmolenda at apple.com
Thu Nov 1 16:35:20 PDT 2012
Author: jmolenda
Date: Thu Nov 1 18:35:19 2012
New Revision: 167263
URL: http://llvm.org/viewvc/llvm-project?rev=167263&view=rev
Log:
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.
Modified:
lldb/trunk/source/Core/DataExtractor.cpp
lldb/trunk/source/Core/FormatManager.cpp
Modified: lldb/trunk/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=167263&r1=167262&r2=167263&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp Thu Nov 1 18:35:19 2012
@@ -1710,23 +1710,25 @@
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<float>::digits10);
ss << GetFloat(&offset);
- break;
- case sizeof(double):
+ }
+ else if (item_byte_size == sizeof(double))
+ {
ss.precision(std::numeric_limits<double>::digits10);
ss << GetDouble(&offset);
- break;
- case sizeof(long double):
+ }
+ else if (item_byte_size == sizeof(long double))
+ {
ss.precision(std::numeric_limits<long double>::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());
Modified: lldb/trunk/source/Core/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatManager.cpp?rev=167263&r1=167262&r2=167263&view=diff
==============================================================================
--- lldb/trunk/source/Core/FormatManager.cpp (original)
+++ lldb/trunk/source/Core/FormatManager.cpp Thu Nov 1 18:35:19 2012
@@ -955,7 +955,7 @@
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<false>, "SEL summary", ConstString("SEL"), objc_flags);
@@ -963,7 +963,6 @@
AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider<false>, "SEL summary", ConstString("objc_selector"), objc_flags);
AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider<true>, "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
More information about the lldb-commits
mailing list