Go to the documentation of this file.
9 #ifndef LLDB_UTILITY_STATUS_H
10 #define LLDB_UTILITY_STATUS_H
14 #include "llvm/ADT/StringRef.h"
15 #include "llvm/Support/Error.h"
16 #include "llvm/Support/FormatVariadic.h"
20 #include <system_error>
21 #include <type_traits>
62 Status(std::error_code EC);
64 explicit Status(
const char *format, ...)
67 template <typename...
Args>
69 return Status(llvm::formatv(format, std::forward<Args>(args)...));
90 const char *
AsCString(
const char *default_error_str =
"unknown error")
const;
177 template <typename...
Args>
179 SetErrorString(llvm::formatv(format, std::forward<Args>(args)...).str());
199 explicit Status(
const llvm::formatv_object_base &payload) {
210 llvm::StringRef Options);
214 #define LLDB_ERRORF(status, fmt, ...) \
217 (status)->SetErrorStringWithFormat((fmt), __VA_ARGS__); \
221 #endif // LLDB_UTILITY_STATUS_H
Status(const llvm::formatv_object_base &payload)
int void SetError(ValueType err, lldb::ErrorType type)
Set accessor with an error value and type.
ExpressionResults
The results of expression evaluation.
__attribute__((always_inline)) int uuid_is_null(uuid_t uuid)
std::string m_string
A string representation of the error code.
void SetErrorStringWithFormatv(const char *format, Args &&... args)
static Status createWithFormat(const char *format, Args &&...args)
void SetErrorToGenericError()
Set the current error to a generic error.
static llvm::raw_ostream & error(Stream &strm)
Status(llvm::Error error)
bool Success() const
Test for success condition.
const Status & operator=(llvm::Error error)
uint32_t ValueType
Every error value that this object can contain needs to be able to fit into ValueType.
ValueType GetError() const
Access the error value.
bool Fail() const
Test for error condition.
int SetExpressionErrorWithFormat(lldb::ExpressionResults, const char *format,...) __attribute__((format(printf
int SetErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Set the current error string to a formatted error string.
@ eErrorTypeGeneric
Generic errors that can be any value.
string(SUBSTRING ${p} 10 -1 pStripped) if($
int int SetErrorStringWithVarArg(const char *format, va_list args)
void SetMachError(uint32_t err)
Set accessor from a kern_return_t.
ValueType m_code
Member variables.
lldb::ErrorType GetType() const
Access the error type.
void SetErrorString(llvm::StringRef err_str)
Set the current error string to err_str.
void SetErrorToErrno()
Set the current error to errno.
A class that represents a running process on the host machine.
void Clear()
Clear the object state.
llvm::Error ToError() const
void SetExpressionError(lldb::ExpressionResults, const char *mssg)
lldb::ErrorType m_type
The type of the above error code.
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.