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 3939#include " lldb/API/SBHostOS.h"
4040#include " lldb/API/SBInstruction.h"
4141#include " lldb/API/SBInstructionList.h"
42- #include " lldb/API/SBLanguages.h"
4342#include " lldb/API/SBLanguageRuntime.h"
43+ #include " lldb/API/SBLanguages.h"
4444#include " lldb/API/SBLaunchInfo.h"
4545#include " lldb/API/SBLineEntry.h"
4646#include " lldb/API/SBListener.h"
47+ #include " lldb/API/SBLock.h"
4748#include " lldb/API/SBMemoryRegionInfo.h"
4849#include " lldb/API/SBMemoryRegionInfoList.h"
4950#include " lldb/API/SBModule.h"
Original file line number Diff line number Diff line change 121121%include " lldb/API/SBHostOS.h"
122122%include " lldb/API/SBInstruction.h"
123123%include " lldb/API/SBInstructionList.h"
124- %include " lldb/API/SBLanguages.h"
125124%include " lldb/API/SBLanguageRuntime.h"
125+ %include " lldb/API/SBLanguages.h"
126126%include " lldb/API/SBLaunchInfo.h"
127127%include " lldb/API/SBLineEntry.h"
128128%include " lldb/API/SBListener.h"
129+ %include " lldb/API/SBLock.h"
129130%include " lldb/API/SBMemoryRegionInfo.h"
130131%include " lldb/API/SBMemoryRegionInfoList.h"
131132%include " lldb/API/SBModule.h"
Original file line number Diff line number Diff line change @@ -19,16 +19,16 @@ struct APILock;
1919
2020namespace lldb {
2121
22- #ifndef SWIG
2322class LLDB_API SBLock {
2423public:
24+ SBLock ();
25+ SBLock (SBLock &&rhs);
26+ SBLock &operator =(SBLock &&rhs);
2527 ~SBLock ();
2628
2729 bool IsValid () const ;
2830
2931private:
30- SBLock () = default ;
31-
3232 // Private constructor used by SBTarget to create the Target API lock.
3333 // Requires a friend declaration.
3434 SBLock (lldb::TargetSP target_sp);
@@ -42,5 +42,3 @@ class LLDB_API SBLock {
4242#endif
4343
4444} // namespace lldb
45-
46- #endif
Original file line number Diff line number Diff line change @@ -946,9 +946,7 @@ class LLDB_API SBTarget {
946946 // / An error if a Trace already exists or the trace couldn't be created.
947947 lldb::SBTrace CreateTrace (SBError &error);
948948
949- #ifndef SWIG
950949 lldb::SBLock AcquireAPILock () const ;
951- #endif
952950
953951protected:
954952 friend class SBAddress ;
Original file line number Diff line number Diff line change 1111#include " lldb/Utility/Instrumentation.h"
1212#include " lldb/lldb-forward.h"
1313#include < memory>
14- #include < mutex>
1514
1615using namespace lldb ;
1716using namespace lldb_private ;
1817
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+
1926SBLock::SBLock (lldb::TargetSP target_sp)
2027 : m_opaque_up(std::make_unique<TargetAPILock>(target_sp)) {
2128 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) {
24342434 return SBTrace ();
24352435}
24362436
2437- #ifndef SWIG
24382437lldb::SBLock SBTarget::AcquireAPILock () const {
24392438 LLDB_INSTRUMENT_VA (this );
24402439
24412440 if (TargetSP target_sp = GetSP ())
24422441 return lldb::SBLock (target_sp);
24432442 return lldb::SBLock ();
24442443}
2445- #endif
Original file line number Diff line number Diff line change @@ -21,11 +21,15 @@ using namespace lldb;
2121using namespace lldb_private ;
2222
2323class SBLockTest : public testing ::Test {
24+ protected:
25+ void SetUp () override { debugger = SBDebugger::Create (); }
26+ void TearDown () override { SBDebugger::Destroy (debugger); }
27+
2428 SubsystemRAII<lldb::SBDebugger> subsystems;
29+ SBDebugger debugger;
2530};
2631
2732TEST_F (SBLockTest, LockTest) {
28- lldb::SBDebugger debugger = lldb::SBDebugger::Create ();
2933 lldb::SBTarget target = debugger.GetDummyTarget ();
3034
3135 std::future<void > f;
@@ -50,6 +54,4 @@ TEST_F(SBLockTest, LockTest) {
5054 ASSERT_TRUE (locked.exchange (false ));
5155 }
5256 f.wait ();
53-
54- lldb::SBDebugger::Destroy (debugger);
5557}
You can’t perform that action at this time.
0 commit comments