[Lldb-commits] [lldb] r371667 - [Status] Add a LLDB_ERRORF macro for error reporting (similar to LLDB_LOGF)

Vedant Kumar via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 11 14:23:42 PDT 2019


Author: vedantk
Date: Wed Sep 11 14:23:42 2019
New Revision: 371667

URL: http://llvm.org/viewvc/llvm-project?rev=371667&view=rev
Log:
[Status] Add a LLDB_ERRORF macro for error reporting (similar to LLDB_LOGF)

Modified:
    lldb/trunk/include/lldb/Utility/Status.h

Modified: lldb/trunk/include/lldb/Utility/Status.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Status.h?rev=371667&r1=371666&r2=371667&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Utility/Status.h (original)
+++ lldb/trunk/include/lldb/Utility/Status.h Wed Sep 11 14:23:42 2019
@@ -212,4 +212,11 @@ template <> struct format_provider<lldb_
 };
 }
 
+#define LLDB_ERRORF(status, fmt, ...)                                          \
+  do {                                                                         \
+    if (status) {                                                              \
+      (status)->SetErrorStringWithFormat((fmt), __VA_ARGS__);                  \
+    }                                                                          \
+  } while (0);
+
 #endif // #ifndef LLDB_UTILITY_STATUS_H




More information about the lldb-commits mailing list