summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBTarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API/SBTarget.cpp')
-rw-r--r--lldb/source/API/SBTarget.cpp677
1 files changed, 535 insertions, 142 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 3b53d2dcd5d..7719764631f 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "lldb/API/SBTarget.h"
+#include "SBReproducerPrivate.h"
#include "lldb/lldb-public.h"
@@ -100,13 +101,22 @@ Status AttachToProcess(ProcessAttachInfo &attach_info, Target &target) {
//----------------------------------------------------------------------
// SBTarget constructor
//----------------------------------------------------------------------
-SBTarget::SBTarget() : m_opaque_sp() {}
+SBTarget::SBTarget() : m_opaque_sp() {
+ LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBTarget);
+}
-SBTarget::SBTarget(const SBTarget &rhs) : m_opaque_sp(rhs.m_opaque_sp) {}
+SBTarget::SBTarget(const SBTarget &rhs) : m_opaque_sp(rhs.m_opaque_sp) {
+ LLDB_RECORD_CONSTRUCTOR(SBTarget, (const lldb::SBTarget &), rhs);
+}
-SBTarget::SBTarget(const TargetSP &target_sp) : m_opaque_sp(target_sp) {}
+SBTarget::SBTarget(const TargetSP &target_sp) : m_opaque_sp(target_sp) {
+ LLDB_RECORD_CONSTRUCTOR(SBTarget, (const lldb::TargetSP &), target_sp);
+}
const SBTarget &SBTarget::operator=(const SBTarget &rhs) {
+ LLDB_RECORD_METHOD(const lldb::SBTarget &,
+ SBTarget, operator=,(const lldb::SBTarget &), rhs);
+
if (this != &rhs)
m_opaque_sp = rhs.m_opaque_sp;
return *this;
@@ -118,14 +128,24 @@ const SBTarget &SBTarget::operator=(const SBTarget &rhs) {
SBTarget::~SBTarget() {}
bool SBTarget::EventIsTargetEvent(const SBEvent &event) {
+ LLDB_RECORD_STATIC_METHOD(bool, SBTarget, EventIsTargetEvent,
+ (const lldb::SBEvent &), event);
+
return Target::TargetEventData::GetEventDataFromEvent(event.get()) != NULL;
}
SBTarget SBTarget::GetTargetFromEvent(const SBEvent &event) {
- return Target::TargetEventData::GetTargetFromEvent(event.get());
+ LLDB_RECORD_STATIC_METHOD(lldb::SBTarget, SBTarget, GetTargetFromEvent,
+ (const lldb::SBEvent &), event);
+
+ return LLDB_RECORD_RESULT(
+ Target::TargetEventData::GetTargetFromEvent(event.get()));
}
uint32_t SBTarget::GetNumModulesFromEvent(const SBEvent &event) {
+ LLDB_RECORD_STATIC_METHOD(uint32_t, SBTarget, GetNumModulesFromEvent,
+ (const lldb::SBEvent &), event);
+
const ModuleList module_list =
Target::TargetEventData::GetModuleListFromEvent(event.get());
return module_list.GetSize();
@@ -133,20 +153,31 @@ uint32_t SBTarget::GetNumModulesFromEvent(const SBEvent &event) {
SBModule SBTarget::GetModuleAtIndexFromEvent(const uint32_t idx,
const SBEvent &event) {
+ LLDB_RECORD_STATIC_METHOD(lldb::SBModule, SBTarget, GetModuleAtIndexFromEvent,
+ (const uint32_t, const lldb::SBEvent &), idx,
+ event);
+
const ModuleList module_list =
Target::TargetEventData::GetModuleListFromEvent(event.get());
- return SBModule(module_list.GetModuleAtIndex(idx));
+ return LLDB_RECORD_RESULT(SBModule(module_list.GetModuleAtIndex(idx)));
}
const char *SBTarget::GetBroadcasterClassName() {
+ LLDB_RECORD_STATIC_METHOD_NO_ARGS(const char *, SBTarget,
+ GetBroadcasterClassName);
+
return Target::GetStaticBroadcasterClass().AsCString();
}
bool SBTarget::IsValid() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTarget, IsValid);
+
return m_opaque_sp.get() != NULL && m_opaque_sp->IsValid();
}
SBProcess SBTarget::GetProcess() {
+ LLDB_RECORD_METHOD_NO_ARGS(lldb::SBProcess, SBTarget, GetProcess);
+
SBProcess sb_process;
ProcessSP process_sp;
TargetSP target_sp(GetSP());
@@ -161,33 +192,39 @@ SBProcess SBTarget::GetProcess() {
static_cast<void *>(target_sp.get()),
static_cast<void *>(process_sp.get()));
- return sb_process;
+ return LLDB_RECORD_RESULT(sb_process);
}
SBPlatform SBTarget::GetPlatform() {
+ LLDB_RECORD_METHOD_NO_ARGS(lldb::SBPlatform, SBTarget, GetPlatform);
+
TargetSP target_sp(GetSP());
if (!target_sp)
- return SBPlatform();
+ return LLDB_RECORD_RESULT(SBPlatform());
SBPlatform platform;
platform.m_opaque_sp = target_sp->GetPlatform();
- return platform;
+ return LLDB_RECORD_RESULT(platform);
}
SBDebugger SBTarget::GetDebugger() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBDebugger, SBTarget, GetDebugger);
+
SBDebugger debugger;
TargetSP target_sp(GetSP());
if (target_sp)
debugger.reset(target_sp->GetDebugger().shared_from_this());
- return debugger;
+ return LLDB_RECORD_RESULT(debugger);
}
SBStructuredData SBTarget::GetStatistics() {
+ LLDB_RECORD_METHOD_NO_ARGS(lldb::SBStructuredData, SBTarget, GetStatistics);
+
SBStructuredData data;
TargetSP target_sp(GetSP());
if (!target_sp)
- return data;
+ return LLDB_RECORD_RESULT(data);
auto stats_up = llvm::make_unique<StructuredData::Dictionary>();
int i = 0;
@@ -199,10 +236,12 @@ SBStructuredData SBTarget::GetStatistics() {
}
data.m_impl_up->SetObjectSP(std::move(stats_up));
- return data;
+ return LLDB_RECORD_RESULT(data);
}
void SBTarget::SetCollectingStats(bool v) {
+ LLDB_RECORD_METHOD(void, SBTarget, SetCollectingStats, (bool), v);
+
TargetSP target_sp(GetSP());
if (!target_sp)
return;
@@ -210,19 +249,26 @@ void SBTarget::SetCollectingStats(bool v) {
}
bool SBTarget::GetCollectingStats() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBTarget, GetCollectingStats);
+
TargetSP target_sp(GetSP());
if (!target_sp)
return false;
return target_sp->GetCollectingStats();
}
-
SBProcess SBTarget::LoadCore(const char *core_file) {
+ LLDB_RECORD_METHOD(lldb::SBProcess, SBTarget, LoadCore, (const char *),
+ core_file);
+
lldb::SBError error; // Ignored
- return LoadCore(core_file, error);
+ return LLDB_RECORD_RESULT(LoadCore(core_file, error));
}
SBProcess SBTarget::LoadCore(const char *core_file, lldb::SBError &error) {
+ LLDB_RECORD_METHOD(lldb::SBProcess, SBTarget, LoadCore,
+ (const char *, lldb::SBError &), core_file, error);
+
SBProcess sb_process;
TargetSP target_sp(GetSP());
if (target_sp) {
@@ -240,11 +286,15 @@ SBProcess SBTarget::LoadCore(const char *core_file, lldb::SBError &error) {
} else {
error.SetErrorString("SBTarget is invalid");
}
- return sb_process;
+ return LLDB_RECORD_RESULT(sb_process);
}
SBProcess SBTarget::LaunchSimple(char const **argv, char const **envp,
const char *working_directory) {
+ LLDB_RECORD_METHOD(lldb::SBProcess, SBTarget, LaunchSimple,
+ (const char **, const char **, const char *), argv, envp,
+ working_directory);
+
char *stdin_path = NULL;
char *stdout_path = NULL;
char *stderr_path = NULL;
@@ -252,18 +302,21 @@ SBProcess SBTarget::LaunchSimple(char const **argv, char const **envp,
bool stop_at_entry = false;
SBError error;
SBListener listener = GetDebugger().GetListener();
- return Launch(listener, argv, envp, stdin_path, stdout_path, stderr_path,
- working_directory, launch_flags, stop_at_entry, error);
+ return LLDB_RECORD_RESULT(Launch(listener, argv, envp, stdin_path,
+ stdout_path, stderr_path, working_directory,
+ launch_flags, stop_at_entry, error));
}
SBError SBTarget::Install() {
+ LLDB_RECORD_METHOD_NO_ARGS(lldb::SBError, SBTarget, Install);
+
SBError sb_error;
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
sb_error.ref() = target_sp->Install(NULL);
}
- return sb_error;
+ return LLDB_RECORD_RESULT(sb_error);
}
SBProcess SBTarget::Launch(SBListener &listener, char const **argv,
@@ -272,6 +325,13 @@ SBProcess SBTarget::Launch(SBListener &listener, char const **argv,
const char *working_directory,
uint32_t launch_flags, // See LaunchFlags
bool stop_at_entry, lldb::SBError &error) {
+ LLDB_RECORD_METHOD(lldb::SBProcess, SBTarget, Launch,
+ (lldb::SBListener &, const char **, const char **,
+ const char *, const char *, const char *, const char *,
+ uint32_t, bool, lldb::SBError &),
+ listener, argv, envp, stdin_path, stdout_path, stderr_path,
+ working_directory, launch_flags, stop_at_entry, error);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBProcess sb_process;
@@ -308,7 +368,7 @@ SBProcess SBTarget::Launch(SBListener &listener, char const **argv,
error.SetErrorString("process attach is in progress");
else
error.SetErrorString("a process is already being debugged");
- return sb_process;
+ return LLDB_RECORD_RESULT(sb_process);
}
}
@@ -319,7 +379,7 @@ SBProcess SBTarget::Launch(SBListener &listener, char const **argv,
if (listener.IsValid()) {
error.SetErrorString("process is connected and already has a listener, "
"pass empty listener");
- return sb_process;
+ return LLDB_RECORD_RESULT(sb_process);
}
}
@@ -355,10 +415,14 @@ SBProcess SBTarget::Launch(SBListener &listener, char const **argv,
static_cast<void *>(sb_process.GetSP().get()),
error.GetCString());
- return sb_process;
+ return LLDB_RECORD_RESULT(sb_process);
}
SBProcess SBTarget::Launch(SBLaunchInfo &sb_launch_info, SBError &error) {
+ LLDB_RECORD_METHOD(lldb::SBProcess, SBTarget, Launch,
+ (lldb::SBLaunchInfo &, lldb::SBError &), sb_launch_info,
+ error);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBProcess sb_process;
@@ -381,7 +445,7 @@ SBProcess SBTarget::Launch(SBLaunchInfo &sb_launch_info, SBError &error) {
error.SetErrorString("process attach is in progress");
else
error.SetErrorString("a process is already being debugged");
- return sb_process;
+ return LLDB_RECORD_RESULT(sb_process);
}
}
}
@@ -411,10 +475,14 @@ SBProcess SBTarget::Launch(SBLaunchInfo &sb_launch_info, SBError &error) {
static_cast<void *>(target_sp.get()),
static_cast<void *>(sb_process.GetSP().get()));
- return sb_process;
+ return LLDB_RECORD_RESULT(sb_process);
}
lldb::SBProcess SBTarget::Attach(SBAttachInfo &sb_attach_info, SBError &error) {
+ LLDB_RECORD_METHOD(lldb::SBProcess, SBTarget, Attach,
+ (lldb::SBAttachInfo &, lldb::SBError &), sb_attach_info,
+ error);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBProcess sb_process;
@@ -442,7 +510,7 @@ lldb::SBProcess SBTarget::Attach(SBAttachInfo &sb_attach_info, SBError &error) {
static_cast<void *>(target_sp.get()),
error.GetCString());
}
- return sb_process;
+ return LLDB_RECORD_RESULT(sb_process);
}
}
}
@@ -458,14 +526,18 @@ lldb::SBProcess SBTarget::Attach(SBAttachInfo &sb_attach_info, SBError &error) {
static_cast<void *>(target_sp.get()),
static_cast<void *>(sb_process.GetSP().get()));
- return sb_process;
+ return LLDB_RECORD_RESULT(sb_process);
}
lldb::SBProcess SBTarget::AttachToProcessWithID(
SBListener &listener,
lldb::pid_t pid, // The process ID to attach to
SBError &error // An error explaining what went wrong if attach fails
- ) {
+) {
+ LLDB_RECORD_METHOD(lldb::SBProcess, SBTarget, AttachToProcessWithID,
+ (lldb::SBListener &, lldb::pid_t, lldb::SBError &),
+ listener, pid, error);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBProcess sb_process;
@@ -495,7 +567,7 @@ lldb::SBProcess SBTarget::AttachToProcessWithID(
log->Printf("SBTarget(%p)::%s (...) => SBProcess(%p)",
static_cast<void *>(target_sp.get()), __FUNCTION__,
static_cast<void *>(sb_process.GetSP().get()));
- return sb_process;
+ return LLDB_RECORD_RESULT(sb_process);
}
lldb::SBProcess SBTarget::AttachToProcessWithName(
@@ -503,7 +575,11 @@ lldb::SBProcess SBTarget::AttachToProcessWithName(
const char *name, // basename of process to attach to
bool wait_for, // if true wait for a new instance of "name" to be launched
SBError &error // An error explaining what went wrong if attach fails
- ) {
+) {
+ LLDB_RECORD_METHOD(lldb::SBProcess, SBTarget, AttachToProcessWithName,
+ (lldb::SBListener &, const char *, bool, lldb::SBError &),
+ listener, name, wait_for, error);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBProcess sb_process;
@@ -531,12 +607,17 @@ lldb::SBProcess SBTarget::AttachToProcessWithName(
log->Printf("SBTarget(%p)::%s (...) => SBProcess(%p)",
static_cast<void *>(target_sp.get()), __FUNCTION__,
static_cast<void *>(sb_process.GetSP().get()));
- return sb_process;
+ return LLDB_RECORD_RESULT(sb_process);
}
lldb::SBProcess SBTarget::ConnectRemote(SBListener &listener, const char *url,
const char *plugin_name,
SBError &error) {
+ LLDB_RECORD_METHOD(
+ lldb::SBProcess, SBTarget, ConnectRemote,
+ (lldb::SBListener &, const char *, const char *, lldb::SBError &),
+ listener, url, plugin_name, error);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBProcess sb_process;
@@ -571,10 +652,11 @@ lldb::SBProcess SBTarget::ConnectRemote(SBListener &listener, const char *url,
log->Printf("SBTarget(%p)::ConnectRemote (...) => SBProcess(%p)",
static_cast<void *>(target_sp.get()),
static_cast<void *>(process_sp.get()));
- return sb_process;
+ return LLDB_RECORD_RESULT(sb_process);
}
SBFileSpec SBTarget::GetExecutable() {
+ LLDB_RECORD_METHOD_NO_ARGS(lldb::SBFileSpec, SBTarget, GetExecutable);
SBFileSpec exe_file_spec;
TargetSP target_sp(GetSP());
@@ -591,14 +673,20 @@ SBFileSpec SBTarget::GetExecutable() {
static_cast<const void *>(exe_file_spec.get()));
}
- return exe_file_spec;
+ return LLDB_RECORD_RESULT(exe_file_spec);
}
bool SBTarget::operator==(const SBTarget &rhs) const {
+ LLDB_RECORD_METHOD_CONST(bool, SBTarget, operator==,(const lldb::SBTarget &),
+ rhs);
+
return m_opaque_sp.get() == rhs.m_opaque_sp.get();
}
bool SBTarget::operator!=(const SBTarget &rhs) const {
+ LLDB_RECORD_METHOD_CONST(bool, SBTarget, operator!=,(const lldb::SBTarget &),
+ rhs);
+
return m_opaque_sp.get() != rhs.m_opaque_sp.get();
}
@@ -609,55 +697,68 @@ void SBTarget::SetSP(const lldb::TargetSP &target_sp) {
}
lldb::SBAddress SBTarget::ResolveLoadAddress(lldb::addr_t vm_addr) {
+ LLDB_RECORD_METHOD(lldb::SBAddress, SBTarget, ResolveLoadAddress,
+ (lldb::addr_t), vm_addr);
+
lldb::SBAddress sb_addr;
Address &addr = sb_addr.ref();
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
if (target_sp->ResolveLoadAddress(vm_addr, addr))
- return sb_addr;
+ return LLDB_RECORD_RESULT(sb_addr);
}
// We have a load address that isn't in a section, just return an address
// with the offset filled in (the address) and the section set to NULL
addr.SetRawAddress(vm_addr);
- return sb_addr;
+ return LLDB_RECORD_RESULT(sb_addr);
}
lldb::SBAddress SBTarget::ResolveFileAddress(lldb::addr_t file_addr) {
+ LLDB_RECORD_METHOD(lldb::SBAddress, SBTarget, ResolveFileAddress,
+ (lldb::addr_t), file_addr);
+
lldb::SBAddress sb_addr;
Address &addr = sb_addr.ref();
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
if (target_sp->ResolveFileAddress(file_addr, addr))
- return sb_addr;
+ return LLDB_RECORD_RESULT(sb_addr);
}
addr.SetRawAddress(file_addr);
- return sb_addr;
+ return LLDB_RECORD_RESULT(sb_addr);
}
lldb::SBAddress SBTarget::ResolvePastLoadAddress(uint32_t stop_id,
lldb::addr_t vm_addr) {
+ LLDB_RECORD_METHOD(lldb::SBAddress, SBTarget, ResolvePastLoadAddress,
+ (uint32_t, lldb::addr_t), stop_id, vm_addr);
+
lldb::SBAddress sb_addr;
Address &addr = sb_addr.ref();
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
if (target_sp->ResolveLoadAddress(vm_addr, addr))
- return sb_addr;
+ return LLDB_RECORD_RESULT(sb_addr);
}
// We have a load address that isn't in a section, just return an address
// with the offset filled in (the address) and the section set to NULL
addr.SetRawAddress(vm_addr);
- return sb_addr;
+ return LLDB_RECORD_RESULT(sb_addr);
}
SBSymbolContext
SBTarget::ResolveSymbolContextForAddress(const SBAddress &addr,
uint32_t resolve_scope) {
+ LLDB_RECORD_METHOD(lldb::SBSymbolContext, SBTarget,
+ ResolveSymbolContextForAddress,
+ (const lldb::SBAddress &, uint32_t), addr, resolve_scope);
+
SBSymbolContext sc;
SymbolContextItem scope = static_cast<SymbolContextItem>(resolve_scope);
if (addr.IsValid()) {
@@ -666,7 +767,7 @@ SBTarget::ResolveSymbolContextForAddress(const SBAddress &addr,
target_sp->GetImages().ResolveSymbolContextForAddress(addr.ref(), scope,
sc.ref());
}
- return sc;
+ return LLDB_RECORD_RESULT(sc);
}
size_t SBTarget::ReadMemory(const SBAddress addr, void *buf, size_t size,
@@ -687,34 +788,55 @@ size_t SBTarget::ReadMemory(const SBAddress addr, void *buf, size_t size,
SBBreakpoint SBTarget::BreakpointCreateByLocation(const char *file,
uint32_t line) {
- return SBBreakpoint(
- BreakpointCreateByLocation(SBFileSpec(file, false), line));
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByLocation,
+ (const char *, uint32_t), file, line);
+
+ return LLDB_RECORD_RESULT(
+ SBBreakpoint(BreakpointCreateByLocation(SBFileSpec(file, false), line)));
}
SBBreakpoint
SBTarget::BreakpointCreateByLocation(const SBFileSpec &sb_file_spec,
uint32_t line) {
- return BreakpointCreateByLocation(sb_file_spec, line, 0);
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByLocation,
+ (const lldb::SBFileSpec &, uint32_t), sb_file_spec, line);
+
+ return LLDB_RECORD_RESULT(BreakpointCreateByLocation(sb_file_spec, line, 0));
}
SBBreakpoint
SBTarget::BreakpointCreateByLocation(const SBFileSpec &sb_file_spec,
uint32_t line, lldb::addr_t offset) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByLocation,
+ (const lldb::SBFileSpec &, uint32_t, lldb::addr_t),
+ sb_file_spec, line, offset);
+
SBFileSpecList empty_list;
- return BreakpointCreateByLocation(sb_file_spec, line, offset, empty_list);
+ return LLDB_RECORD_RESULT(
+ BreakpointCreateByLocation(sb_file_spec, line, offset, empty_list));
}
SBBreakpoint
SBTarget::BreakpointCreateByLocation(const SBFileSpec &sb_file_spec,
uint32_t line, lldb::addr_t offset,
SBFileSpecList &sb_module_list) {
- return BreakpointCreateByLocation(sb_file_spec, line, 0, offset,
- sb_module_list);
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByLocation,
+ (const lldb::SBFileSpec &, uint32_t, lldb::addr_t,
+ lldb::SBFileSpecList &),
+ sb_file_spec, line, offset, sb_module_list);
+
+ return LLDB_RECORD_RESULT(BreakpointCreateByLocation(sb_file_spec, line, 0,
+ offset, sb_module_list));
}
SBBreakpoint SBTarget::BreakpointCreateByLocation(
const SBFileSpec &sb_file_spec, uint32_t line, uint32_t column,
lldb::addr_t offset, SBFileSpecList &sb_module_list) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByLocation,
+ (const lldb::SBFileSpec &, uint32_t, uint32_t,
+ lldb::addr_t, lldb::SBFileSpecList &),
+ sb_file_spec, line, column, offset, sb_module_list);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBreakpoint sb_bp;
@@ -747,11 +869,14 @@ SBBreakpoint SBTarget::BreakpointCreateByLocation(
static_cast<void *>(sb_bp.GetSP().get()), sstr.GetData());
}
- return sb_bp;
+ return LLDB_RECORD_RESULT(sb_bp);
}
SBBreakpoint SBTarget::BreakpointCreateByName(const char *symbol_name,
const char *module_name) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByName,
+ (const char *, const char *), symbol_name, module_name);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBreakpoint sb_bp;
@@ -782,31 +907,48 @@ SBBreakpoint SBTarget::BreakpointCreateByName(const char *symbol_name,
static_cast<void *>(target_sp.get()), symbol_name, module_name,
static_cast<void *>(sb_bp.GetSP().get()));
- return sb_bp;
+ return LLDB_RECORD_RESULT(sb_bp);
}
lldb::SBBreakpoint
SBTarget::BreakpointCreateByName(const char *symbol_name,
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByName,
+ (const char *, const lldb::SBFileSpecList &,
+ const lldb::SBFileSpecList &),
+ symbol_name, module_list, comp_unit_list);
+
lldb::FunctionNameType name_type_mask = eFunctionNameTypeAuto;
- return BreakpointCreateByName(symbol_name, name_type_mask,
- eLanguageTypeUnknown, module_list,
- comp_unit_list);
+ return LLDB_RECORD_RESULT(
+ BreakpointCreateByName(symbol_name, name_type_mask, eLanguageTypeUnknown,
+ module_list, comp_unit_list));
}
lldb::SBBreakpoint SBTarget::BreakpointCreateByName(
const char *symbol_name, uint32_t name_type_mask,
const SBFileSpecList &module_list, const SBFileSpecList &comp_unit_list) {
- return BreakpointCreateByName(symbol_name, name_type_mask,
- eLanguageTypeUnknown, module_list,
- comp_unit_list);
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByName,
+ (const char *, uint32_t, const lldb::SBFileSpecList &,
+ const lldb::SBFileSpecList &),
+ symbol_name, name_type_mask, module_list, comp_unit_list);
+
+ return LLDB_RECORD_RESULT(
+ BreakpointCreateByName(symbol_name, name_type_mask, eLanguageTypeUnknown,
+ module_list, comp_unit_list));
}
lldb::SBBreakpoint SBTarget::BreakpointCreateByName(
const char *symbol_name, uint32_t name_type_mask,
LanguageType symbol_language, const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByName,
+ (const char *, uint32_t, lldb::LanguageType,
+ const lldb::SBFileSpecList &,
+ const lldb::SBFileSpecList &),
+ symbol_name, name_type_mask, symbol_language, module_list,
+ comp_unit_list);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBreakpoint sb_bp;
@@ -828,30 +970,50 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateByName(
static_cast<void *>(target_sp.get()), symbol_name,
name_type_mask, static_cast<void *>(sb_bp.GetSP().get()));
- return sb_bp;
+ return LLDB_RECORD_RESULT(sb_bp);
}
lldb::SBBreakpoint SBTarget::BreakpointCreateByNames(
const char *symbol_names[], uint32_t num_names, uint32_t name_type_mask,
const SBFileSpecList &module_list, const SBFileSpecList &comp_unit_list) {
- return BreakpointCreateByNames(symbol_names, num_names, name_type_mask,
- eLanguageTypeUnknown, module_list,
- comp_unit_list);
+ LLDB_RECORD_METHOD(
+ lldb::SBBreakpoint, SBTarget, BreakpointCreateByNames,
+ (const char **, uint32_t, uint32_t, const lldb::SBFileSpecList &,
+ const lldb::SBFileSpecList &),
+ symbol_names, num_names, name_type_mask, module_list, comp_unit_list);
+
+ return LLDB_RECORD_RESULT(BreakpointCreateByNames(
+ symbol_names, num_names, name_type_mask, eLanguageTypeUnknown,
+ module_list, comp_unit_list));
}
lldb::SBBreakpoint SBTarget::BreakpointCreateByNames(
const char *symbol_names[], uint32_t num_names, uint32_t name_type_mask,
LanguageType symbol_language, const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list) {
- return BreakpointCreateByNames(symbol_names, num_names, name_type_mask,
- eLanguageTypeUnknown, 0, module_list,
- comp_unit_list);
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByNames,
+ (const char **, uint32_t, uint32_t, lldb::LanguageType,
+ const lldb::SBFileSpecList &,
+ const lldb::SBFileSpecList &),
+ symbol_names, num_names, name_type_mask, symbol_language,
+ module_list, comp_unit_list);
+
+ return LLDB_RECORD_RESULT(BreakpointCreateByNames(
+ symbol_names, num_names, name_type_mask, eLanguageTypeUnknown, 0,
+ module_list, comp_unit_list));
}
lldb::SBBreakpoint SBTarget::BreakpointCreateByNames(
const char *symbol_names[], uint32_t num_names, uint32_t name_type_mask,
LanguageType symbol_language, lldb::addr_t offset,
const SBFileSpecList &module_list, const SBFileSpecList &comp_unit_list) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByNames,
+ (const char **, uint32_t, uint32_t, lldb::LanguageType,
+ lldb::addr_t, const lldb::SBFileSpecList &,
+ const lldb::SBFileSpecList &),
+ symbol_names, num_names, name_type_mask, symbol_language,
+ offset, module_list, comp_unit_list);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBreakpoint sb_bp;
@@ -885,31 +1047,47 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateByNames(
static_cast<void *>(sb_bp.GetSP().get()));
}
- return sb_bp;
+ return LLDB_RECORD_RESULT(sb_bp);
}
SBBreakpoint SBTarget::BreakpointCreateByRegex(const char *symbol_name_regex,
const char *module_name) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByRegex,
+ (const char *, const char *), symbol_name_regex,
+ module_name);
+
SBFileSpecList module_spec_list;
SBFileSpecList comp_unit_list;
if (module_name && module_name[0]) {
module_spec_list.Append(FileSpec(module_name));
}
- return BreakpointCreateByRegex(symbol_name_regex, eLanguageTypeUnknown,
- module_spec_list, comp_unit_list);
+ return LLDB_RECORD_RESULT(
+ BreakpointCreateByRegex(symbol_name_regex, eLanguageTypeUnknown,
+ module_spec_list, comp_unit_list));
}
lldb::SBBreakpoint
SBTarget::BreakpointCreateByRegex(const char *symbol_name_regex,
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list) {
- return BreakpointCreateByRegex(symbol_name_regex, eLanguageTypeUnknown,
- module_list, comp_unit_list);
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByRegex,
+ (const char *, const lldb::SBFileSpecList &,
+ const lldb::SBFileSpecList &),
+ symbol_name_regex, module_list, comp_unit_list);
+
+ return LLDB_RECORD_RESULT(BreakpointCreateByRegex(
+ symbol_name_regex, eLanguageTypeUnknown, module_list, comp_unit_list));
}
lldb::SBBreakpoint SBTarget::BreakpointCreateByRegex(
const char *symbol_name_regex, LanguageType symbol_language,
const SBFileSpecList &module_list, const SBFileSpecList &comp_unit_list) {
+ LLDB_RECORD_METHOD(
+ lldb::SBBreakpoint, SBTarget, BreakpointCreateByRegex,
+ (const char *, lldb::LanguageType, const lldb::SBFileSpecList &,
+ const lldb::SBFileSpecList &),
+ symbol_name_regex, symbol_language, module_list, comp_unit_list);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBreakpoint sb_bp;
@@ -932,10 +1110,13 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateByRegex(
static_cast<void *>(target_sp.get()), symbol_name_regex,
static_cast<void *>(sb_bp.GetSP().get()));
- return sb_bp;
+ return LLDB_RECORD_RESULT(sb_bp);
}
SBBreakpoint SBTarget::BreakpointCreateByAddress(addr_t address) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByAddress,
+ (lldb::addr_t), address);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBreakpoint sb_bp;
@@ -953,10 +1134,13 @@ SBBreakpoint SBTarget::BreakpointCreateByAddress(addr_t address) {
static_cast<uint64_t>(address),
static_cast<void *>(sb_bp.GetSP().get()));
- return sb_bp;
+ return LLDB_RECORD_RESULT(sb_bp);
}
SBBreakpoint SBTarget::BreakpointCreateBySBAddress(SBAddress &sb_address) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateBySBAddress,
+ (lldb::SBAddress &), sb_address);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBreakpoint sb_bp;
@@ -966,7 +1150,7 @@ SBBreakpoint SBTarget::BreakpointCreateBySBAddress(SBAddress &sb_address) {
log->Printf("SBTarget(%p)::BreakpointCreateBySBAddress called with "
"invalid address",
static_cast<void *>(target_sp.get()));
- return sb_bp;
+ return LLDB_RECORD_RESULT(sb_bp);
}
if (target_sp) {
@@ -984,13 +1168,18 @@ SBBreakpoint SBTarget::BreakpointCreateBySBAddress(SBAddress &sb_address) {
static_cast<void *>(sb_bp.GetSP().get()));
}
- return sb_bp;
+ return LLDB_RECORD_RESULT(sb_bp);
}
lldb::SBBreakpoint
SBTarget::BreakpointCreateBySourceRegex(const char *source_regex,
const lldb::SBFileSpec &source_file,
const char *module_name) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget,
+ BreakpointCreateBySourceRegex,
+ (const char *, const lldb::SBFileSpec &, const char *),
+ source_regex, source_file, module_name);
+
SBFileSpecList module_spec_list;
if (module_name && module_name[0]) {
@@ -1002,21 +1191,33 @@ SBTarget::BreakpointCreateBySourceRegex(const char *source_regex,
source_file_list.Append(source_file);
}
- return BreakpointCreateBySourceRegex(source_regex, module_spec_list,
- source_file_list);
+ return LLDB_RECORD_RESULT(BreakpointCreateBySourceRegex(
+ source_regex, module_spec_list, source_file_list));
}
lldb::SBBreakpoint SBTarget::BreakpointCreateBySourceRegex(
const char *source_regex, const SBFileSpecList &module_list,
const lldb::SBFileSpecList &source_file_list) {
- return BreakpointCreateBySourceRegex(source_regex, module_list,
- source_file_list, SBStringList());
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget,
+ BreakpointCreateBySourceRegex,
+ (const char *, const lldb::SBFileSpecList &,
+ const lldb::SBFileSpecList &),
+ source_regex, module_list, source_file_list);
+
+ return LLDB_RECORD_RESULT(BreakpointCreateBySourceRegex(
+ source_regex, module_list, source_file_list, SBStringList()));
}
lldb::SBBreakpoint SBTarget::BreakpointCreateBySourceRegex(
const char *source_regex, const SBFileSpecList &module_list,
const lldb::SBFileSpecList &source_file_list,
const SBStringList &func_names) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget,
+ BreakpointCreateBySourceRegex,
+ (const char *, const lldb::SBFileSpecList &,
+ const lldb::SBFileSpecList &, const lldb::SBStringList &),
+ source_regex, module_list, source_file_list, func_names);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBreakpoint sb_bp;
@@ -1042,12 +1243,16 @@ lldb::SBBreakpoint SBTarget::BreakpointCreateBySourceRegex(
static_cast<void *>(target_sp.get()), source_regex,
static_cast<void *>(sb_bp.GetSP().get()));
- return sb_bp;
+ return LLDB_RECORD_RESULT(sb_bp);
}
lldb::SBBreakpoint
SBTarget::BreakpointCreateForException(lldb::LanguageType language,
bool catch_bp, bool throw_bp) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateForException,
+ (lldb::LanguageType, bool, bool), language, catch_bp,
+ throw_bp);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBreakpoint sb_bp;
@@ -1067,16 +1272,19 @@ SBTarget::BreakpointCreateForException(lldb::LanguageType language,
catch_bp ? "on" : "off", throw_bp ? "on" : "off",
static_cast<void *>(sb_bp.GetSP().get()));
- return sb_bp;
+ return LLDB_RECORD_RESULT(sb_bp);
}
-lldb::SBBreakpoint
-SBTarget::BreakpointCreateFromScript(const char *class_name,
- SBStructuredData &extra_args,
- const SBFileSpecList &module_list,
- const SBFileSpecList &file_list,
- bool request_hardware)
-{
+lldb::SBBreakpoint SBTarget::BreakpointCreateFromScript(
+ const char *class_name, SBStructuredData &extra_args,
+ const SBFileSpecList &module_list, const SBFileSpecList &file_list,
+ bool request_hardware) {
+ LLDB_RECORD_METHOD(
+ lldb::SBBreakpoint, SBTarget, BreakpointCreateFromScript,
+ (const char *, lldb::SBStructuredData &, const lldb::SBFileSpecList &,
+ const lldb::SBFileSpecList &, bool),
+ class_name, extra_args, module_list, file_list, request_hardware);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBreakpoint sb_bp;
@@ -1102,11 +1310,12 @@ SBTarget::BreakpointCreateFromScript(const char *class_name,
class_name,
static_cast<void *>(sb_bp.GetSP().get()));
- return sb_bp;
+ return LLDB_RECORD_RESULT(sb_bp);
}
-
uint32_t SBTarget::GetNumBreakpoints() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBTarget, GetNumBreakpoints);
+
TargetSP target_sp(GetSP());
if (target_sp) {
// The breakpoint list is thread safe, no need to lock
@@ -1116,16 +1325,22 @@ uint32_t SBTarget::GetNumBreakpoints() const {
}
SBBreakpoint SBTarget::GetBreakpointAtIndex(uint32_t idx) const {
+ LLDB_RECORD_METHOD_CONST(lldb::SBBreakpoint, SBTarget, GetBreakpointAtIndex,
+ (uint32_t), idx);
+
SBBreakpoint sb_breakpoint;
TargetSP target_sp(GetSP());
if (target_sp) {
// The breakpoint list is thread safe, no need to lock
sb_breakpoint = target_sp->GetBreakpointList().GetBreakpointAtIndex(idx);
}
- return sb_breakpoint;
+ return LLDB_RECORD_RESULT(sb_breakpoint);
}
bool SBTarget::BreakpointDelete(break_id_t bp_id) {
+ LLDB_RECORD_METHOD(bool, SBTarget, BreakpointDelete, (lldb::break_id_t),
+ bp_id);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool result = false;
@@ -1144,6 +1359,9 @@ bool SBTarget::BreakpointDelete(break_id_t bp_id) {
}
SBBreakpoint SBTarget::FindBreakpointByID(break_id_t bp_id) {
+ LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, FindBreakpointByID,
+ (lldb::break_id_t), bp_id);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBreakpoint sb_breakpoint;
@@ -1159,11 +1377,14 @@ SBBreakpoint SBTarget::FindBreakpointByID(break_id_t bp_id) {
static_cast<void *>(target_sp.get()), static_cast<uint32_t>(bp_id),
static_cast<void *>(sb_breakpoint.GetSP().get()));
- return sb_breakpoint;
+ return LLDB_RECORD_RESULT(sb_breakpoint);
}
bool SBTarget::FindBreakpointsByName(const char *name,
SBBreakpointList &bkpts) {
+ LLDB_RECORD_METHOD(bool, SBTarget, FindBreakpointsByName,
+ (const char *, lldb::SBBreakpointList &), name, bkpts);
+
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
@@ -1179,8 +1400,10 @@ bool SBTarget::FindBreakpointsByName(const char *name,
return true;
}
-void SBTarget::GetBreakpointNames(SBStringList &names)
-{
+void SBTarget::GetBreakpointNames(SBStringList &names) {
+ LLDB_RECORD_METHOD(void, SBTarget, GetBreakpointNames, (lldb::SBStringList &),
+ names);
+
names.Clear();
TargetSP target_sp(GetSP());
@@ -1194,8 +1417,10 @@ void SBTarget::GetBreakpointNames(SBStringList &names)
}
}
-void SBTarget::DeleteBreakpointName(const char *name)
-{
+void SBTarget::DeleteBreakpointName(const char *name) {
+ LLDB_RECORD_METHOD(void, SBTarget, DeleteBreakpointName, (const char *),
+ name);
+
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
@@ -1204,6 +1429,8 @@ void SBTarget::DeleteBreakpointName(const char *name)
}
bool SBTarget::EnableAllBreakpoints() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBTarget, EnableAllBreakpoints);
+
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
@@ -1214,6 +1441,8 @@ bool SBTarget::EnableAllBreakpoints() {
}
bool SBTarget::DisableAllBreakpoints() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBTarget, DisableAllBreakpoints);
+
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
@@ -1224,6 +1453,8 @@ bool SBTarget::DisableAllBreakpoints() {
}
bool SBTarget::DeleteAllBreakpoints() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBTarget, DeleteAllBreakpoints);
+
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
@@ -1235,19 +1466,29 @@ bool SBTarget::DeleteAllBreakpoints() {
lldb::SBError SBTarget::BreakpointsCreateFromFile(SBFileSpec &source_file,
SBBreakpointList &new_bps) {
+ LLDB_RECORD_METHOD(lldb::SBError, SBTarget, BreakpointsCreateFromFile,
+ (lldb::SBFileSpec &, lldb::SBBreakpointList &),
+ source_file, new_bps);
+
SBStringList empty_name_list;
- return BreakpointsCreateFromFile(source_file, empty_name_list, new_bps);
+ return LLDB_RECORD_RESULT(
+ BreakpointsCreateFromFile(source_file, empty_name_list, new_bps));
}
lldb::SBError SBTarget::BreakpointsCreateFromFile(SBFileSpec &source_file,
SBStringList &matching_names,
SBBreakpointList &new_bps) {
+ LLDB_RECORD_METHOD(
+ lldb::SBError, SBTarget, BreakpointsCreateFromFile,
+ (lldb::SBFileSpec &, lldb::SBStringList &, lldb::SBBreakpointList &),
+ source_file, matching_names, new_bps);
+
SBError sberr;
TargetSP target_sp(GetSP());
if (!target_sp) {
sberr.SetErrorString(
"BreakpointCreateFromFile called with invalid target.");
- return sberr;
+ return LLDB_RECORD_RESULT(sberr);
}
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
@@ -1261,35 +1502,42 @@ lldb::SBError SBTarget::BreakpointsCreateFromFile(SBFileSpec &source_file,
sberr.ref() = target_sp->CreateBreakpointsFromFile(source_file.ref(),
name_vector, bp_ids);
if (sberr.Fail())
- return sberr;
+ return LLDB_RECORD_RESULT(sberr);
size_t num_bkpts = bp_ids.GetSize();
for (size_t i = 0; i < num_bkpts; i++) {
BreakpointID bp_id = bp_ids.GetBreakpointIDAtIndex(i);
new_bps.AppendByID(bp_id.GetBreakpointID());
}
- return sberr;
+ return LLDB_RECORD_RESULT(sberr);
}
lldb::SBError SBTarget::BreakpointsWriteToFile(SBFileSpec &dest_file) {
+ LLDB_RECORD_METHOD(lldb::SBError, SBTarget, BreakpointsWriteToFile,
+ (lldb::SBFileSpec &), dest_file);
+
SBError sberr;
TargetSP target_sp(GetSP());
if (!target_sp) {
sberr.SetErrorString("BreakpointWriteToFile called with invalid target.");
- return sberr;
+ return LLDB_RECORD_RESULT(sberr);
}
SBBreakpointList bkpt_list(*this);
- return BreakpointsWriteToFile(dest_file, bkpt_list);
+ return LLDB_RECORD_RESULT(BreakpointsWriteToFile(dest_file, bkpt_list));
}
lldb::SBError SBTarget::BreakpointsWriteToFile(SBFileSpec &dest_file,
SBBreakpointList &bkpt_list,
bool append) {
+ LLDB_RECORD_METHOD(lldb::SBError, SBTarget, BreakpointsWriteToFile,
+ (lldb::SBFileSpec &, lldb::SBBreakpointList &, bool),
+ dest_file, bkpt_list, append);
+
SBError sberr;
TargetSP target_sp(GetSP());
if (!target_sp) {
sberr.SetErrorString("BreakpointWriteToFile called with invalid target.");
- return sberr;
+ return LLDB_RECORD_RESULT(sberr);
}
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
@@ -1297,10 +1545,12 @@ lldb::SBError SBTarget::BreakpointsWriteToFile(SBFileSpec &dest_file,
bkpt_list.CopyToBreakpointIDList(bp_id_list);
sberr.ref() = target_sp->SerializeBreakpointsToFile(dest_file.ref(),
bp_id_list, append);
- return sberr;
+ return LLDB_RECORD_RESULT(sberr);
}
uint32_t SBTarget::GetNumWatchpoints() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBTarget, GetNumWatchpoints);
+
TargetSP target_sp(GetSP());
if (target_sp) {
// The watchpoint list is thread safe, no need to lock
@@ -1310,16 +1560,22 @@ uint32_t SBTarget::GetNumWatchpoints() const {
}
SBWatchpoint SBTarget::GetWatchpointAtIndex(uint32_t idx) const {
+ LLDB_RECORD_METHOD_CONST(lldb::SBWatchpoint, SBTarget, GetWatchpointAtIndex,
+ (uint32_t), idx);
+
SBWatchpoint sb_watchpoint;
TargetSP target_sp(GetSP());
if (target_sp) {
// The watchpoint list is thread safe, no need to lock
sb_watchpoint.SetSP(target_sp->GetWatchpointList().GetByIndex(idx));
}
- return sb_watchpoint;
+ return LLDB_RECORD_RESULT(sb_watchpoint);
}
bool SBTarget::DeleteWatchpoint(watch_id_t wp_id) {
+ LLDB_RECORD_METHOD(bool, SBTarget, DeleteWatchpoint, (lldb::watch_id_t),
+ wp_id);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool result = false;
@@ -1340,6 +1596,9 @@ bool SBTarget::DeleteWatchpoint(watch_id_t wp_id) {
}
SBWatchpoint SBTarget::FindWatchpointByID(lldb::watch_id_t wp_id) {
+ LLDB_RECORD_METHOD(lldb::SBWatchpoint, SBTarget, FindWatchpointByID,
+ (lldb::watch_id_t), wp_id);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBWatchpoint sb_watchpoint;
@@ -1359,12 +1618,16 @@ SBWatchpoint SBTarget::FindWatchpointByID(lldb::watch_id_t wp_id) {
static_cast<void *>(target_sp.get()), static_cast<uint32_t>(wp_id),
static_cast<void *>(watchpoint_sp.get()));
- return sb_watchpoint;
+ return LLDB_RECORD_RESULT(sb_watchpoint);
}
lldb::SBWatchpoint SBTarget::WatchAddress(lldb::addr_t addr, size_t size,
bool read, bool write,
SBError &error) {
+ LLDB_RECORD_METHOD(lldb::SBWatchpoint, SBTarget, WatchAddress,
+ (lldb::addr_t, size_t, bool, bool, lldb::SBError &), addr,
+ size, read, write, error);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBWatchpoint sb_watchpoint;
@@ -1381,7 +1644,7 @@ lldb::SBWatchpoint SBTarget::WatchAddress(lldb::addr_t addr, size_t size,
if (watch_type == 0) {
error.SetErrorString(
"Can't create a watchpoint that is neither read nor write.");
- return sb_watchpoint;
+ return LLDB_RECORD_RESULT(sb_watchpoint);
}
// Target::CreateWatchpoint() is thread safe.
@@ -1401,10 +1664,12 @@ lldb::SBWatchpoint SBTarget::WatchAddress(lldb::addr_t addr, size_t size,
static_cast<uint32_t>(size),
static_cast<void *>(watchpoint_sp.get()));
- return sb_watchpoint;
+ return LLDB_RECORD_RESULT(sb_watchpoint);
}
bool SBTarget::EnableAllWatchpoints() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBTarget, EnableAllWatchpoints);
+
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
@@ -1417,6 +1682,8 @@ bool SBTarget::EnableAllWatchpoints() {
}
bool SBTarget::DisableAllWatchpoints() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBTarget, DisableAllWatchpoints);
+
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
@@ -1430,6 +1697,10 @@ bool SBTarget::DisableAllWatchpoints() {
SBValue SBTarget::CreateValueFromAddress(const char *name, SBAddress addr,
SBType type) {
+ LLDB_RECORD_METHOD(lldb::SBValue, SBTarget, CreateValueFromAddress,
+ (const char *, lldb::SBAddress, lldb::SBType), name, addr,
+ type);
+
SBValue sb_value;
lldb::ValueObjectSP new_value_sp;
if (IsValid() && name && *name && addr.IsValid() && type.IsValid()) {
@@ -1451,11 +1722,15 @@ SBValue SBTarget::CreateValueFromAddress(const char *name, SBAddress addr,
log->Printf("SBTarget(%p)::CreateValueFromAddress => NULL",
static_cast<void *>(m_opaque_sp.get()));
}
- return sb_value;
+ return LLDB_RECORD_RESULT(sb_value);
}
lldb::SBValue SBTarget::CreateValueFromData(const char *name, lldb::SBData data,
lldb::SBType type) {
+ LLDB_RECORD_METHOD(lldb::SBValue, SBTarget, CreateValueFromData,
+ (const char *, lldb::SBData, lldb::SBType), name, data,
+ type);
+
SBValue sb_value;
lldb::ValueObjectSP new_value_sp;
if (IsValid() && name && *name && data.IsValid() && type.IsValid()) {
@@ -1477,11 +1752,14 @@ lldb::SBValue SBTarget::CreateValueFromData(const char *name, lldb::SBData data,
log->Printf("SBTarget(%p)::CreateValueFromData => NULL",
static_cast<void *>(m_opaque_sp.get()));
}
- return sb_value;
+ return LLDB_RECORD_RESULT(sb_value);
}
lldb::SBValue SBTarget::CreateValueFromExpression(const char *name,
const char *expr) {
+ LLDB_RECORD_METHOD(lldb::SBValue, SBTarget, CreateValueFromExpression,
+ (const char *, const char *), name, expr);
+
SBValue sb_value;
lldb::ValueObjectSP new_value_sp;
if (IsValid() && name && *name && expr && *expr) {
@@ -1501,10 +1779,12 @@ lldb::SBValue SBTarget::CreateValueFromExpression(const char *name,
log->Printf("SBTarget(%p)::CreateValueFromExpression => NULL",
static_cast<void *>(m_opaque_sp.get()));
}
- return sb_value;
+ return LLDB_RECORD_RESULT(sb_value);
}
bool SBTarget::DeleteAllWatchpoints() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBTarget, DeleteAllWatchpoints);
+
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
@@ -1518,6 +1798,10 @@ bool SBTarget::DeleteAllWatchpoints() {
void SBTarget::AppendImageSearchPath(const char *from, const char *to,
lldb::SBError &error) {
+ LLDB_RECORD_METHOD(void, SBTarget, AppendImageSearchPath,
+ (const char *, const char *, lldb::SBError &), from, to,
+ error);
+
TargetSP target_sp(GetSP());
if (!target_sp)
return error.SetErrorString("invalid target");
@@ -1538,11 +1822,19 @@ void SBTarget::AppendImageSearchPath(const char *from, const char *to,
lldb::SBModule SBTarget::AddModule(const char *path, const char *triple,
const char *uuid_cstr) {
- return AddModule(path, triple, uuid_cstr, NULL);
+ LLDB_RECORD_METHOD(lldb::SBModule, SBTarget, AddModule,
+ (const char *, const char *, const char *), path, triple,
+ uuid_cstr);
+
+ return LLDB_RECORD_RESULT(AddModule(path, triple, uuid_cstr, NULL));
}
lldb::SBModule SBTarget::AddModule(const char *path, const char *triple,
const char *uuid_cstr, const char *symfile) {
+ LLDB_RECORD_METHOD(lldb::SBModule, SBTarget, AddModule,
+ (const char *, const char *, const char *, const char *),
+ path, triple, uuid_cstr, symfile);
+
lldb::SBModule sb_module;
TargetSP target_sp(GetSP());
if (target_sp) {
@@ -1564,18 +1856,23 @@ lldb::SBModule SBTarget::AddModule(const char *path, const char *triple,
sb_module.SetSP(target_sp->GetSharedModule(module_spec));
}
- return sb_module;
+ return LLDB_RECORD_RESULT(sb_module);
}
lldb::SBModule SBTarget::AddModule(const SBModuleSpec &module_spec) {
+ LLDB_RECORD_METHOD(lldb::SBModule, SBTarget, AddModule,
+ (const lldb::SBModuleSpec &), module_spec);
+
lldb::SBModule sb_module;
TargetSP target_sp(GetSP());
if (target_sp)
sb_module.SetSP(target_sp->GetSharedModule(*module_spec.m_opaque_up));
- return sb_module;
+ return LLDB_RECORD_RESULT(sb_module);
}
bool SBTarget::AddModule(lldb::SBModule &module) {
+ LLDB_RECORD_METHOD(bool, SBTarget, AddModule, (lldb::SBModule &), module);
+
TargetSP target_sp(GetSP());
if (target_sp) {
target_sp->GetImages().AppendIfNeeded(module.GetSP());
@@ -1585,6 +1882,8 @@ bool SBTarget::AddModule(lldb::SBModule &module) {
}
uint32_t SBTarget::GetNumModules() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBTarget, GetNumModules);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint32_t num = 0;
@@ -1602,6 +1901,8 @@ uint32_t SBTarget::GetNumModules() const {
}
void SBTarget::Clear() {
+ LLDB_RECORD_METHOD_NO_ARGS(void, SBTarget, Clear);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (log)
@@ -1612,6 +1913,9 @@ void SBTarget::Clear() {
}
SBModule SBTarget::FindModule(const SBFileSpec &sb_file_spec) {
+ LLDB_RECORD_METHOD(lldb::SBModule, SBTarget, FindModule,
+ (const lldb::SBFileSpec &), sb_file_spec);
+
SBModule sb_module;
TargetSP target_sp(GetSP());
if (target_sp && sb_file_spec.IsValid()) {
@@ -1619,11 +1923,13 @@ SBModule SBTarget::FindModule(const SBFileSpec &sb_file_spec) {
// The module list is thread safe, no need to lock
sb_module.SetSP(target_sp->GetImages().FindFirstModule(module_spec));
}
- return sb_module;
+ return LLDB_RECORD_RESULT(sb_module);
}
-SBSymbolContextList
-SBTarget::FindCompileUnits(const SBFileSpec &sb_file_spec) {
+SBSymbolContextList SBTarget::FindCompileUnits(const SBFileSpec &sb_file_spec) {
+ LLDB_RECORD_METHOD(lldb::SBSymbolContextList, SBTarget, FindCompileUnits,
+ (const lldb::SBFileSpec &), sb_file_spec);
+
SBSymbolContextList sb_sc_list;
const TargetSP target_sp(GetSP());
if (target_sp && sb_file_spec.IsValid()) {
@@ -1631,10 +1937,12 @@ SBTarget::FindCompileUnits(const SBFileSpec &sb_file_spec) {
target_sp->GetImages().FindCompileUnits(*sb_file_spec,
append, *sb_sc_list);
}
- return sb_sc_list;
+ return LLDB_RECORD_RESULT(sb_sc_list);
}
lldb::ByteOrder SBTarget::GetByteOrder() {
+ LLDB_RECORD_METHOD_NO_ARGS(lldb::ByteOrder, SBTarget, GetByteOrder);
+
TargetSP target_sp(GetSP());
if (target_sp)
return target_sp->GetArchitecture().GetByteOrder();
@@ -1642,6 +1950,8 @@ lldb::ByteOrder SBTarget::GetByteOrder() {
}
const char *SBTarget::GetTriple() {
+ LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTarget, GetTriple);
+
TargetSP target_sp(GetSP());
if (target_sp) {
std::string triple(target_sp->GetArchitecture().GetTriple().str());
@@ -1655,6 +1965,8 @@ const char *SBTarget::GetTriple() {
}
uint32_t SBTarget::GetDataByteSize() {
+ LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBTarget, GetDataByteSize);
+
TargetSP target_sp(GetSP());
if (target_sp) {
return target_sp->GetArchitecture().GetDataByteSize();
@@ -1663,6 +1975,8 @@ uint32_t SBTarget::GetDataByteSize() {
}
uint32_t SBTarget::GetCodeByteSize() {
+ LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBTarget, GetCodeByteSize);
+
TargetSP target_sp(GetSP());
if (target_sp) {
return target_sp->GetArchitecture().GetCodeByteSize();
@@ -1671,6 +1985,8 @@ uint32_t SBTarget::GetCodeByteSize() {
}
uint32_t SBTarget::GetAddressByteSize() {
+ LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBTarget, GetAddressByteSize);
+
TargetSP target_sp(GetSP());
if (target_sp)
return target_sp->GetArchitecture().GetAddressByteSize();
@@ -1678,6 +1994,9 @@ uint32_t SBTarget::GetAddressByteSize() {
}
SBModule SBTarget::GetModuleAtIndex(uint32_t idx) {
+ LLDB_RECORD_METHOD(lldb::SBModule, SBTarget, GetModuleAtIndex, (uint32_t),
+ idx);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBModule sb_module;
@@ -1694,10 +2013,12 @@ SBModule SBTarget::GetModuleAtIndex(uint32_t idx) {
static_cast<void *>(target_sp.get()), idx,
static_cast<void *>(module_sp.get()));
- return sb_module;
+ return LLDB_RECORD_RESULT(sb_module);
}
bool SBTarget::RemoveModule(lldb::SBModule module) {
+ LLDB_RECORD_METHOD(bool, SBTarget, RemoveModule, (lldb::SBModule), module);
+
TargetSP target_sp(GetSP());
if (target_sp)
return target_sp->GetImages().Remove(module.GetSP());
@@ -1705,6 +2026,9 @@ bool SBTarget::RemoveModule(lldb::SBModule module) {
}
SBBroadcaster SBTarget::GetBroadcaster() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBBroadcaster, SBTarget,
+ GetBroadcaster);
+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
TargetSP target_sp(GetSP());
@@ -1715,11 +2039,15 @@ SBBroadcaster SBTarget::GetBroadcaster() const {
static_cast<void *>(target_sp.get()),
static_cast<void *>(broadcaster.get()));
- return broadcaster;
+ return LLDB_RECORD_RESULT(broadcaster);
}
bool SBTarget::GetDescription(SBStream &description,
lldb::DescriptionLevel description_level) {
+ LLDB_RECORD_METHOD(bool, SBTarget, GetDescription,
+ (lldb::SBStream &, lldb::DescriptionLevel), description,
+ description_level);
+
Stream &strm = description.ref();
TargetSP target_sp(GetSP());
@@ -1733,13 +2061,16 @@ bool SBTarget::GetDescription(SBStream &description,
lldb::SBSymbolContextList SBTarget::FindFunctions(const char *name,
uint32_t name_type_mask) {
+ LLDB_RECORD_METHOD(lldb::SBSymbolContextList, SBTarget, FindFunctions,
+ (const char *, uint32_t), name, name_type_mask);
+
lldb::SBSymbolContextList sb_sc_list;
if (!name | !name[0])
- return sb_sc_list;
+ return LLDB_RECORD_RESULT(sb_sc_list);
TargetSP target_sp(GetSP());
if (!target_sp)
- return sb_sc_list;
+ return LLDB_RECORD_RESULT(sb_sc_list);
const bool symbols_ok = true;
const bool inlines_ok = true;
@@ -1747,12 +2078,16 @@ lldb::SBSymbolContextList SBTarget::FindFunctions(const char *name,
FunctionNameType mask = static_cast<FunctionNameType>(name_type_mask);
target_sp->GetImages().FindFunctions(ConstString(name), mask, symbols_ok,
inlines_ok, append, *sb_sc_list);
- return sb_sc_list;
+ return LLDB_RECORD_RESULT(sb_sc_list);
}
lldb::SBSymbolContextList SBTarget::FindGlobalFunctions(const char *name,
uint32_t max_matches,
MatchType matchtype) {
+ LLDB_RECORD_METHOD(lldb::SBSymbolContextList, SBTarget, FindGlobalFunctions,
+ (const char *, uint32_t, lldb::MatchType), name,
+ max_matches, matchtype);
+
lldb::SBSymbolContextList sb_sc_list;
if (name && name[0]) {
llvm::StringRef name_ref(name);
@@ -1777,10 +2112,13 @@ lldb::SBSymbolContextList SBTarget::FindGlobalFunctions(const char *name,
}
}
}
- return sb_sc_list;
+ return LLDB_RECORD_RESULT(sb_sc_list);
}
lldb::SBType SBTarget::FindFirstType(const char *typename_cstr) {
+ LLDB_RECORD_METHOD(lldb::SBType, SBTarget, FindFirstType, (const char *),
+ typename_cstr);
+
TargetSP target_sp(GetSP());
if (typename_cstr && typename_cstr[0] && target_sp) {
ConstString const_typename(typename_cstr);
@@ -1795,7 +2133,7 @@ lldb::SBType SBTarget::FindFirstType(const char *typename_cstr) {
TypeSP type_sp(
module_sp->FindFirstType(sc, const_typename, exact_match));
if (type_sp)
- return SBType(type_sp);
+ return LLDB_RECORD_RESULT(SBType(type_sp));
}
}
@@ -1816,7 +2154,7 @@ lldb::SBType SBTarget::FindFirstType(const char *typename_cstr) {
if (objc_decl_vendor->FindDecls(const_typename, true, 1, decls) > 0) {
if (CompilerType type = ClangASTContext::GetTypeForDecl(decls[0])) {
- return SBType(type);
+ return LLDB_RECORD_RESULT(SBType(type));
}
}
}
@@ -1826,24 +2164,30 @@ lldb::SBType SBTarget::FindFirstType(const char *typename_cstr) {
// No matches, search for basic typename matches
ClangASTContext *clang_ast = target_sp->GetScratchClangASTContext();
if (clang_ast)
- return SBType(ClangASTContext::GetBasicType(clang_ast->getASTContext(),
- const_typename));
+ return LLDB_RECORD_RESULT(SBType(ClangASTContext::GetBasicType(
+ clang_ast->getASTContext(), const_typename)));
}
- return SBType();
+ return LLDB_RECORD_RESULT(SBType());
}
SBType SBTarget::GetBasicType(lldb::BasicType type) {
+ LLDB_RECORD_METHOD(lldb::SBType, SBTarget, GetBasicType, (lldb::BasicType),
+ type);
+
TargetSP target_sp(GetSP());
if (target_sp) {
ClangASTContext *clang_ast = target_sp->GetScratchClangASTContext();
if (clang_ast)
- return SBType(
- ClangASTContext::GetBasicType(clang_ast->getASTContext(), type));
+ return LLDB_RECORD_RESULT(SBType(
+ ClangASTContext::GetBasicType(clang_ast->getASTContext(), type)));
}
- return SBType();
+ return LLDB_RECORD_RESULT(SBType());
}
lldb::SBTypeList SBTarget::FindTypes(const char *typename_cstr) {
+ LLDB_RECORD_METHOD(lldb::SBTypeList, SBTarget, FindTypes, (const char *),
+ typename_cstr);
+
SBTypeList sb_type_list;
TargetSP target_sp(GetSP());
if (typename_cstr && typename_cstr[0] && target_sp) {
@@ -1897,11 +2241,14 @@ lldb::SBTypeList SBTarget::FindTypes(const char *typename_cstr) {
clang_ast->getASTContext(), const_typename)));
}
}
- return sb_type_list;
+ return LLDB_RECORD_RESULT(sb_type_list);
}
SBValueList SBTarget::FindGlobalVariables(const char *name,
uint32_t max_matches) {
+ LLDB_RECORD_METHOD(lldb::SBValueList, SBTarget, FindGlobalVariables,
+ (const char *, uint32_t), name, max_matches);
+
SBValueList sb_value_list;
TargetSP target_sp(GetSP());
@@ -1923,12 +2270,16 @@ SBValueList SBTarget::FindGlobalVariables(const char *name,
}
}
- return sb_value_list;
+ return LLDB_RECORD_RESULT(sb_value_list);
}
SBValueList SBTarget::FindGlobalVariables(const char *name,
uint32_t max_matches,
MatchType matchtype) {
+ LLDB_RECORD_METHOD(lldb::SBValueList, SBTarget, FindGlobalVariables,
+ (const char *, uint32_t, lldb::MatchType), name,
+ max_matches, matchtype);
+
SBValueList sb_value_list;
TargetSP target_sp(GetSP());
@@ -1967,29 +2318,41 @@ SBValueList SBTarget::FindGlobalVariables(const char *name,
}
}
- return sb_value_list;
+ return LLDB_RECORD_RESULT(sb_value_list);
}
lldb::SBValue SBTarget::FindFirstGlobalVariable(const char *name) {
+ LLDB_RECORD_METHOD(lldb::SBValue, SBTarget, FindFirstGlobalVariable,
+ (const char *), name);
+
SBValueList sb_value_list(FindGlobalVariables(name, 1));
if (sb_value_list.IsValid() && sb_value_list.GetSize() > 0)
- return sb_value_list.GetValueAtIndex(0);
- return SBValue();
+ return LLDB_RECORD_RESULT(sb_value_list.GetValueAtIndex(0));
+ return LLDB_RECORD_RESULT(SBValue());
}
SBSourceManager SBTarget::GetSourceManager() {
+ LLDB_RECORD_METHOD_NO_ARGS(lldb::SBSourceManager, SBTarget, GetSourceManager);
+
SBSourceManager source_manager(*this);
- return source_manager;
+ return LLDB_RECORD_RESULT(source_manager);
}
lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
uint32_t count) {
- return ReadInstructions(base_addr, count, NULL);
+ LLDB_RECORD_METHOD(lldb::SBInstructionList, SBTarget, ReadInstructions,
+ (lldb::SBAddress, uint32_t), base_addr, count);
+
+ return LLDB_RECORD_RESULT(ReadInstructions(base_addr, count, NULL));
}
lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
uint32_t count,
const char *flavor_string) {
+ LLDB_RECORD_METHOD(lldb::SBInstructionList, SBTarget, ReadInstructions,
+ (lldb::SBAddress, uint32_t, const char *), base_addr,
+ count, flavor_string);
+
SBInstructionList sb_instructions;
TargetSP target_sp(GetSP());
@@ -2012,7 +2375,7 @@ lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
}
}
- return sb_instructions;
+ return LLDB_RECORD_RESULT(sb_instructions);
}
lldb::SBInstructionList SBTarget::GetInstructions(lldb::SBAddress base_addr,
@@ -2061,6 +2424,10 @@ SBTarget::GetInstructionsWithFlavor(lldb::addr_t base_addr,
SBError SBTarget::SetSectionLoadAddress(lldb::SBSection section,
lldb::addr_t section_base_addr) {
+ LLDB_RECORD_METHOD(lldb::SBError, SBTarget, SetSectionLoadAddress,
+ (lldb::SBSection, lldb::addr_t), section,
+ section_base_addr);
+
SBError sb_error;
TargetSP target_sp(GetSP());
if (target_sp) {
@@ -2091,10 +2458,13 @@ SBError SBTarget::SetSectionLoadAddress(lldb::SBSection section,
} else {
sb_error.SetErrorString("invalid target");
}
- return sb_error;
+ return LLDB_RECORD_RESULT(sb_error);
}
SBError SBTarget::ClearSectionLoadAddress(lldb::SBSection section) {
+ LLDB_RECORD_METHOD(lldb::SBError, SBTarget, ClearSectionLoadAddress,
+ (lldb::SBSection), section);
+
SBError sb_error;
TargetSP target_sp(GetSP());
@@ -2123,11 +2493,14 @@ SBError SBTarget::ClearSectionLoadAddress(lldb::SBSection section) {
} else {
sb_error.SetErrorStringWithFormat("invalid target");
}
- return sb_error;
+ return LLDB_RECORD_RESULT(sb_error);
}
SBError SBTarget::SetModuleLoadAddress(lldb::SBModule module,
int64_t slide_offset) {
+ LLDB_RECORD_METHOD(lldb::SBError, SBTarget, SetModuleLoadAddress,
+ (lldb::SBModule, int64_t), module, slide_offset);
+
SBError sb_error;
TargetSP target_sp(GetSP());
@@ -2155,10 +2528,13 @@ SBError SBTarget::SetModuleLoadAddress(lldb::SBModule module,
} else {
sb_error.SetErrorStringWithFormat("invalid target");
}
- return sb_error;
+ return LLDB_RECORD_RESULT(sb_error);
}
SBError SBTarget::ClearModuleLoadAddress(lldb::SBModule module) {
+ LLDB_RECORD_METHOD(lldb::SBError, SBTarget, ClearModuleLoadAddress,
+ (lldb::SBModule), module);
+
SBError sb_error;
char path[PATH_MAX];
@@ -2204,11 +2580,14 @@ SBError SBTarget::ClearModuleLoadAddress(lldb::SBModule module) {
} else {
sb_error.SetErrorStringWithFormat("invalid target");
}
- return sb_error;
+ return LLDB_RECORD_RESULT(sb_error);
}
lldb::SBSymbolContextList SBTarget::FindSymbols(const char *name,
lldb::SymbolType symbol_type) {
+ LLDB_RECORD_METHOD(lldb::SBSymbolContextList, SBTarget, FindSymbols,
+ (const char *, lldb::SymbolType), name, symbol_type);
+
SBSymbolContextList sb_sc_list;
if (name && name[0]) {
TargetSP target_sp(GetSP());
@@ -2218,24 +2597,31 @@ lldb::SBSymbolContextList SBTarget::FindSymbols(const char *name,
ConstString(name), symbol_type, *sb_sc_list, append);
}
}
- return sb_sc_list;
+ return LLDB_RECORD_RESULT(sb_sc_list);
}
lldb::SBValue SBTarget::EvaluateExpression(const char *expr) {
+ LLDB_RECORD_METHOD(lldb::SBValue, SBTarget, EvaluateExpression,
+ (const char *), expr);
+
TargetSP target_sp(GetSP());
if (!target_sp)
- return SBValue();
+ return LLDB_RECORD_RESULT(SBValue());
SBExpressionOptions options;
lldb::DynamicValueType fetch_dynamic_value =
target_sp->GetPreferDynamicValue();
options.SetFetchDynamicValue(fetch_dynamic_value);
options.SetUnwindOnError(true);
- return EvaluateExpression(expr, options);
+ return LLDB_RECORD_RESULT(EvaluateExpression(expr, options));
}
lldb::SBValue SBTarget::EvaluateExpression(const char *expr,
const SBExpressionOptions &options) {
+ LLDB_RECORD_METHOD(lldb::SBValue, SBTarget, EvaluateExpression,
+ (const char *, const lldb::SBExpressionOptions &), expr,
+ options);
+
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
#if !defined(LLDB_DISABLE_PYTHON)
Log *expr_log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
@@ -2250,7 +2636,7 @@ lldb::SBValue SBTarget::EvaluateExpression(const char *expr,
if (log)
log->Printf(
"SBTarget::EvaluateExpression called with an empty expression");
- return expr_result;
+ return LLDB_RECORD_RESULT(expr_result);
}
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
@@ -2296,10 +2682,12 @@ lldb::SBValue SBTarget::EvaluateExpression(const char *expr,
static_cast<void *>(expr_value_sp.get()), exe_results);
#endif
- return expr_result;
+ return LLDB_RECORD_RESULT(expr_result);
}
lldb::addr_t SBTarget::GetStackRedZoneSize() {
+ LLDB_RECORD_METHOD_NO_ARGS(lldb::addr_t, SBTarget, GetStackRedZoneSize);
+
TargetSP target_sp(GetSP());
if (target_sp) {
ABISP abi_sp;
@@ -2315,14 +2703,19 @@ lldb::addr_t SBTarget::GetStackRedZoneSize() {
}
lldb::SBLaunchInfo SBTarget::GetLaunchInfo() const {
+ LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBLaunchInfo, SBTarget, GetLaunchInfo);
+
lldb::SBLaunchInfo launch_info(NULL);
TargetSP target_sp(GetSP());
if (target_sp)
launch_info.set_ref(m_opaque_sp->GetProcessLaunchInfo());
- return launch_info;
+ return LLDB_RECORD_RESULT(launch_info);
}
void SBTarget::SetLaunchInfo(const lldb::SBLaunchInfo &launch_info) {
+ LLDB_RECORD_METHOD(void, SBTarget, SetLaunchInfo,
+ (const lldb::SBLaunchInfo &), launch_info);
+
TargetSP target_sp(GetSP());
if (target_sp)
m_opaque_sp->SetProcessLaunchInfo(launch_info.ref());
OpenPOWER on IntegriCloud