summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Target.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-05-19 05:13:57 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-05-19 05:13:57 +0000
commitbb19a13c0b3fe1ecdc1e46bbf2b06ffc1e25e04e (patch)
treea4383c7cf16b2a6b8e8aa1ff61435ceec0c6a7de /lldb/source/Target/Target.cpp
parentfe12d0e3e551a29b880ecfc7673810ce18567765 (diff)
downloadbcm5719-llvm-bb19a13c0b3fe1ecdc1e46bbf2b06ffc1e25e04e.tar.gz
bcm5719-llvm-bb19a13c0b3fe1ecdc1e46bbf2b06ffc1e25e04e.zip
second pass over removal of Mutex and Condition
llvm-svn: 270024
Diffstat (limited to 'lldb/source/Target/Target.cpp')
-rw-r--r--lldb/source/Target/Target.cpp78
1 files changed, 40 insertions, 38 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index fc6b1d782e0..ba4a976dd72 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -68,45 +68,47 @@ Target::GetStaticBroadcasterClass ()
return class_name;
}
-Target::Target(Debugger &debugger, const ArchSpec &target_arch, const lldb::PlatformSP &platform_sp, bool is_dummy_target) :
- TargetProperties (this),
- Broadcaster (debugger.GetBroadcasterManager(), Target::GetStaticBroadcasterClass().AsCString()),
- ExecutionContextScope (),
- m_debugger (debugger),
- m_platform_sp (platform_sp),
- m_mutex (Mutex::eMutexTypeRecursive),
- m_arch (target_arch),
- m_images (this),
- m_section_load_history (),
- m_breakpoint_list (false),
- m_internal_breakpoint_list (true),
- m_watchpoint_list (),
- m_process_sp (),
- m_search_filter_sp (),
- m_image_search_paths (ImageSearchPathsChanged, this),
- m_ast_importer_sp (),
- m_source_manager_ap(),
- m_stop_hooks (),
- m_stop_hook_next_id (0),
- m_valid (true),
- m_suppress_stop_hooks (false),
- m_is_dummy_target(is_dummy_target)
-
-{
- SetEventName (eBroadcastBitBreakpointChanged, "breakpoint-changed");
- SetEventName (eBroadcastBitModulesLoaded, "modules-loaded");
- SetEventName (eBroadcastBitModulesUnloaded, "modules-unloaded");
- SetEventName (eBroadcastBitWatchpointChanged, "watchpoint-changed");
- SetEventName (eBroadcastBitSymbolsLoaded, "symbols-loaded");
+Target::Target(Debugger &debugger, const ArchSpec &target_arch, const lldb::PlatformSP &platform_sp,
+ bool is_dummy_target)
+ : TargetProperties(this),
+ Broadcaster(debugger.GetBroadcasterManager(), Target::GetStaticBroadcasterClass().AsCString()),
+ ExecutionContextScope(),
+ m_debugger(debugger),
+ m_platform_sp(platform_sp),
+ m_mutex(),
+ m_arch(target_arch),
+ m_images(this),
+ m_section_load_history(),
+ m_breakpoint_list(false),
+ m_internal_breakpoint_list(true),
+ m_watchpoint_list(),
+ m_process_sp(),
+ m_search_filter_sp(),
+ m_image_search_paths(ImageSearchPathsChanged, this),
+ m_ast_importer_sp(),
+ m_source_manager_ap(),
+ m_stop_hooks(),
+ m_stop_hook_next_id(0),
+ m_valid(true),
+ m_suppress_stop_hooks(false),
+ m_is_dummy_target(is_dummy_target)
+
+{
+ SetEventName(eBroadcastBitBreakpointChanged, "breakpoint-changed");
+ SetEventName(eBroadcastBitModulesLoaded, "modules-loaded");
+ SetEventName(eBroadcastBitModulesUnloaded, "modules-unloaded");
+ SetEventName(eBroadcastBitWatchpointChanged, "watchpoint-changed");
+ SetEventName(eBroadcastBitSymbolsLoaded, "symbols-loaded");
CheckInWithManager();
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT));
if (log)
- log->Printf ("%p Target::Target()", static_cast<void*>(this));
+ log->Printf("%p Target::Target()", static_cast<void *>(this));
if (m_arch.IsValid())
{
- LogIfAnyCategoriesSet(LIBLLDB_LOG_TARGET, "Target::Target created with architecture %s (%s)", m_arch.GetArchitectureName(), m_arch.GetTriple().getTriple().c_str());
+ LogIfAnyCategoriesSet(LIBLLDB_LOG_TARGET, "Target::Target created with architecture %s (%s)",
+ m_arch.GetArchitectureName(), m_arch.GetTriple().getTriple().c_str());
}
}
@@ -169,8 +171,8 @@ Target::CleanupProcess ()
m_breakpoint_list.ClearAllBreakpointSites();
m_internal_breakpoint_list.ClearAllBreakpointSites();
// Disable watchpoints just on the debugger side.
- Mutex::Locker locker;
- this->GetWatchpointList().GetListMutex(locker);
+ std::unique_lock<std::recursive_mutex> lock;
+ this->GetWatchpointList().GetListMutex(lock);
DisableAllWatchpoints(false);
ClearAllWatchpointHitCounts();
ClearAllWatchpointHistoricValues();
@@ -273,7 +275,7 @@ Target::SetREPL (lldb::LanguageType language, lldb::REPLSP repl_sp)
void
Target::Destroy()
{
- Mutex::Locker locker (m_mutex);
+ std::lock_guard<std::recursive_mutex> guard(m_mutex);
m_valid = false;
DeleteCurrentProcess ();
m_platform_sp.reset();
@@ -753,8 +755,8 @@ Target::CreateWatchpoint(lldb::addr_t addr, size_t size, const CompilerType *typ
// Grab the list mutex while doing operations.
const bool notify = false; // Don't notify about all the state changes we do on creating the watchpoint.
- Mutex::Locker locker;
- this->GetWatchpointList().GetListMutex(locker);
+ std::unique_lock<std::recursive_mutex> lock;
+ this->GetWatchpointList().GetListMutex(lock);
WatchpointSP matched_sp = m_watchpoint_list.FindByAddress(addr);
if (matched_sp)
{
OpenPOWER on IntegriCloud