[Lldb-commits] [lldb] [lldb] Store expression evaluator diagnostics in an llvm::Error (NFC) (PR #106442)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 25 02:50:24 PDT 2024


================
@@ -61,8 +65,50 @@ std::string DiagnosticManager::GetString(char separator) {
       stream << message.drop_front(severity_pos + severity.size());
     stream << separator;
   }
+  return str;
+}
 
-  return ret;
+void DiagnosticManager::Dump(Log *log) {
+  if (!log)
+    return;
+
+  std::string str = GetString();
+
+  // We want to remove the last '\n' because log->PutCString will add
+  // one for us.
+
+  if (str.size() && str.back() == '\n')
----------------
labath wrote:

```suggestion
  if (!str.empty() && str.back() == '\n')
```

https://github.com/llvm/llvm-project/pull/106442


More information about the lldb-commits mailing list