summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Breakpoint
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Breakpoint')
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp2
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp2
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp2
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp19
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp2
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointOptions.cpp2
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp4
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSite.cpp11
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSiteList.cpp2
-rw-r--r--contrib/llvm/tools/lldb/source/Breakpoint/WatchpointList.cpp2
10 files changed, 32 insertions, 16 deletions
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp
index 5ce064f..7d08170 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp
@@ -541,7 +541,7 @@ Breakpoint::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_l
if (!m_kind_description.empty())
{
- if (eDescriptionLevelBrief)
+ if (level == eDescriptionLevelBrief)
{
s->PutCString (GetBreakpointKind());
return;
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp
index 9a59e29..9963ed6 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp
@@ -71,7 +71,7 @@ void
BreakpointID::GetDescription (Stream *s, lldb::DescriptionLevel level)
{
if (level == eDescriptionLevelVerbose)
- s->Printf("%p BreakpointID:", this);
+ s->Printf("%p BreakpointID:", static_cast<void*>(this));
if (m_break_id == LLDB_INVALID_BREAK_ID)
s->PutCString ("<invalid>");
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp
index 147ad36..6507377 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointList.cpp
@@ -167,7 +167,7 @@ void
BreakpointList::Dump (Stream *s) const
{
Mutex::Locker locker(m_mutex);
- s->Printf("%p: ", this);
+ s->Printf("%p: ", static_cast<const void*>(this));
s->Indent();
s->Printf("BreakpointList with %u Breakpoints:\n", (uint32_t)m_breakpoints.size());
s->IndentMore();
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp
index 2c75a11..e1ac043 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp
@@ -289,7 +289,8 @@ BreakpointLocation::ConditionSaysStop (ExecutionContext &exe_ctx, Error &error)
if (!m_user_expression_sp->Parse(errors,
exe_ctx,
eExecutionPolicyOnlyWhenNeeded,
- true))
+ true,
+ false))
{
error.SetErrorStringWithFormat("Couldn't parse conditional expression:\n%s",
errors.GetData());
@@ -316,7 +317,7 @@ BreakpointLocation::ConditionSaysStop (ExecutionContext &exe_ctx, Error &error)
ClangExpressionVariableSP result_variable_sp;
- ExecutionResults result_code =
+ ExpressionResults result_code =
m_user_expression_sp->Execute(execution_errors,
exe_ctx,
options,
@@ -325,11 +326,10 @@ BreakpointLocation::ConditionSaysStop (ExecutionContext &exe_ctx, Error &error)
bool ret;
- if (result_code == eExecutionCompleted)
+ if (result_code == eExpressionCompleted)
{
if (!result_variable_sp)
{
- ret = false;
error.SetErrorString("Expression did not return a result");
return false;
}
@@ -522,8 +522,15 @@ BreakpointLocation::ClearBreakpointSite ()
{
if (m_bp_site_sp.get())
{
- m_owner.GetTarget().GetProcessSP()->RemoveOwnerFromBreakpointSite (GetBreakpoint().GetID(),
+ ProcessSP process_sp(m_owner.GetTarget().GetProcessSP());
+ // If the process exists, get it to remove the owner, it will remove the physical implementation
+ // of the breakpoint as well if there are no more owners. Otherwise just remove this owner.
+ if (process_sp)
+ process_sp->RemoveOwnerFromBreakpointSite (GetBreakpoint().GetID(),
GetID(), m_bp_site_sp);
+ else
+ m_bp_site_sp->RemoveOwner(GetBreakpoint().GetID(), GetID());
+
m_bp_site_sp.reset();
return true;
}
@@ -627,7 +634,7 @@ BreakpointLocation::GetDescription (Stream *s, lldb::DescriptionLevel level)
if (exe_scope == NULL)
exe_scope = target;
- if (eDescriptionLevelInitial)
+ if (level == eDescriptionLevelInitial)
m_address.Dump(s, exe_scope, Address::DumpStyleLoadAddress, Address::DumpStyleFileAddress);
else
m_address.Dump(s, exe_scope, Address::DumpStyleLoadAddress, Address::DumpStyleModuleWithFileAddress);
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp
index 917c776..ae7f863 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp
@@ -152,7 +152,7 @@ BreakpointLocationList::FindByAddress (const Address &addr) const
void
BreakpointLocationList::Dump (Stream *s) const
{
- s->Printf("%p: ", this);
+ s->Printf("%p: ", static_cast<const void*>(this));
//s->Indent();
Mutex::Locker locker (m_mutex);
s->Printf("BreakpointLocationList with %" PRIu64 " BreakpointLocations:\n", (uint64_t)m_locations.size());
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointOptions.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointOptions.cpp
index 3a4a117..ea8556d 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointOptions.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointOptions.cpp
@@ -154,7 +154,7 @@ BreakpointOptions::InvokeCallback (StoppointCallbackContext *context,
}
bool
-BreakpointOptions::HasCallback ()
+BreakpointOptions::HasCallback () const
{
return m_callback != BreakpointOptions::NullCallback;
}
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp
index cf5d89c..3ac3ed0 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp
@@ -234,7 +234,7 @@ BreakpointResolverName::SearchCallback
if (context.module_sp)
{
context.module_sp->FindFunctions (m_regex,
- !filter_by_cu, // include symbols only if we aren't filterning by CU
+ !filter_by_cu, // include symbols only if we aren't filtering by CU
include_inlines,
append,
func_list);
@@ -264,7 +264,7 @@ BreakpointResolverName::SearchCallback
}
}
- // Remove any duplicates between the funcion list and the symbol list
+ // Remove any duplicates between the function list and the symbol list
SymbolContext sc;
if (func_list.GetSize())
{
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSite.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSite.cpp
index fa5d8c1..3cf6d37 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSite.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSite.cpp
@@ -32,7 +32,8 @@ BreakpointSite::BreakpointSite
m_saved_opcode(),
m_trap_opcode(),
m_enabled(false), // Need to create it disabled, so the first enable turns it on.
- m_owners()
+ m_owners(),
+ m_owners_mutex(Mutex::eMutexTypeRecursive)
{
m_owners.Add(owner);
}
@@ -60,6 +61,7 @@ BreakpointSite::GetNextID()
bool
BreakpointSite::ShouldStop (StoppointCallbackContext *context)
{
+ Mutex::Locker locker(m_owners_mutex);
IncrementHitCount();
return m_owners.ShouldStop (context);
}
@@ -67,6 +69,7 @@ BreakpointSite::ShouldStop (StoppointCallbackContext *context)
bool
BreakpointSite::IsBreakpointAtThisSite (lldb::break_id_t bp_id)
{
+ Mutex::Locker locker(m_owners_mutex);
const size_t owner_count = m_owners.GetSize();
for (size_t i = 0; i < owner_count; i++)
{
@@ -93,6 +96,7 @@ BreakpointSite::Dump(Stream *s) const
void
BreakpointSite::GetDescription (Stream *s, lldb::DescriptionLevel level)
{
+ Mutex::Locker locker(m_owners_mutex);
if (level != lldb::eDescriptionLevelBrief)
s->Printf ("breakpoint site: %d at 0x%8.8" PRIx64, GetID(), GetLoadAddress());
m_owners.GetDescription (s, level);
@@ -162,12 +166,14 @@ BreakpointSite::SetEnabled (bool enabled)
void
BreakpointSite::AddOwner (const BreakpointLocationSP &owner)
{
+ Mutex::Locker locker(m_owners_mutex);
m_owners.Add(owner);
}
size_t
BreakpointSite::RemoveOwner (lldb::break_id_t break_id, lldb::break_id_t break_loc_id)
{
+ Mutex::Locker locker(m_owners_mutex);
m_owners.Remove(break_id, break_loc_id);
return m_owners.GetSize();
}
@@ -175,18 +181,21 @@ BreakpointSite::RemoveOwner (lldb::break_id_t break_id, lldb::break_id_t break_l
size_t
BreakpointSite::GetNumberOfOwners ()
{
+ Mutex::Locker locker(m_owners_mutex);
return m_owners.GetSize();
}
BreakpointLocationSP
BreakpointSite::GetOwnerAtIndex (size_t index)
{
+ Mutex::Locker locker(m_owners_mutex);
return m_owners.GetByIndex (index);
}
bool
BreakpointSite::ValidForThisThread (Thread *thread)
{
+ Mutex::Locker locker(m_owners_mutex);
return m_owners.ValidForThisThread(thread);
}
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSiteList.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSiteList.cpp
index 68c4af1..1eaadb6 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSiteList.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointSiteList.cpp
@@ -186,7 +186,7 @@ BreakpointSiteList::BreakpointSiteContainsBreakpoint (lldb::break_id_t bp_site_i
void
BreakpointSiteList::Dump (Stream *s) const
{
- s->Printf("%p: ", this);
+ s->Printf("%p: ", static_cast<const void*>(this));
//s->Indent();
s->Printf("BreakpointSiteList with %u BreakpointSites:\n", (uint32_t)m_bp_site_list.size());
s->IndentMore();
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/WatchpointList.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/WatchpointList.cpp
index 6d62dff..472bae0 100644
--- a/contrib/llvm/tools/lldb/source/Breakpoint/WatchpointList.cpp
+++ b/contrib/llvm/tools/lldb/source/Breakpoint/WatchpointList.cpp
@@ -55,7 +55,7 @@ void
WatchpointList::DumpWithLevel (Stream *s, lldb::DescriptionLevel description_level) const
{
Mutex::Locker locker (m_mutex);
- s->Printf("%p: ", this);
+ s->Printf("%p: ", static_cast<const void*>(this));
//s->Indent();
s->Printf("WatchpointList with %" PRIu64 " Watchpoints:\n",
(uint64_t)m_watchpoints.size());
OpenPOWER on IntegriCloud