LLDB  mainline
SBError.h
Go to the documentation of this file.
1 //===-- SBError.h -----------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SBError_h_
10 #define LLDB_SBError_h_
11 
12 #include "lldb/API/SBDefines.h"
13 
14 namespace lldb {
15 
17 public:
18  SBError();
19 
20  SBError(const lldb::SBError &rhs);
21 
22  ~SBError();
23 
24  const SBError &operator=(const lldb::SBError &rhs);
25 
26  const char *GetCString() const;
27 
28  void Clear();
29 
30  bool Fail() const;
31 
32  bool Success() const;
33 
34  uint32_t GetError() const;
35 
36  lldb::ErrorType GetType() const;
37 
38  void SetError(uint32_t err, lldb::ErrorType type);
39 
40  void SetErrorToErrno();
41 
42  void SetErrorToGenericError();
43 
44  void SetErrorString(const char *err_str);
45 
46  int SetErrorStringWithFormat(const char *format, ...)
47  __attribute__((format(printf, 2, 3)));
48 
49  explicit operator bool() const;
50 
51  bool IsValid() const;
52 
53  bool GetDescription(lldb::SBStream &description);
54 
55 protected:
56  friend class SBBreakpoint;
57  friend class SBBreakpointLocation;
58  friend class SBBreakpointName;
59  friend class SBCommandReturnObject;
60  friend class SBCommunication;
61  friend class SBData;
62  friend class SBDebugger;
63  friend class SBHostOS;
64  friend class SBPlatform;
65  friend class SBProcess;
66  friend class SBReproducer;
67  friend class SBStructuredData;
68  friend class SBTarget;
69  friend class SBThread;
70  friend class SBTrace;
71  friend class SBValue;
72  friend class SBWatchpoint;
73 
74  lldb_private::Status *get();
75 
76  lldb_private::Status *operator->();
77 
78  const lldb_private::Status &operator*() const;
79 
80  lldb_private::Status &ref();
81 
82  void SetError(const lldb_private::Status &lldb_error);
83 
84 private:
85  std::unique_ptr<lldb_private::Status> m_opaque_up;
86 
87  void CreateIfNeeded();
88 };
89 
90 } // namespace lldb
91 
92 #endif // LLDB_SBError_h_
class LLDB_API SBError
Definition: SBDefines.h:39
const Scalar operator*(const Scalar &lhs, const Scalar &rhs)
Definition: Scalar.cpp:2161
The SBReproducer class is special because it bootstraps the capture and replay of SB API calls...
Definition: SBReproducer.h:19
#define LLDB_API
Definition: lldb-defines.h:23
Definition: SBAddress.h:15
An error handling class.
Definition: Status.h:44