77// ===----------------------------------------------------------------------===//
88
99#include " lldb/API/SBTarget.h"
10+ #include " lldb/API/SBLock.h"
1011#include " lldb/Utility/Instrumentation.h"
1112#include " lldb/Utility/LLDBLog.h"
1213#include " lldb/lldb-public.h"
1819#include " lldb/API/SBExpressionOptions.h"
1920#include " lldb/API/SBFileSpec.h"
2021#include " lldb/API/SBListener.h"
22+ #include " lldb/API/SBLock.h"
2123#include " lldb/API/SBModule.h"
2224#include " lldb/API/SBModuleSpec.h"
2325#include " lldb/API/SBProcess.h"
@@ -544,9 +546,8 @@ lldb::SBProcess SBTarget::ConnectRemote(SBListener &listener, const char *url,
544546 if (target_sp) {
545547 std::lock_guard<std::recursive_mutex> guard (target_sp->GetAPIMutex ());
546548 if (listener.IsValid ())
547- process_sp =
548- target_sp->CreateProcess (listener.m_opaque_sp , plugin_name, nullptr ,
549- true );
549+ process_sp = target_sp->CreateProcess (listener.m_opaque_sp , plugin_name,
550+ nullptr , true );
550551 else
551552 process_sp = target_sp->CreateProcess (
552553 target_sp->GetDebugger ().GetListener (), plugin_name, nullptr , true );
@@ -1040,7 +1041,7 @@ SBTarget::BreakpointCreateForException(lldb::LanguageType language,
10401041 std::lock_guard<std::recursive_mutex> guard (target_sp->GetAPIMutex ());
10411042 const bool hardware = false ;
10421043 sb_bp = target_sp->CreateExceptionBreakpoint (language, catch_bp, throw_bp,
1043- hardware);
1044+ hardware);
10441045 }
10451046
10461047 return sb_bp;
@@ -1060,14 +1061,9 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateFromScript(
10601061 Status error;
10611062
10621063 StructuredData::ObjectSP obj_sp = extra_args.m_impl_up ->GetObjectSP ();
1063- sb_bp =
1064- target_sp->CreateScriptedBreakpoint (class_name,
1065- module_list.get (),
1066- file_list.get (),
1067- false , /* internal */
1068- request_hardware,
1069- obj_sp,
1070- &error);
1064+ sb_bp = target_sp->CreateScriptedBreakpoint (
1065+ class_name, module_list.get (), file_list.get (), false , /* internal */
1066+ request_hardware, obj_sp, &error);
10711067 }
10721068
10731069 return sb_bp;
@@ -1692,8 +1688,8 @@ uint32_t SBTarget::GetMaximumNumberOfChildrenToDisplay() const {
16921688 LLDB_INSTRUMENT_VA (this );
16931689
16941690 TargetSP target_sp (GetSP ());
1695- if (target_sp){
1696- return target_sp->GetMaximumNumberOfChildrenToDisplay ();
1691+ if (target_sp) {
1692+ return target_sp->GetMaximumNumberOfChildrenToDisplay ();
16971693 }
16981694 return 0 ;
16991695}
@@ -2193,7 +2189,7 @@ SBError SBTarget::SetModuleLoadAddress(lldb::SBModule module,
21932189}
21942190
21952191SBError SBTarget::SetModuleLoadAddress (lldb::SBModule module ,
2196- uint64_t slide_offset) {
2192+ uint64_t slide_offset) {
21972193
21982194 SBError sb_error;
21992195
@@ -2439,3 +2435,13 @@ lldb::SBTrace SBTarget::CreateTrace(lldb::SBError &error) {
24392435 }
24402436 return SBTrace ();
24412437}
2438+
2439+ #ifndef SWIG
2440+ lldb::SBLock SBTarget::GetAPILock () const {
2441+ LLDB_INSTRUMENT_VA (this );
2442+
2443+ if (TargetSP target_sp = GetSP ())
2444+ return lldb::SBLock (target_sp->GetAPIMutex (), target_sp);
2445+ return lldb::SBLock ();
2446+ }
2447+ #endif
0 commit comments