================
@@ -224,6 +224,14 @@ const char *Status::AsCString(const char 
*default_error_str) const {
     if (!m_string.empty() && m_string[m_string.size() - 1] == '\n')
       m_string.pop_back();
 
+  // FIXME: Workaround for ErrorList[ExpressionError, ...].
+  if (m_error.isA<llvm::ErrorList>()) {
+    while (!m_string.empty() && m_string[0] == '\n')
+      m_string = std::string(m_string.data() + 1, m_string.size() - 1);
+    if (!m_string.empty() && m_string[m_string.size() - 1] != '\n')
+      m_string += '\n';
+  }
----------------
labath wrote:

Also, stepping back a bit, I'm wondering if using an ErrorList is the best way 
to represent these errors. The alternative I'm considering is having a single 
ExpressionError object which contains a vector of "diagnostics" as a regular 
member. If nothing else, that would give you more control over how these get 
serialized into a string (but maybe it would also be easier to print them out 
using the fancy ascii art?)

https://github.com/llvm/llvm-project/pull/106442
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to