Fix TestDataFormatterScript for Linux.
authorChaoren Lin <chaorenl@google.com>
Fri, 29 Jan 2016 03:48:08 +0000 (03:48 +0000)
committerChaoren Lin <chaorenl@google.com>
Fri, 29 Jan 2016 03:48:08 +0000 (03:48 +0000)
Summary:
m_function_name will contain a dummy name for the auto-generated function from
the python script on Linux. Check for script name first.

Reviewers: granata.enrico

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D16703

llvm-svn: 259153

lldb/source/DataFormatters/TypeSummary.cpp

index 1ef9ea6..dd4cd97 100644 (file)
@@ -263,21 +263,20 @@ ScriptSummaryFormat::GetDescription ()
                  SkipsPointers() ? " (skip pointers)" : "",
                  SkipsReferences() ? " (skip references)" : "",
                  HideNames(nullptr) ? " (hide member names)" : "");
-    if (m_function_name.empty())
+    if (m_python_script.empty())
     {
-        if (m_python_script.empty())
+        if (m_function_name.empty())
         {
             sstr.PutCString("no backing script");
         }
         else
         {
-            sstr.PutCString(m_python_script.c_str());
+            sstr.PutCString(m_function_name.c_str());
         }
     }
     else
     {
-        sstr.PutCString(m_function_name.c_str());
+        sstr.PutCString(m_python_script.c_str());
     }
     return sstr.GetString();
-    
 }