summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Breakpoint')
-rw-r--r--lldb/source/Breakpoint/BreakpointLocation.cpp67
-rw-r--r--lldb/source/Breakpoint/BreakpointOptions.cpp50
-rw-r--r--lldb/source/Breakpoint/Watchpoint.cpp16
-rw-r--r--lldb/source/Breakpoint/WatchpointOptions.cpp24
4 files changed, 77 insertions, 80 deletions
diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp
index d59272c70d6..b718e2aeea5 100644
--- a/lldb/source/Breakpoint/BreakpointLocation.cpp
+++ b/lldb/source/Breakpoint/BreakpointLocation.cpp
@@ -35,7 +35,7 @@ BreakpointLocation::BreakpointLocation(break_id_t loc_id, Breakpoint &owner,
hardware),
m_being_created(true), m_should_resolve_indirect_functions(false),
m_is_reexported(false), m_is_indirect(false), m_address(addr),
- m_owner(owner), m_options_ap(), m_bp_site_sp(), m_condition_mutex() {
+ m_owner(owner), m_options_up(), m_bp_site_sp(), m_condition_mutex() {
if (check_for_resolver) {
Symbol *symbol = m_address.CalculateSymbolContextSymbol();
if (symbol && symbol->IsIndirect()) {
@@ -56,10 +56,10 @@ lldb::addr_t BreakpointLocation::GetLoadAddress() const {
const BreakpointOptions *
BreakpointLocation::GetOptionsSpecifyingKind(BreakpointOptions::OptionKind kind)
const {
- if (m_options_ap && m_options_ap->IsOptionSet(kind))
- return m_options_ap.get();
- else
- return m_owner.GetOptions();
+ if (m_options_up && m_options_up->IsOptionSet(kind))
+ return m_options_up.get();
+ else
+ return m_owner.GetOptions();
}
Address &BreakpointLocation::GetAddress() { return m_address; }
@@ -71,8 +71,8 @@ Target &BreakpointLocation::GetTarget() { return m_owner.GetTarget(); }
bool BreakpointLocation::IsEnabled() const {
if (!m_owner.IsEnabled())
return false;
- else if (m_options_ap != nullptr)
- return m_options_ap->IsEnabled();
+ else if (m_options_up != nullptr)
+ return m_options_up->IsEnabled();
else
return true;
}
@@ -89,9 +89,9 @@ void BreakpointLocation::SetEnabled(bool enabled) {
}
bool BreakpointLocation::IsAutoContinue() const {
- if (m_options_ap
- && m_options_ap->IsOptionSet(BreakpointOptions::eAutoContinue))
- return m_options_ap->IsAutoContinue();
+ if (m_options_up &&
+ m_options_up->IsOptionSet(BreakpointOptions::eAutoContinue))
+ return m_options_up->IsAutoContinue();
else
return m_owner.IsAutoContinue();
}
@@ -107,8 +107,8 @@ void BreakpointLocation::SetThreadID(lldb::tid_t thread_id) {
else {
// If we're resetting this to an invalid thread id, then don't make an
// options pointer just to do that.
- if (m_options_ap != nullptr)
- m_options_ap->SetThreadID(thread_id);
+ if (m_options_up != nullptr)
+ m_options_up->SetThreadID(thread_id);
}
SendBreakpointLocationChangedEvent(eBreakpointEventTypeThreadChanged);
}
@@ -129,8 +129,8 @@ void BreakpointLocation::SetThreadIndex(uint32_t index) {
else {
// If we're resetting this to an invalid thread id, then don't make an
// options pointer just to do that.
- if (m_options_ap != nullptr)
- m_options_ap->GetThreadSpec()->SetIndex(index);
+ if (m_options_up != nullptr)
+ m_options_up->GetThreadSpec()->SetIndex(index);
}
SendBreakpointLocationChangedEvent(eBreakpointEventTypeThreadChanged);
}
@@ -151,8 +151,8 @@ void BreakpointLocation::SetThreadName(const char *thread_name) {
else {
// If we're resetting this to an invalid thread id, then don't make an
// options pointer just to do that.
- if (m_options_ap != nullptr)
- m_options_ap->GetThreadSpec()->SetName(thread_name);
+ if (m_options_up != nullptr)
+ m_options_up->GetThreadSpec()->SetName(thread_name);
}
SendBreakpointLocationChangedEvent(eBreakpointEventTypeThreadChanged);
}
@@ -173,8 +173,8 @@ void BreakpointLocation::SetQueueName(const char *queue_name) {
else {
// If we're resetting this to an invalid thread id, then don't make an
// options pointer just to do that.
- if (m_options_ap != nullptr)
- m_options_ap->GetThreadSpec()->SetQueueName(queue_name);
+ if (m_options_up != nullptr)
+ m_options_up->GetThreadSpec()->SetQueueName(queue_name);
}
SendBreakpointLocationChangedEvent(eBreakpointEventTypeThreadChanged);
}
@@ -190,8 +190,8 @@ const char *BreakpointLocation::GetQueueName() const {
}
bool BreakpointLocation::InvokeCallback(StoppointCallbackContext *context) {
- if (m_options_ap != nullptr && m_options_ap->HasCallback())
- return m_options_ap->InvokeCallback(context, m_owner.GetID(), GetID());
+ if (m_options_up != nullptr && m_options_up->HasCallback())
+ return m_options_up->InvokeCallback(context, m_owner.GetID(), GetID());
else
return m_owner.InvokeCallback(context, GetID());
}
@@ -344,16 +344,16 @@ void BreakpointLocation::SetIgnoreCount(uint32_t n) {
}
void BreakpointLocation::DecrementIgnoreCount() {
- if (m_options_ap != nullptr) {
- uint32_t loc_ignore = m_options_ap->GetIgnoreCount();
+ if (m_options_up != nullptr) {
+ uint32_t loc_ignore = m_options_up->GetIgnoreCount();
if (loc_ignore != 0)
- m_options_ap->SetIgnoreCount(loc_ignore - 1);
+ m_options_up->SetIgnoreCount(loc_ignore - 1);
}
}
bool BreakpointLocation::IgnoreCountShouldStop() {
- if (m_options_ap != nullptr) {
- uint32_t loc_ignore = m_options_ap->GetIgnoreCount();
+ if (m_options_up != nullptr) {
+ uint32_t loc_ignore = m_options_up->GetIgnoreCount();
if (loc_ignore != 0) {
m_owner.DecrementIgnoreCount();
DecrementIgnoreCount(); // Have to decrement our owners' ignore count,
@@ -369,11 +369,10 @@ BreakpointOptions *BreakpointLocation::GetLocationOptions() {
// If we make the copy we don't copy the callbacks because that is
// potentially expensive and we don't want to do that for the simple case
// where someone is just disabling the location.
- if (m_options_ap == nullptr)
- m_options_ap.reset(
- new BreakpointOptions(false));
+ if (m_options_up == nullptr)
+ m_options_up.reset(new BreakpointOptions(false));
- return m_options_ap.get();
+ return m_options_up.get();
}
bool BreakpointLocation::ValidForThisThread(Thread *thread) {
@@ -603,17 +602,17 @@ void BreakpointLocation::GetDescription(Stream *s,
s->Indent();
s->Printf("hit count = %-4u\n", GetHitCount());
- if (m_options_ap) {
+ if (m_options_up) {
s->Indent();
- m_options_ap->GetDescription(s, level);
+ m_options_up->GetDescription(s, level);
s->EOL();
}
s->IndentLess();
} else if (level != eDescriptionLevelInitial) {
s->Printf(", %sresolved, hit count = %u ", (IsResolved() ? "" : "un"),
GetHitCount());
- if (m_options_ap) {
- m_options_ap->GetDescription(s, level);
+ if (m_options_up) {
+ m_options_up->GetDescription(s, level);
}
}
}
@@ -629,7 +628,7 @@ void BreakpointLocation::Dump(Stream *s) const {
"hw_index = %i hit_count = %-4u ignore_count = %-4u",
GetID(), tid,
(uint64_t)m_address.GetOpcodeLoadAddress(&m_owner.GetTarget()),
- (m_options_ap ? m_options_ap->IsEnabled() : m_owner.IsEnabled())
+ (m_options_up ? m_options_up->IsEnabled() : m_owner.IsEnabled())
? "enabled "
: "disabled",
IsHardware() ? "hardware" : "software", GetHardwareIndex(),
diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp
index 8bd732e776d..491273cfb32 100644
--- a/lldb/source/Breakpoint/BreakpointOptions.cpp
+++ b/lldb/source/Breakpoint/BreakpointOptions.cpp
@@ -125,12 +125,12 @@ bool BreakpointOptions::NullCallback(void *baton,
BreakpointOptions::BreakpointOptions(bool all_flags_set)
: m_callback(BreakpointOptions::NullCallback), m_callback_baton_sp(),
m_baton_is_command_baton(false), m_callback_is_synchronous(false),
- m_enabled(true), m_one_shot(false), m_ignore_count(0), m_thread_spec_ap(),
+ m_enabled(true), m_one_shot(false), m_ignore_count(0), m_thread_spec_up(),
m_condition_text(), m_condition_text_hash(0), m_auto_continue(false),
m_set_flags(0) {
- if (all_flags_set)
- m_set_flags.Set(~((Flags::ValueType) 0));
- }
+ if (all_flags_set)
+ m_set_flags.Set(~((Flags::ValueType)0));
+}
BreakpointOptions::BreakpointOptions(const char *condition, bool enabled,
int32_t ignore, bool one_shot,
@@ -155,11 +155,10 @@ BreakpointOptions::BreakpointOptions(const BreakpointOptions &rhs)
m_baton_is_command_baton(rhs.m_baton_is_command_baton),
m_callback_is_synchronous(rhs.m_callback_is_synchronous),
m_enabled(rhs.m_enabled), m_one_shot(rhs.m_one_shot),
- m_ignore_count(rhs.m_ignore_count), m_thread_spec_ap(),
- m_auto_continue(rhs.m_auto_continue),
- m_set_flags(rhs.m_set_flags) {
- if (rhs.m_thread_spec_ap != nullptr)
- m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap));
+ m_ignore_count(rhs.m_ignore_count), m_thread_spec_up(),
+ m_auto_continue(rhs.m_auto_continue), m_set_flags(rhs.m_set_flags) {
+ if (rhs.m_thread_spec_up != nullptr)
+ m_thread_spec_up.reset(new ThreadSpec(*rhs.m_thread_spec_up));
m_condition_text = rhs.m_condition_text;
m_condition_text_hash = rhs.m_condition_text_hash;
}
@@ -176,8 +175,8 @@ operator=(const BreakpointOptions &rhs) {
m_enabled = rhs.m_enabled;
m_one_shot = rhs.m_one_shot;
m_ignore_count = rhs.m_ignore_count;
- if (rhs.m_thread_spec_ap != nullptr)
- m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap));
+ if (rhs.m_thread_spec_up != nullptr)
+ m_thread_spec_up.reset(new ThreadSpec(*rhs.m_thread_spec_up));
m_condition_text = rhs.m_condition_text;
m_condition_text_hash = rhs.m_condition_text_hash;
m_auto_continue = rhs.m_auto_continue;
@@ -228,12 +227,11 @@ void BreakpointOptions::CopyOverSetOptions(const BreakpointOptions &incoming)
m_auto_continue = incoming.m_auto_continue;
m_set_flags.Set(eAutoContinue);
}
- if (incoming.m_set_flags.Test(eThreadSpec) && incoming.m_thread_spec_ap)
- {
- if (!m_thread_spec_ap)
- m_thread_spec_ap.reset(new ThreadSpec(*incoming.m_thread_spec_ap));
+ if (incoming.m_set_flags.Test(eThreadSpec) && incoming.m_thread_spec_up) {
+ if (!m_thread_spec_up)
+ m_thread_spec_up.reset(new ThreadSpec(*incoming.m_thread_spec_up));
else
- *m_thread_spec_ap = *incoming.m_thread_spec_ap;
+ *m_thread_spec_up = *incoming.m_thread_spec_up;
m_set_flags.Set(eThreadSpec);
}
}
@@ -404,9 +402,9 @@ StructuredData::ObjectSP BreakpointOptions::SerializeToStructuredData() {
BreakpointOptions::CommandData::GetSerializationKey(), commands_sp);
}
}
- if (m_set_flags.Test(eThreadSpec) && m_thread_spec_ap) {
+ if (m_set_flags.Test(eThreadSpec) && m_thread_spec_up) {
StructuredData::ObjectSP thread_spec_sp =
- m_thread_spec_ap->SerializeToStructuredData();
+ m_thread_spec_up->SerializeToStructuredData();
options_dict_sp->AddItem(ThreadSpec::GetSerializationKey(), thread_spec_sp);
}
@@ -521,16 +519,16 @@ const char *BreakpointOptions::GetConditionText(size_t *hash) const {
}
const ThreadSpec *BreakpointOptions::GetThreadSpecNoCreate() const {
- return m_thread_spec_ap.get();
+ return m_thread_spec_up.get();
}
ThreadSpec *BreakpointOptions::GetThreadSpec() {
- if (m_thread_spec_ap == nullptr) {
+ if (m_thread_spec_up == nullptr) {
m_set_flags.Set(eThreadSpec);
- m_thread_spec_ap.reset(new ThreadSpec());
+ m_thread_spec_up.reset(new ThreadSpec());
}
- return m_thread_spec_ap.get();
+ return m_thread_spec_up.get();
}
void BreakpointOptions::SetThreadID(lldb::tid_t thread_id) {
@@ -540,7 +538,7 @@ void BreakpointOptions::SetThreadID(lldb::tid_t thread_id) {
void BreakpointOptions::SetThreadSpec(
std::unique_ptr<ThreadSpec> &thread_spec_up) {
- m_thread_spec_ap = std::move(thread_spec_up);
+ m_thread_spec_up = std::move(thread_spec_up);
m_set_flags.Set(eThreadSpec);
}
@@ -572,8 +570,8 @@ void BreakpointOptions::GetDescription(Stream *s,
if (m_auto_continue)
s->Printf("auto-continue ");
- if (m_thread_spec_ap)
- m_thread_spec_ap->GetDescription(s, level);
+ if (m_thread_spec_up)
+ m_thread_spec_up->GetDescription(s, level);
if (level == lldb::eDescriptionLevelFull) {
s->IndentLess();
@@ -678,7 +676,7 @@ bool BreakpointOptions::BreakpointOptionsCallbackFunction(
void BreakpointOptions::Clear()
{
m_set_flags.Clear();
- m_thread_spec_ap.release();
+ m_thread_spec_up.release();
m_one_shot = false;
m_ignore_count = 0;
m_auto_continue = false;
diff --git a/lldb/source/Breakpoint/Watchpoint.cpp b/lldb/source/Breakpoint/Watchpoint.cpp
index 844d8bb5839..6481ad1a714 100644
--- a/lldb/source/Breakpoint/Watchpoint.cpp
+++ b/lldb/source/Breakpoint/Watchpoint.cpp
@@ -272,26 +272,26 @@ bool Watchpoint::InvokeCallback(StoppointCallbackContext *context) {
void Watchpoint::SetCondition(const char *condition) {
if (condition == nullptr || condition[0] == '\0') {
- if (m_condition_ap)
- m_condition_ap.reset();
+ if (m_condition_up)
+ m_condition_up.reset();
} else {
// Pass nullptr for expr_prefix (no translation-unit level definitions).
Status error;
- m_condition_ap.reset(m_target.GetUserExpressionForLanguage(
+ m_condition_up.reset(m_target.GetUserExpressionForLanguage(
condition, llvm::StringRef(), lldb::eLanguageTypeUnknown,
- UserExpression::eResultTypeAny, EvaluateExpressionOptions(),
- nullptr, error));
+ UserExpression::eResultTypeAny, EvaluateExpressionOptions(), nullptr,
+ error));
if (error.Fail()) {
// FIXME: Log something...
- m_condition_ap.reset();
+ m_condition_up.reset();
}
}
SendWatchpointChangedEvent(eWatchpointEventTypeConditionChanged);
}
const char *Watchpoint::GetConditionText() const {
- if (m_condition_ap)
- return m_condition_ap->GetUserText();
+ if (m_condition_up)
+ return m_condition_up->GetUserText();
else
return nullptr;
}
diff --git a/lldb/source/Breakpoint/WatchpointOptions.cpp b/lldb/source/Breakpoint/WatchpointOptions.cpp
index 8c796b7de51..842cbc252da 100644
--- a/lldb/source/Breakpoint/WatchpointOptions.cpp
+++ b/lldb/source/Breakpoint/WatchpointOptions.cpp
@@ -30,7 +30,7 @@ bool WatchpointOptions::NullCallback(void *baton,
//----------------------------------------------------------------------
WatchpointOptions::WatchpointOptions()
: m_callback(WatchpointOptions::NullCallback), m_callback_baton_sp(),
- m_callback_is_synchronous(false), m_thread_spec_ap() {}
+ m_callback_is_synchronous(false), m_thread_spec_up() {}
//----------------------------------------------------------------------
// WatchpointOptions copy constructor
@@ -38,9 +38,9 @@ WatchpointOptions::WatchpointOptions()
WatchpointOptions::WatchpointOptions(const WatchpointOptions &rhs)
: m_callback(rhs.m_callback), m_callback_baton_sp(rhs.m_callback_baton_sp),
m_callback_is_synchronous(rhs.m_callback_is_synchronous),
- m_thread_spec_ap() {
- if (rhs.m_thread_spec_ap != nullptr)
- m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap));
+ m_thread_spec_up() {
+ if (rhs.m_thread_spec_up != nullptr)
+ m_thread_spec_up.reset(new ThreadSpec(*rhs.m_thread_spec_up));
}
//----------------------------------------------------------------------
@@ -51,8 +51,8 @@ operator=(const WatchpointOptions &rhs) {
m_callback = rhs.m_callback;
m_callback_baton_sp = rhs.m_callback_baton_sp;
m_callback_is_synchronous = rhs.m_callback_is_synchronous;
- if (rhs.m_thread_spec_ap != nullptr)
- m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap));
+ if (rhs.m_thread_spec_up != nullptr)
+ m_thread_spec_up.reset(new ThreadSpec(*rhs.m_thread_spec_up));
return *this;
}
@@ -113,14 +113,14 @@ bool WatchpointOptions::HasCallback() {
}
const ThreadSpec *WatchpointOptions::GetThreadSpecNoCreate() const {
- return m_thread_spec_ap.get();
+ return m_thread_spec_up.get();
}
ThreadSpec *WatchpointOptions::GetThreadSpec() {
- if (m_thread_spec_ap == nullptr)
- m_thread_spec_ap.reset(new ThreadSpec());
+ if (m_thread_spec_up == nullptr)
+ m_thread_spec_up.reset(new ThreadSpec());
- return m_thread_spec_ap.get();
+ return m_thread_spec_up.get();
}
void WatchpointOptions::SetThreadID(lldb::tid_t thread_id) {
@@ -152,8 +152,8 @@ void WatchpointOptions::GetDescription(Stream *s,
} else
s->PutCString(" Options: ");
- if (m_thread_spec_ap)
- m_thread_spec_ap->GetDescription(s, level);
+ if (m_thread_spec_up)
+ m_thread_spec_up->GetDescription(s, level);
else if (level == eDescriptionLevelBrief)
s->PutCString("thread spec: no ");
if (level == lldb::eDescriptionLevelFull) {
OpenPOWER on IntegriCloud