[Lldb-commits] [PATCH] D16703: Fix TestDataFormatterScript for Linux.

2016-01-28 Thread Chaoren Lin via lldb-commits
chaoren created this revision.
chaoren added a reviewer: granata.enrico.
chaoren added a subscriber: lldb-commits.

m_function_name will contain a dummy name for the auto-generated function from
the python script on Linux. Check for script name first.

http://reviews.llvm.org/D16703

Files:
  source/DataFormatters/TypeSummary.cpp

Index: source/DataFormatters/TypeSummary.cpp
===
--- source/DataFormatters/TypeSummary.cpp
+++ source/DataFormatters/TypeSummary.cpp
@@ -263,21 +263,20 @@
  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();
-
 }


Index: source/DataFormatters/TypeSummary.cpp
===
--- source/DataFormatters/TypeSummary.cpp
+++ source/DataFormatters/TypeSummary.cpp
@@ -263,21 +263,20 @@
  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();
-
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16703: Fix TestDataFormatterScript for Linux.

2016-01-28 Thread Chaoren Lin via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL259153: Fix TestDataFormatterScript for Linux. (authored by 
chaoren).

Changed prior to commit:
  http://reviews.llvm.org/D16703?vs=46330=46340#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16703

Files:
  lldb/trunk/source/DataFormatters/TypeSummary.cpp

Index: lldb/trunk/source/DataFormatters/TypeSummary.cpp
===
--- lldb/trunk/source/DataFormatters/TypeSummary.cpp
+++ lldb/trunk/source/DataFormatters/TypeSummary.cpp
@@ -263,21 +263,20 @@
  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();
-
 }


Index: lldb/trunk/source/DataFormatters/TypeSummary.cpp
===
--- lldb/trunk/source/DataFormatters/TypeSummary.cpp
+++ lldb/trunk/source/DataFormatters/TypeSummary.cpp
@@ -263,21 +263,20 @@
  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();
-
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D16703: Fix TestDataFormatterScript for Linux.

2016-01-28 Thread Enrico Granata via lldb-commits
granata.enrico added a comment.

That seems reasonable, yes.

In general, I wish I had done this not via two strings - only one of which gets 
to be valid in some arbitrary order - but via either two distinct subclasses, 
or at least via a pair of a string and an enum class specifying the kind.

But that is clearly beyond the scope of you fixing this test case. Your change 
is fine.


Repository:
  rL LLVM

http://reviews.llvm.org/D16703



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits