File indexing completed on 2026-05-10 08:42:41
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_API_SBERROR_H
0010 #define LLDB_API_SBERROR_H
0011
0012 #include "lldb/API/SBDefines.h"
0013
0014 namespace lldb_private {
0015 class ScriptInterpreter;
0016 namespace python {
0017 class SWIGBridge;
0018 }
0019 }
0020
0021 namespace lldb {
0022
0023 class LLDB_API SBError {
0024 public:
0025 SBError();
0026
0027 SBError(const lldb::SBError &rhs);
0028
0029 SBError(const char *message);
0030
0031 ~SBError();
0032
0033 const SBError &operator=(const lldb::SBError &rhs);
0034
0035
0036
0037
0038
0039 const char *GetCString() const;
0040
0041 void Clear();
0042
0043 bool Fail() const;
0044
0045 bool Success() const;
0046
0047
0048 uint32_t GetError() const;
0049
0050
0051
0052 SBStructuredData GetErrorData() const;
0053
0054 lldb::ErrorType GetType() const;
0055
0056 void SetError(uint32_t err, lldb::ErrorType type);
0057
0058 void SetErrorToErrno();
0059
0060 void SetErrorToGenericError();
0061
0062 void SetErrorString(const char *err_str);
0063
0064 #ifndef SWIG
0065 __attribute__((format(printf, 2, 3)))
0066 #else
0067
0068 %varargs(3, char *str = NULL) SetErrorStringWithFormat;
0069
0070 #endif
0071 int SetErrorStringWithFormat(const char *format, ...);
0072
0073 explicit operator bool() const;
0074
0075 bool IsValid() const;
0076
0077 bool GetDescription(lldb::SBStream &description);
0078
0079 protected:
0080 friend class SBBreakpoint;
0081 friend class SBBreakpointLocation;
0082 friend class SBBreakpointName;
0083 friend class SBCommandReturnObject;
0084 friend class SBCommunication;
0085 friend class SBSaveCoreOptions;
0086 friend class SBData;
0087 friend class SBDebugger;
0088 friend class SBFile;
0089 friend class SBFormat;
0090 friend class SBHostOS;
0091 friend class SBPlatform;
0092 friend class SBProcess;
0093 friend class SBReproducer;
0094 friend class SBStructuredData;
0095 friend class SBTarget;
0096 friend class SBThread;
0097 friend class SBTrace;
0098 friend class SBValue;
0099 friend class SBValueList;
0100 friend class SBWatchpoint;
0101
0102 friend class lldb_private::ScriptInterpreter;
0103 friend class lldb_private::python::SWIGBridge;
0104
0105 SBError(lldb_private::Status &&error);
0106
0107 lldb_private::Status *get();
0108
0109 lldb_private::Status *operator->();
0110
0111 const lldb_private::Status &operator*() const;
0112
0113 lldb_private::Status &ref();
0114
0115 void SetError(lldb_private::Status &&lldb_error);
0116
0117 private:
0118 std::unique_ptr<lldb_private::Status> m_opaque_up;
0119
0120 void CreateIfNeeded();
0121 };
0122
0123 }
0124
0125 #endif