================
@@ -299,7 +299,9 @@ bool Watchpoint::DumpSnapshots(Stream *s, const char 
*prefix) const {
             .SetHideRootType(true)
             .SetHideRootName(true)
             .SetHideName(true);
-        m_old_value_sp->Dump(strm, options);
+        if (llvm::Error error = m_old_value_sp->Dump(strm, options))
+          strm << "error: " << toString(std::move(error));
----------------
JDevlieghere wrote:

Would this be worth color highlighting? 

```
llvm::WithColor(strm.AsRawOstream(), llvm::HighlightColor::Error,
                         llvm::ColorMode::Enable) << "error :";
strm <<  toString(std::move(error));
```

This should do the correct thing based on whether the stream has colors 
enabled. It's the same thing we do in `CommandReturnObject.cpp`. This applies 
to all the places where we write "error:" to the stream. 

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

Reply via email to