aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Target
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target')
-rw-r--r--lldb/source/Target/InstrumentationRuntime.cpp10
-rw-r--r--lldb/source/Target/StackFrameList.cpp6
-rw-r--r--lldb/source/Target/StackFrameRecognizer.cpp2
-rw-r--r--lldb/source/Target/Target.cpp4
-rw-r--r--lldb/source/Target/ThreadPlanStepRange.cpp4
5 files changed, 16 insertions, 10 deletions
diff --git a/lldb/source/Target/InstrumentationRuntime.cpp b/lldb/source/Target/InstrumentationRuntime.cpp
index 9da06e8..7e58e8b 100644
--- a/lldb/source/Target/InstrumentationRuntime.cpp
+++ b/lldb/source/Target/InstrumentationRuntime.cpp
@@ -49,10 +49,10 @@ void InstrumentationRuntime::ModulesDidLoad(
return;
}
- module_list.ForEach([this](const lldb::ModuleSP module_sp) -> bool {
+ module_list.ForEach([this](const lldb::ModuleSP module_sp) {
const FileSpec &file_spec = module_sp->GetFileSpec();
if (!file_spec)
- return true; // Keep iterating.
+ return IterationAction::Continue;
const RegularExpression &runtime_regex = GetPatternForRuntimeLibrary();
if (runtime_regex.Execute(file_spec.GetFilename().GetCString()) ||
@@ -62,16 +62,16 @@ void InstrumentationRuntime::ModulesDidLoad(
Activate();
if (!IsActive())
SetRuntimeModuleSP({}); // Don't cache module if activation failed.
- return false; // Stop iterating, we're done.
+ return IterationAction::Stop;
}
}
- return true;
+ return IterationAction::Continue;
});
}
lldb::ThreadCollectionSP
InstrumentationRuntime::GetBacktracesFromExtendedStopInfo(
StructuredData::ObjectSP info) {
- return ThreadCollectionSP(new ThreadCollection());
+ return std::make_shared<ThreadCollection>();
}
diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp
index 16cd254..aedfc52 100644
--- a/lldb/source/Target/StackFrameList.cpp
+++ b/lldb/source/Target/StackFrameList.cpp
@@ -783,6 +783,8 @@ void StackFrameList::SelectMostRelevantFrame() {
uint32_t
StackFrameList::GetSelectedFrameIndex(SelectMostRelevant select_most_relevant) {
+ std::lock_guard<std::recursive_mutex> guard(m_selected_frame_mutex);
+
if (!m_selected_frame_idx && select_most_relevant)
SelectMostRelevantFrame();
if (!m_selected_frame_idx) {
@@ -798,6 +800,8 @@ StackFrameList::GetSelectedFrameIndex(SelectMostRelevant select_most_relevant) {
uint32_t StackFrameList::SetSelectedFrame(lldb_private::StackFrame *frame) {
std::shared_lock<std::shared_mutex> guard(m_list_mutex);
+ std::lock_guard<std::recursive_mutex> selected_frame_guard(
+ m_selected_frame_mutex);
const_iterator pos;
const_iterator begin = m_frames.begin();
@@ -851,6 +855,8 @@ void StackFrameList::Clear() {
std::unique_lock<std::shared_mutex> guard(m_list_mutex);
m_frames.clear();
m_concrete_frames_fetched = 0;
+ std::lock_guard<std::recursive_mutex> selected_frame_guard(
+ m_selected_frame_mutex);
m_selected_frame_idx.reset();
}
diff --git a/lldb/source/Target/StackFrameRecognizer.cpp b/lldb/source/Target/StackFrameRecognizer.cpp
index d23c1fa..9d5116c 100644
--- a/lldb/source/Target/StackFrameRecognizer.cpp
+++ b/lldb/source/Target/StackFrameRecognizer.cpp
@@ -41,7 +41,7 @@ ScriptedStackFrameRecognizer::RecognizeFrame(lldb::StackFrameSP frame) {
ValueObjectListSP args =
m_interpreter->GetRecognizedArguments(m_python_object_sp, frame);
- auto args_synthesized = ValueObjectListSP(new ValueObjectList());
+ auto args_synthesized = std::make_shared<ValueObjectList>();
if (args) {
for (const auto &o : args->GetObjects())
args_synthesized->Append(ValueObjectRecognizerSynthesizedValue::Create(
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 86ae7dd..823b4b5 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -2487,9 +2487,9 @@ ModuleSP Target::GetOrCreateModule(const ModuleSpec &orig_module_spec,
ModuleList found_modules;
m_images.FindModules(module_spec_copy, found_modules);
- found_modules.ForEach([&](const ModuleSP &found_module) -> bool {
+ found_modules.ForEach([&](const ModuleSP &found_module) {
old_modules.push_back(found_module);
- return true;
+ return IterationAction::Continue;
});
}
diff --git a/lldb/source/Target/ThreadPlanStepRange.cpp b/lldb/source/Target/ThreadPlanStepRange.cpp
index 78e1270..dca96cc 100644
--- a/lldb/source/Target/ThreadPlanStepRange.cpp
+++ b/lldb/source/Target/ThreadPlanStepRange.cpp
@@ -428,8 +428,8 @@ bool ThreadPlanStepRange::SetNextBranchBreakpoint() {
top_most_line_entry.line = call_site.GetLine();
top_most_line_entry.column = call_site.GetColumn();
FileSpec call_site_file_spec = call_site.GetFile();
- top_most_line_entry.original_file_sp.reset(
- new SupportFile(call_site_file_spec));
+ top_most_line_entry.original_file_sp =
+ std::make_shared<SupportFile>(call_site_file_spec);
top_most_line_entry.range = range;
top_most_line_entry.file_sp.reset();
top_most_line_entry.ApplyFileMappings(