File tree Expand file tree Collapse file tree 7 files changed +20
-15
lines changed Expand file tree Collapse file tree 7 files changed +20
-15
lines changed Original file line number Diff line number Diff line change 39
39
#include "lldb/API/SBHostOS.h"
40
40
#include "lldb/API/SBInstruction.h"
41
41
#include "lldb/API/SBInstructionList.h"
42
- #include "lldb/API/SBLanguages.h"
43
42
#include "lldb/API/SBLanguageRuntime.h"
43
+ #include "lldb/API/SBLanguages.h"
44
44
#include "lldb/API/SBLaunchInfo.h"
45
45
#include "lldb/API/SBLineEntry.h"
46
46
#include "lldb/API/SBListener.h"
47
+ #include "lldb/API/SBLock.h"
47
48
#include "lldb/API/SBMemoryRegionInfo.h"
48
49
#include "lldb/API/SBMemoryRegionInfoList.h"
49
50
#include "lldb/API/SBModule.h"
Original file line number Diff line number Diff line change 121
121
%include "lldb/API/SBHostOS.h"
122
122
%include "lldb/API/SBInstruction.h"
123
123
%include "lldb/API/SBInstructionList.h"
124
- %include "lldb/API/SBLanguages.h"
125
124
%include "lldb/API/SBLanguageRuntime.h"
125
+ %include "lldb/API/SBLanguages.h"
126
126
%include "lldb/API/SBLaunchInfo.h"
127
127
%include "lldb/API/SBLineEntry.h"
128
128
%include "lldb/API/SBListener.h"
129
+ %include "lldb/API/SBLock.h"
129
130
%include "lldb/API/SBMemoryRegionInfo.h"
130
131
%include "lldb/API/SBMemoryRegionInfoList.h"
131
132
%include "lldb/API/SBModule.h"
Original file line number Diff line number Diff line change @@ -19,16 +19,16 @@ struct APILock;
19
19
20
20
namespace lldb {
21
21
22
- #ifndef SWIG
23
22
class LLDB_API SBLock {
24
23
public:
24
+ SBLock ();
25
+ SBLock (SBLock &&rhs);
26
+ SBLock &operator =(SBLock &&rhs);
25
27
~SBLock ();
26
28
27
29
bool IsValid () const ;
28
30
29
31
private:
30
- SBLock () = default ;
31
-
32
32
// Private constructor used by SBTarget to create the Target API lock.
33
33
// Requires a friend declaration.
34
34
SBLock (lldb::TargetSP target_sp);
@@ -42,5 +42,3 @@ class LLDB_API SBLock {
42
42
#endif
43
43
44
44
} // namespace lldb
45
-
46
- #endif
Original file line number Diff line number Diff line change @@ -946,9 +946,7 @@ class LLDB_API SBTarget {
946
946
// / An error if a Trace already exists or the trace couldn't be created.
947
947
lldb::SBTrace CreateTrace (SBError &error);
948
948
949
- #ifndef SWIG
950
949
lldb::SBLock AcquireAPILock () const ;
951
- #endif
952
950
953
951
protected:
954
952
friend class SBAddress ;
Original file line number Diff line number Diff line change 11
11
#include " lldb/Utility/Instrumentation.h"
12
12
#include " lldb/lldb-forward.h"
13
13
#include < memory>
14
- #include < mutex>
15
14
16
15
using namespace lldb ;
17
16
using namespace lldb_private ;
18
17
18
+ SBLock::SBLock () {}
19
+ SBLock::SBLock (SBLock &&rhs) : m_opaque_up(std::move(rhs.m_opaque_up)) {}
20
+
21
+ SBLock &SBLock::operator =(SBLock &&rhs) {
22
+ m_opaque_up = std::move (rhs.m_opaque_up );
23
+ return *this ;
24
+ }
25
+
19
26
SBLock::SBLock (lldb::TargetSP target_sp)
20
27
: m_opaque_up(std::make_unique<TargetAPILock>(target_sp)) {
21
28
LLDB_INSTRUMENT_VA (this );
Original file line number Diff line number Diff line change @@ -2434,12 +2434,10 @@ lldb::SBTrace SBTarget::CreateTrace(lldb::SBError &error) {
2434
2434
return SBTrace ();
2435
2435
}
2436
2436
2437
- #ifndef SWIG
2438
2437
lldb::SBLock SBTarget::AcquireAPILock () const {
2439
2438
LLDB_INSTRUMENT_VA (this );
2440
2439
2441
2440
if (TargetSP target_sp = GetSP ())
2442
2441
return lldb::SBLock (target_sp);
2443
2442
return lldb::SBLock ();
2444
2443
}
2445
- #endif
Original file line number Diff line number Diff line change @@ -21,11 +21,15 @@ using namespace lldb;
21
21
using namespace lldb_private ;
22
22
23
23
class SBLockTest : public testing ::Test {
24
+ protected:
25
+ void SetUp () override { debugger = SBDebugger::Create (); }
26
+ void TearDown () override { SBDebugger::Destroy (debugger); }
27
+
24
28
SubsystemRAII<lldb::SBDebugger> subsystems;
29
+ SBDebugger debugger;
25
30
};
26
31
27
32
TEST_F (SBLockTest, LockTest) {
28
- lldb::SBDebugger debugger = lldb::SBDebugger::Create ();
29
33
lldb::SBTarget target = debugger.GetDummyTarget ();
30
34
31
35
std::future<void > f;
@@ -50,6 +54,4 @@ TEST_F(SBLockTest, LockTest) {
50
54
ASSERT_TRUE (locked.exchange (false ));
51
55
}
52
56
f.wait ();
53
-
54
- lldb::SBDebugger::Destroy (debugger);
55
57
}
You can’t perform that action at this time.
0 commit comments