[Lldb-commits] [PATCH] D96558: [lldb] [Process/FreeBSDRemote] Ensure that errors are always handled

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 11 15:54:36 PST 2021


mgorny created this revision.
mgorny added reviewers: labath, krytarowski, emaste.
mgorny requested review of this revision.

Ensure that the llvm::Error instances are always considered handled
by moving the respective code out of LLDB_LOG.  Apparently the latter
may result in the error not being processed if the respective log
channels are not enabled.


https://reviews.llvm.org/D96558

Files:
  lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp


Index: lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
===================================================================
--- lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
+++ lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
@@ -213,8 +213,9 @@
       llvm::Error error = t.CopyWatchpointsFrom(
           static_cast<NativeThreadFreeBSD &>(*GetCurrentThread()));
       if (error) {
+        auto error_msg = llvm::toString(std::move(error));
         LLDB_LOG(log, "failed to copy watchpoints to new thread {0}: {1}",
-                 info.pl_lwpid, llvm::toString(std::move(error)));
+                 info.pl_lwpid, error_msg);
         SetState(StateType::eStateInvalid);
         return;
       }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96558.323180.patch
Type: text/x-patch
Size: 763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210211/76aa1f6c/attachment-0001.bin>


More information about the lldb-commits mailing list