summaryrefslogtreecommitdiff
path: root/source/API/SBBreakpointName.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-08-20 20:51:52 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-08-20 20:51:52 +0000
commit5f29bb8a675e8f96452b632e7129113f7dec850e (patch)
tree3d3f2a0d3ad10872a4dcaba8ec8d1d20c87ab147 /source/API/SBBreakpointName.cpp
parent88c643b6fec27eec436c8d138fee6346e92337d6 (diff)
Notes
Diffstat (limited to 'source/API/SBBreakpointName.cpp')
-rw-r--r--source/API/SBBreakpointName.cpp391
1 files changed, 227 insertions, 164 deletions
diff --git a/source/API/SBBreakpointName.cpp b/source/API/SBBreakpointName.cpp
index 47bddd752346..1c794fca8ca5 100644
--- a/source/API/SBBreakpointName.cpp
+++ b/source/API/SBBreakpointName.cpp
@@ -1,13 +1,13 @@
//===-- SBBreakpointName.cpp ----------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "lldb/API/SBBreakpointName.h"
+#include "SBReproducerPrivate.h"
#include "lldb/API/SBDebugger.h"
#include "lldb/API/SBError.h"
#include "lldb/API/SBStream.h"
@@ -21,7 +21,6 @@
#include "lldb/Interpreter/ScriptInterpreter.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/ThreadSpec.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include "SBBreakpointOptionCommon.h"
@@ -37,10 +36,10 @@ public:
if (!name || name[0] == '\0')
return;
m_name.assign(name);
-
+
if (!target_sp)
return;
-
+
m_target_wp = target_sp;
}
@@ -50,15 +49,15 @@ public:
// For now we take a simple approach and only keep the name, and relook up
// the location when we need it.
-
+
TargetSP GetTarget() const {
return m_target_wp.lock();
}
-
+
const char *GetName() const {
return m_name.c_str();
}
-
+
bool IsValid() const {
return !m_name.empty() && m_target_wp.lock();
}
@@ -106,10 +105,14 @@ lldb_private::BreakpointName *SBBreakpointNameImpl::GetBreakpointName() const {
} // namespace lldb
-SBBreakpointName::SBBreakpointName() {}
+SBBreakpointName::SBBreakpointName() {
+ LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBBreakpointName);
+}
+
+SBBreakpointName::SBBreakpointName(SBTarget &sb_target, const char *name) {
+ LLDB_RECORD_CONSTRUCTOR(SBBreakpointName, (lldb::SBTarget &, const char *),
+ sb_target, name);
-SBBreakpointName::SBBreakpointName(SBTarget &sb_target, const char *name)
-{
m_impl_up.reset(new SBBreakpointNameImpl(sb_target, name));
// Call FindBreakpointName here to make sure the name is valid, reset if not:
BreakpointName *bp_name = GetBreakpointName();
@@ -117,8 +120,10 @@ SBBreakpointName::SBBreakpointName(SBTarget &sb_target, const char *name)
m_impl_up.reset();
}
-SBBreakpointName::SBBreakpointName(SBBreakpoint &sb_bkpt, const char *name)
-{
+SBBreakpointName::SBBreakpointName(SBBreakpoint &sb_bkpt, const char *name) {
+ LLDB_RECORD_CONSTRUCTOR(SBBreakpointName,
+ (lldb::SBBreakpoint &, const char *), sb_bkpt, name);
+
if (!sb_bkpt.IsValid()) {
m_impl_up.reset();
return;
@@ -127,21 +132,23 @@ SBBreakpointName::SBBreakpointName(SBBreakpoint &sb_bkpt, const char *name)
Target &target = bkpt_sp->GetTarget();
m_impl_up.reset(new SBBreakpointNameImpl(target.shared_from_this(), name));
-
+
// Call FindBreakpointName here to make sure the name is valid, reset if not:
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name) {
m_impl_up.reset();
return;
}
-
+
// Now copy over the breakpoint's options:
target.ConfigureBreakpointName(*bp_name, *bkpt_sp->GetOptions(),
BreakpointName::Permissions());
}
-SBBreakpointName::SBBreakpointName(const SBBreakpointName &rhs)
-{
+SBBreakpointName::SBBreakpointName(const SBBreakpointName &rhs) {
+ LLDB_RECORD_CONSTRUCTOR(SBBreakpointName, (const lldb::SBBreakpointName &),
+ rhs);
+
if (!rhs.m_impl_up)
return;
else
@@ -151,46 +158,63 @@ SBBreakpointName::SBBreakpointName(const SBBreakpointName &rhs)
SBBreakpointName::~SBBreakpointName() = default;
-const SBBreakpointName &SBBreakpointName::operator=(const SBBreakpointName &rhs)
-{
+const SBBreakpointName &SBBreakpointName::
+operator=(const SBBreakpointName &rhs) {
+ LLDB_RECORD_METHOD(
+ const lldb::SBBreakpointName &,
+ SBBreakpointName, operator=,(const lldb::SBBreakpointName &), rhs);
+
if (!rhs.m_impl_up) {
m_impl_up.reset();
- return *this;
+ return LLDB_RECORD_RESULT(*this);
}
-
+
m_impl_up.reset(new SBBreakpointNameImpl(rhs.m_impl_up->GetTarget(),
rhs.m_impl_up->GetName()));
- return *this;
+ return LLDB_RECORD_RESULT(*this);
}
bool SBBreakpointName::operator==(const lldb::SBBreakpointName &rhs) {
+ LLDB_RECORD_METHOD(
+ bool, SBBreakpointName, operator==,(const lldb::SBBreakpointName &), rhs);
+
return *m_impl_up == *rhs.m_impl_up;
}
bool SBBreakpointName::operator!=(const lldb::SBBreakpointName &rhs) {
+ LLDB_RECORD_METHOD(
+ bool, SBBreakpointName, operator!=,(const lldb::SBBreakpointName &), rhs);
+
return *m_impl_up != *rhs.m_impl_up;
}
bool SBBreakpointName::IsValid() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBreakpointName, IsValid);
+ return this->operator bool();
+}
+SBBreakpointName::operator bool() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBreakpointName, operator bool);
+
if (!m_impl_up)
return false;
return m_impl_up->IsValid();
}
const char *SBBreakpointName::GetName() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBBreakpointName, GetName);
+
if (!m_impl_up)
return "<Invalid Breakpoint Name Object>";
return m_impl_up->GetName();
}
void SBBreakpointName::SetEnabled(bool enable) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetEnabled, (bool), enable);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
-
- LLDB_LOG(log, "Name: {0} enabled: {1}\n", bp_name->GetName(), enable);
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -209,13 +233,12 @@ void SBBreakpointName::UpdateName(BreakpointName &bp_name) {
}
bool SBBreakpointName::IsEnabled() {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBBreakpointName, IsEnabled);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return false;
-
- LLDB_LOG(log, "Name: {0}\n", bp_name->GetName());
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -223,13 +246,12 @@ bool SBBreakpointName::IsEnabled() {
}
void SBBreakpointName::SetOneShot(bool one_shot) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetOneShot, (bool), one_shot);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
-
- LLDB_LOG(log, "Name: {0} one_shot: {1}\n", bp_name->GetName(), one_shot);
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -238,13 +260,12 @@ void SBBreakpointName::SetOneShot(bool one_shot) {
}
bool SBBreakpointName::IsOneShot() const {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBreakpointName, IsOneShot);
+
const BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return false;
-
- LLDB_LOG(log, "Name: {0}\n", bp_name->GetName());
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -252,13 +273,12 @@ bool SBBreakpointName::IsOneShot() const {
}
void SBBreakpointName::SetIgnoreCount(uint32_t count) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetIgnoreCount, (uint32_t), count);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
-
- LLDB_LOG(log, "Name: {0} one_shot: {1}\n", bp_name->GetName(), count);
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -267,13 +287,12 @@ void SBBreakpointName::SetIgnoreCount(uint32_t count) {
}
uint32_t SBBreakpointName::GetIgnoreCount() const {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBBreakpointName, GetIgnoreCount);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return false;
-
- LLDB_LOG(log, "Name: {0}\n", bp_name->GetName());
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -281,15 +300,13 @@ uint32_t SBBreakpointName::GetIgnoreCount() const {
}
void SBBreakpointName::SetCondition(const char *condition) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetCondition, (const char *),
+ condition);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
-
- LLDB_LOG(log, "Name: {0} one_shot: {1}\n", bp_name->GetName(),
- condition ? condition : "<NULL>");
-
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -298,13 +315,12 @@ void SBBreakpointName::SetCondition(const char *condition) {
}
const char *SBBreakpointName::GetCondition() {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD_NO_ARGS(const char *, SBBreakpointName, GetCondition);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return nullptr;
-
- LLDB_LOG(log, "Name: {0}\n", bp_name->GetName());
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -312,14 +328,13 @@ const char *SBBreakpointName::GetCondition() {
}
void SBBreakpointName::SetAutoContinue(bool auto_continue) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetAutoContinue, (bool),
+ auto_continue);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
-
- LLDB_LOG(log, "Name: {0} auto-continue: {1}\n", bp_name->GetName(), auto_continue);
-
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -328,13 +343,12 @@ void SBBreakpointName::SetAutoContinue(bool auto_continue) {
}
bool SBBreakpointName::GetAutoContinue() {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBBreakpointName, GetAutoContinue);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return false;
-
- LLDB_LOG(log, "Name: {0}\n", bp_name->GetName());
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -342,14 +356,12 @@ bool SBBreakpointName::GetAutoContinue() {
}
void SBBreakpointName::SetThreadID(tid_t tid) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetThreadID, (lldb::tid_t), tid);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
-
- LLDB_LOG(log, "Name: {0} tid: {1:x}\n", bp_name->GetName(), tid);
-
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -358,13 +370,12 @@ void SBBreakpointName::SetThreadID(tid_t tid) {
}
tid_t SBBreakpointName::GetThreadID() {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD_NO_ARGS(lldb::tid_t, SBBreakpointName, GetThreadID);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return LLDB_INVALID_THREAD_ID;
-
- LLDB_LOG(log, "Name: {0}\n", bp_name->GetName());
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -372,14 +383,12 @@ tid_t SBBreakpointName::GetThreadID() {
}
void SBBreakpointName::SetThreadIndex(uint32_t index) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetThreadIndex, (uint32_t), index);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
-
- LLDB_LOG(log, "Name: {0} thread index: {1}\n", bp_name->GetName(), index);
-
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -388,13 +397,12 @@ void SBBreakpointName::SetThreadIndex(uint32_t index) {
}
uint32_t SBBreakpointName::GetThreadIndex() const {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBBreakpointName, GetThreadIndex);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return LLDB_INVALID_THREAD_ID;
-
- LLDB_LOG(log, "Name: {0}\n", bp_name->GetName());
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -402,14 +410,13 @@ uint32_t SBBreakpointName::GetThreadIndex() const {
}
void SBBreakpointName::SetThreadName(const char *thread_name) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetThreadName, (const char *),
+ thread_name);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
-
- LLDB_LOG(log, "Name: {0} thread name: {1}\n", bp_name->GetName(), thread_name);
-
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -418,13 +425,13 @@ void SBBreakpointName::SetThreadName(const char *thread_name) {
}
const char *SBBreakpointName::GetThreadName() const {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBBreakpointName,
+ GetThreadName);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return nullptr;
-
- LLDB_LOG(log, "Name: {0}\n", bp_name->GetName());
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -432,14 +439,13 @@ const char *SBBreakpointName::GetThreadName() const {
}
void SBBreakpointName::SetQueueName(const char *queue_name) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetQueueName, (const char *),
+ queue_name);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
-
- LLDB_LOG(log, "Name: {0} queue name: {1}\n", bp_name->GetName(), queue_name);
-
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -448,13 +454,13 @@ void SBBreakpointName::SetQueueName(const char *queue_name) {
}
const char *SBBreakpointName::GetQueueName() const {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBBreakpointName,
+ GetQueueName);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return nullptr;
-
- LLDB_LOG(log, "Name: {0}\n", bp_name->GetName());
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -462,14 +468,15 @@ const char *SBBreakpointName::GetQueueName() const {
}
void SBBreakpointName::SetCommandLineCommands(SBStringList &commands) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetCommandLineCommands,
+ (lldb::SBStringList &), commands);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
if (commands.GetSize() == 0)
return;
- LLDB_LOG(log, "Name: {0} commands\n", bp_name->GetName());
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -481,13 +488,13 @@ void SBBreakpointName::SetCommandLineCommands(SBStringList &commands) {
}
bool SBBreakpointName::GetCommandLineCommands(SBStringList &commands) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD(bool, SBBreakpointName, GetCommandLineCommands,
+ (lldb::SBStringList &), commands);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return false;
-
- LLDB_LOG(log, "Name: {0}\n", bp_name->GetName());
+
StringList command_list;
bool has_commands =
bp_name->GetOptions().GetCommandLineCallbacks(command_list);
@@ -497,23 +504,24 @@ bool SBBreakpointName::GetCommandLineCommands(SBStringList &commands) {
}
const char *SBBreakpointName::GetHelpString() const {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBBreakpointName,
+ GetHelpString);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return "";
-
- LLDB_LOG(log, "Help: {0}\n", bp_name->GetHelp());
+
return bp_name->GetHelp();
}
void SBBreakpointName::SetHelpString(const char *help_string) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetHelpString, (const char *),
+ help_string);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
- LLDB_LOG(log, "Name: {0} help: {1}\n", bp_name->GetName(), help_string);
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -521,16 +529,16 @@ void SBBreakpointName::SetHelpString(const char *help_string) {
}
bool SBBreakpointName::GetDescription(SBStream &s) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD(bool, SBBreakpointName, GetDescription, (lldb::SBStream &),
+ s);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
{
s.Printf("No value");
return false;
}
-
- LLDB_LOG(log, "Name: {0}\n", bp_name->GetName());
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
bp_name->GetDescription(s.get(), eDescriptionLevelFull);
@@ -539,11 +547,12 @@ bool SBBreakpointName::GetDescription(SBStream &s) {
void SBBreakpointName::SetCallback(SBBreakpointHitCallback callback,
void *baton) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ LLDB_RECORD_DUMMY(void, SBBreakpointName, SetCallback,
+ (lldb::SBBreakpointHitCallback, void *), callback, baton);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
- LLDB_LOG(log, "callback = {1}, baton = {2}", callback, baton);
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -557,39 +566,35 @@ void SBBreakpointName::SetCallback(SBBreakpointHitCallback callback,
void SBBreakpointName::SetScriptCallbackFunction(
const char *callback_function_name) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetScriptCallbackFunction,
+ (const char *), callback_function_name);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
-
- LLDB_LOG(log, "Name: {0} callback: {1}\n", bp_name->GetName(),
- callback_function_name);
-
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
BreakpointOptions &bp_options = bp_name->GetOptions();
m_impl_up->GetTarget()
->GetDebugger()
- .GetCommandInterpreter()
.GetScriptInterpreter()
->SetBreakpointCommandCallbackFunction(&bp_options,
callback_function_name);
UpdateName(*bp_name);
}
-SBError SBBreakpointName::SetScriptCallbackBody(const char *callback_body_text)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+SBError
+SBBreakpointName::SetScriptCallbackBody(const char *callback_body_text) {
+ LLDB_RECORD_METHOD(lldb::SBError, SBBreakpointName, SetScriptCallbackBody,
+ (const char *), callback_body_text);
+
SBError sb_error;
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
- return sb_error;
-
- LLDB_LOG(log, "Name: {0} callback: {1}\n", bp_name->GetName(),
- callback_body_text);
-
+ return LLDB_RECORD_RESULT(sb_error);
+
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
@@ -597,76 +602,68 @@ SBError SBBreakpointName::SetScriptCallbackBody(const char *callback_body_text)
Status error =
m_impl_up->GetTarget()
->GetDebugger()
- .GetCommandInterpreter()
.GetScriptInterpreter()
->SetBreakpointCommandCallback(&bp_options, callback_body_text);
sb_error.SetError(error);
if (!sb_error.Fail())
UpdateName(*bp_name);
- return sb_error;
+ return LLDB_RECORD_RESULT(sb_error);
}
-bool SBBreakpointName::GetAllowList() const
-{
+bool SBBreakpointName::GetAllowList() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBreakpointName, GetAllowList);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return false;
return bp_name->GetPermissions().GetAllowList();
}
-void SBBreakpointName::SetAllowList(bool value)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+void SBBreakpointName::SetAllowList(bool value) {
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetAllowList, (bool), value);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
- if (log)
- log->Printf("Setting allow list to %u for %s.", value,
- bp_name->GetName().AsCString());
bp_name->GetPermissions().SetAllowList(value);
}
-
-bool SBBreakpointName::GetAllowDelete()
-{
+
+bool SBBreakpointName::GetAllowDelete() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBBreakpointName, GetAllowDelete);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return false;
return bp_name->GetPermissions().GetAllowDelete();
}
-void SBBreakpointName::SetAllowDelete(bool value)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+void SBBreakpointName::SetAllowDelete(bool value) {
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetAllowDelete, (bool), value);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
- if (log)
- log->Printf("Setting allow delete to %u for %s.", value,
- bp_name->GetName().AsCString());
bp_name->GetPermissions().SetAllowDelete(value);
}
-
-bool SBBreakpointName::GetAllowDisable()
-{
+
+bool SBBreakpointName::GetAllowDisable() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBBreakpointName, GetAllowDisable);
+
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return false;
return bp_name->GetPermissions().GetAllowDisable();
}
-void SBBreakpointName::SetAllowDisable(bool value)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+void SBBreakpointName::SetAllowDisable(bool value) {
+ LLDB_RECORD_METHOD(void, SBBreakpointName, SetAllowDisable, (bool), value);
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return;
- if (log)
- log->Printf("Setting allow disable to %u for %s.", value,
- bp_name->GetName().AsCString());
bp_name->GetPermissions().SetAllowDisable(value);
}
@@ -677,3 +674,69 @@ lldb_private::BreakpointName *SBBreakpointName::GetBreakpointName() const
return m_impl_up->GetBreakpointName();
}
+
+namespace lldb_private {
+namespace repro {
+
+template <>
+void RegisterMethods<SBBreakpointName>(Registry &R) {
+ LLDB_REGISTER_CONSTRUCTOR(SBBreakpointName, ());
+ LLDB_REGISTER_CONSTRUCTOR(SBBreakpointName,
+ (lldb::SBTarget &, const char *));
+ LLDB_REGISTER_CONSTRUCTOR(SBBreakpointName,
+ (lldb::SBBreakpoint &, const char *));
+ LLDB_REGISTER_CONSTRUCTOR(SBBreakpointName,
+ (const lldb::SBBreakpointName &));
+ LLDB_REGISTER_METHOD(
+ const lldb::SBBreakpointName &,
+ SBBreakpointName, operator=,(const lldb::SBBreakpointName &));
+ LLDB_REGISTER_METHOD(
+ bool, SBBreakpointName, operator==,(const lldb::SBBreakpointName &));
+ LLDB_REGISTER_METHOD(
+ bool, SBBreakpointName, operator!=,(const lldb::SBBreakpointName &));
+ LLDB_REGISTER_METHOD_CONST(bool, SBBreakpointName, IsValid, ());
+ LLDB_REGISTER_METHOD_CONST(bool, SBBreakpointName, operator bool, ());
+ LLDB_REGISTER_METHOD_CONST(const char *, SBBreakpointName, GetName, ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetEnabled, (bool));
+ LLDB_REGISTER_METHOD(bool, SBBreakpointName, IsEnabled, ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetOneShot, (bool));
+ LLDB_REGISTER_METHOD_CONST(bool, SBBreakpointName, IsOneShot, ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetIgnoreCount, (uint32_t));
+ LLDB_REGISTER_METHOD_CONST(uint32_t, SBBreakpointName, GetIgnoreCount, ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetCondition, (const char *));
+ LLDB_REGISTER_METHOD(const char *, SBBreakpointName, GetCondition, ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetAutoContinue, (bool));
+ LLDB_REGISTER_METHOD(bool, SBBreakpointName, GetAutoContinue, ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetThreadID, (lldb::tid_t));
+ LLDB_REGISTER_METHOD(lldb::tid_t, SBBreakpointName, GetThreadID, ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetThreadIndex, (uint32_t));
+ LLDB_REGISTER_METHOD_CONST(uint32_t, SBBreakpointName, GetThreadIndex, ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetThreadName, (const char *));
+ LLDB_REGISTER_METHOD_CONST(const char *, SBBreakpointName, GetThreadName,
+ ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetQueueName, (const char *));
+ LLDB_REGISTER_METHOD_CONST(const char *, SBBreakpointName, GetQueueName,
+ ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetCommandLineCommands,
+ (lldb::SBStringList &));
+ LLDB_REGISTER_METHOD(bool, SBBreakpointName, GetCommandLineCommands,
+ (lldb::SBStringList &));
+ LLDB_REGISTER_METHOD_CONST(const char *, SBBreakpointName, GetHelpString,
+ ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetHelpString, (const char *));
+ LLDB_REGISTER_METHOD(bool, SBBreakpointName, GetDescription,
+ (lldb::SBStream &));
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetScriptCallbackFunction,
+ (const char *));
+ LLDB_REGISTER_METHOD(lldb::SBError, SBBreakpointName, SetScriptCallbackBody,
+ (const char *));
+ LLDB_REGISTER_METHOD_CONST(bool, SBBreakpointName, GetAllowList, ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetAllowList, (bool));
+ LLDB_REGISTER_METHOD(bool, SBBreakpointName, GetAllowDelete, ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetAllowDelete, (bool));
+ LLDB_REGISTER_METHOD(bool, SBBreakpointName, GetAllowDisable, ());
+ LLDB_REGISTER_METHOD(void, SBBreakpointName, SetAllowDisable, (bool));
+}
+
+}
+}