Skip to content

Commit ce63f3e

Browse files
committed
[lldb/API] Introduce SBOptional class
This class acts as a wrapper around other SB instances. It makes use of `std::any` to store any kind of object and keeps that of the type it was initialized with by storing a enum value for each type. I was thinking using std::variant but ran into some issues when some move-only SB types (i.e. SBStream). Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
1 parent 38b33bb commit ce63f3e

File tree

6 files changed

+1046
-0
lines changed

6 files changed

+1046
-0
lines changed

lldb/bindings/interfaces.swig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
%include "lldb/API/SBModule.h"
133133
%include "lldb/API/SBModuleSpec.h"
134134
%include "lldb/API/SBMutex.h"
135+
%include "lldb/API/SBOptional.h"
135136
%include "lldb/API/SBPlatform.h"
136137
%include "lldb/API/SBProcess.h"
137138
%include "lldb/API/SBProcessInfo.h"

lldb/include/lldb/API/LLDB.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include "lldb/API/SBModule.h"
5252
#include "lldb/API/SBModuleSpec.h"
5353
#include "lldb/API/SBMutex.h"
54+
#include "lldb/API/SBOptional.h"
5455
#include "lldb/API/SBPlatform.h"
5556
#include "lldb/API/SBProcess.h"
5657
#include "lldb/API/SBProcessInfo.h"

lldb/include/lldb/API/SBAddress.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class LLDB_API SBAddress {
3939

4040
void Clear();
4141

42+
SBOptional GetOptional();
43+
4244
addr_t GetFileAddress() const;
4345

4446
addr_t GetLoadAddress(const lldb::SBTarget &target) const;

lldb/include/lldb/API/SBDefines.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class LLDB_API SBModule;
9090
class LLDB_API SBModuleSpec;
9191
class LLDB_API SBModuleSpecList;
9292
class LLDB_API SBMutex;
93+
class LLDB_API SBOptional;
9394
class LLDB_API SBPlatform;
9495
class LLDB_API SBPlatformConnectOptions;
9596
class LLDB_API SBPlatformShellCommand;

0 commit comments

Comments
 (0)