#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ErrorHandling.h"
+#include <iostream>
#include <map>
+#include <type_traits>
+
+template <typename T,
+ typename std::enable_if<std::is_fundamental<T>::value, int>::type = 0>
+void log_append(llvm::raw_string_ostream &ss, const T &t) {
+ ss << t;
+}
+
+template <typename T, typename std::enable_if<!std::is_fundamental<T>::value,
+ int>::type = 0>
+void log_append(llvm::raw_string_ostream &ss, const T &t) {
+ ss << &t;
+}
+
+template <typename T>
+void log_append(llvm::raw_string_ostream &ss, const T *t) {
+ ss << t;
+}
+
+void log_append(llvm::raw_string_ostream &ss, const char *t) { ss << t; }
+
+template <typename Head>
+void log_helper(llvm::raw_string_ostream &ss, const Head &head) {
+ log_append(ss, head);
+}
+
+template <typename Head, typename... Tail>
+void log_helper(llvm::raw_string_ostream &ss, const Head &head,
+ const Tail &... tail) {
+ log_append(ss, head);
+ ss << ", ";
+ log_helper(ss, tail...);
+}
+
+template <typename... Ts> std::string log_args(const Ts &... ts) {
+ std::string buffer;
+ llvm::raw_string_ostream ss(buffer);
+ log_helper(ss, ts...);
+ return ss.str();
+}
// Define LLDB_REPRO_INSTR_TRACE to trace to stderr instead of LLDB's log
// infrastructure. This is useful when you need to see traces before the logger
#Result, #Class, #Method, #Signature)
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature, ...) \
- LLDB_LOG(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API), "{0}", \
- LLVM_PRETTY_FUNCTION); \
+ LLDB_LOG(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API), "{0} ({1})", \
+ LLVM_PRETTY_FUNCTION, log_args(__VA_ARGS__)); \
if (lldb_private::repro::InstrumentationData data = \
LLDB_GET_INSTRUMENTATION_DATA()) { \
lldb_private::repro::Recorder sb_recorder( \
}
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature, ...) \
- LLDB_LOG(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API), "{0}", \
- LLVM_PRETTY_FUNCTION); \
+ LLDB_LOG(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API), "{0} ({1})", \
+ LLVM_PRETTY_FUNCTION, log_args(__VA_ARGS__)); \
llvm::Optional<lldb_private::repro::Recorder> sb_recorder; \
if (lldb_private::repro::InstrumentationData data = \
LLDB_GET_INSTRUMENTATION_DATA()) { \
}
#define LLDB_RECORD_METHOD_CONST(Result, Class, Method, Signature, ...) \
- LLDB_LOG(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API), "{0}", \
- LLVM_PRETTY_FUNCTION); \
+ LLDB_LOG(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API), "{0} ({1})", \
+ LLVM_PRETTY_FUNCTION, log_args(__VA_ARGS__)); \
llvm::Optional<lldb_private::repro::Recorder> sb_recorder; \
if (lldb_private::repro::InstrumentationData data = \
LLDB_GET_INSTRUMENTATION_DATA()) { \
}
#define LLDB_RECORD_STATIC_METHOD(Result, Class, Method, Signature, ...) \
- LLDB_LOG(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API), "{0}", \
- LLVM_PRETTY_FUNCTION); \
+ LLDB_LOG(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API), "{0} ({1})", \
+ LLVM_PRETTY_FUNCTION, log_args(__VA_ARGS__)); \
llvm::Optional<lldb_private::repro::Recorder> sb_recorder; \
if (lldb_private::repro::InstrumentationData data = \
LLDB_GET_INSTRUMENTATION_DATA()) { \
#include "lldb/Core/Module.h"
#include "lldb/Symbol/LineEntry.h"
#include "lldb/Target/Target.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
using namespace lldb;
LLDB_RECORD_METHOD_CONST(lldb::addr_t, SBAddress, GetLoadAddress,
(const lldb::SBTarget &), target);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
lldb::addr_t addr = LLDB_INVALID_ADDRESS;
TargetSP target_sp(target.GetSP());
if (target_sp) {
}
}
- if (log) {
- if (addr == LLDB_INVALID_ADDRESS)
- log->Printf(
- "SBAddress::GetLoadAddress (SBTarget(%p)) => LLDB_INVALID_ADDRESS",
- static_cast<void *>(target_sp.get()));
- else
- log->Printf("SBAddress::GetLoadAddress (SBTarget(%p)) => 0x%" PRIx64,
- static_cast<void *>(target_sp.get()), addr);
- }
-
return addr;
}
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
-#include "lldb/Utility/Log.h"
using namespace lldb;
using namespace lldb_private;
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadSpec.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include "SBBreakpointOptionCommon.h"
break_id_t SBBreakpoint::GetID() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::break_id_t, SBBreakpoint, GetID);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
break_id_t break_id = LLDB_INVALID_BREAK_ID;
BreakpointSP bkpt_sp = GetSP();
if (bkpt_sp)
break_id = bkpt_sp->GetID();
- LLDB_LOG(log, "breakpoint = {0}, id = {1}", bkpt_sp.get(), break_id);
return break_id;
}
void SBBreakpoint::SetEnabled(bool enable) {
LLDB_RECORD_METHOD(void, SBBreakpoint, SetEnabled, (bool), enable);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}, enable = {1}", bkpt_sp.get(), enable);
-
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
bkpt_sp->GetTarget().GetAPIMutex());
void SBBreakpoint::SetOneShot(bool one_shot) {
LLDB_RECORD_METHOD(void, SBBreakpoint, SetOneShot, (bool), one_shot);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}, one_shot = {1}", bkpt_sp.get(), one_shot);
-
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
bkpt_sp->GetTarget().GetAPIMutex());
void SBBreakpoint::SetIgnoreCount(uint32_t count) {
LLDB_RECORD_METHOD(void, SBBreakpoint, SetIgnoreCount, (uint32_t), count);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}, count = {1}", bkpt_sp.get(), count);
-
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
bkpt_sp->GetTarget().GetAPIMutex());
count = bkpt_sp->GetHitCount();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- LLDB_LOG(log, "breakpoint = {0}, count = {1}", bkpt_sp.get(), count);
-
return count;
}
count = bkpt_sp->GetIgnoreCount();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- LLDB_LOG(log, "breakpoint = {0}, count = {1}", bkpt_sp.get(), count);
-
return count;
}
bkpt_sp->GetTarget().GetAPIMutex());
bkpt_sp->SetThreadID(tid);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- LLDB_LOG(log, "breakpoint = {0}, tid = {1:x}", bkpt_sp.get(), tid);
}
tid_t SBBreakpoint::GetThreadID() {
tid = bkpt_sp->GetThreadID();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- LLDB_LOG(log, "breakpoint = {0}, tid = {1:x}", bkpt_sp.get(), tid);
return tid;
}
void SBBreakpoint::SetThreadIndex(uint32_t index) {
LLDB_RECORD_METHOD(void, SBBreakpoint, SetThreadIndex, (uint32_t), index);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}, index = {1}", bkpt_sp.get(), index);
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
bkpt_sp->GetTarget().GetAPIMutex());
if (thread_spec != nullptr)
thread_idx = thread_spec->GetIndex();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- LLDB_LOG(log, "breakpoint = {0}, index = {1}", bkpt_sp.get(), thread_idx);
return thread_idx;
}
LLDB_RECORD_METHOD(void, SBBreakpoint, SetThreadName, (const char *),
thread_name);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}, name = {1}", bkpt_sp.get(), thread_name);
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
if (thread_spec != nullptr)
name = thread_spec->GetName();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- LLDB_LOG(log, "breakpoint = {0}, name = {1}", bkpt_sp.get(), name);
return name;
}
LLDB_RECORD_METHOD(void, SBBreakpoint, SetQueueName, (const char *),
queue_name);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}, queue_name = {1}", bkpt_sp.get(),
- queue_name);
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
bkpt_sp->GetTarget().GetAPIMutex());
if (thread_spec)
name = thread_spec->GetQueueName();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- LLDB_LOG(log, "breakpoint = {0}, name = {1}", bkpt_sp.get(), name);
return name;
}
bkpt_sp->GetTarget().GetAPIMutex());
num_resolved = bkpt_sp->GetNumResolvedLocations();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- LLDB_LOG(log, "breakpoint = {0}, num_resolved = {1}", bkpt_sp.get(),
- num_resolved);
return num_resolved;
}
bkpt_sp->GetTarget().GetAPIMutex());
num_locs = bkpt_sp->GetNumLocations();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- LLDB_LOG(log, "breakpoint = {0}, num_locs = {1}", bkpt_sp.get(), num_locs);
return num_locs;
}
void SBBreakpoint
::SetCallback(SBBreakpointHitCallback callback,
void *baton) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}, callback = {1}, baton = {2}", bkpt_sp.get(),
- callback, baton);
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
LLDB_RECORD_METHOD(void, SBBreakpoint, SetScriptCallbackFunction,
(const char *), callback_function_name);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}, callback = {1}", bkpt_sp.get(),
- callback_function_name);
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
LLDB_RECORD_METHOD(lldb::SBError, SBBreakpoint, SetScriptCallbackBody,
(const char *), callback_body_text);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}, callback body:\n{1}", bkpt_sp.get(),
- callback_body_text);
SBError sb_error;
if (bkpt_sp) {
bool SBBreakpoint::AddName(const char *new_name) {
LLDB_RECORD_METHOD(bool, SBBreakpoint, AddName, (const char *), new_name);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}, name = {1}", bkpt_sp.get(), new_name);
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
// probably more annoying to have to provide it.
bkpt_sp->GetTarget().AddNameToBreakpoint(bkpt_sp, new_name, error);
if (error.Fail())
- {
- if (log)
- log->Printf("Failed to add name: '%s' to breakpoint: %s",
- new_name, error.AsCString());
return false;
- }
}
return true;
LLDB_RECORD_METHOD(void, SBBreakpoint, RemoveName, (const char *),
name_to_remove);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}, name = {1}", bkpt_sp.get(), name_to_remove);
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
bkpt_sp->GetTarget().GetAPIMutex());
- bkpt_sp->GetTarget().RemoveNameFromBreakpoint(bkpt_sp,
- ConstString(name_to_remove));
+ bkpt_sp->GetTarget().RemoveNameFromBreakpoint(bkpt_sp,
+ ConstString(name_to_remove));
}
}
bool SBBreakpoint::MatchesName(const char *name) {
LLDB_RECORD_METHOD(bool, SBBreakpoint, MatchesName, (const char *), name);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}, name = {1}", bkpt_sp.get(), name);
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
LLDB_RECORD_METHOD(void, SBBreakpoint, GetNames, (lldb::SBStringList &),
names);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointSP bkpt_sp = GetSP();
- LLDB_LOG(log, "breakpoint = {0}", bkpt_sp.get());
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
#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 "lldb/lldb-defines.h"
#include "lldb/lldb-types.h"
: m_opaque_wp(break_loc_sp) {
LLDB_RECORD_CONSTRUCTOR(SBBreakpointLocation,
(const lldb::BreakpointLocationSP &), break_loc_sp);
-
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log) {
- SBStream sstr;
- GetDescription(sstr, lldb::eDescriptionLevelBrief);
- LLDB_LOG(log, "location = {0} ({1})", break_loc_sp.get(), sstr.GetData());
- }
}
SBBreakpointLocation::SBBreakpointLocation(const SBBreakpointLocation &rhs)
LLDB_RECORD_METHOD(void, SBBreakpointLocation, SetScriptCallbackFunction,
(const char *), callback_function_name);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointLocationSP loc_sp = GetSP();
- LLDB_LOG(log, "location = {0}, callback = {1}", loc_sp.get(),
- callback_function_name);
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
LLDB_RECORD_METHOD(lldb::SBError, SBBreakpointLocation, SetScriptCallbackBody,
(const char *), callback_body_text);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointLocationSP loc_sp = GetSP();
- LLDB_LOG(log, "location = {0}: callback body:\n{1}", loc_sp.get(),
- callback_body_text);
SBError sb_error;
if (loc_sp) {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBBreakpoint, SBBreakpointLocation,
GetBreakpoint);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
BreakpointLocationSP loc_sp = GetSP();
SBBreakpoint sb_bp;
sb_bp = loc_sp->GetBreakpoint().shared_from_this();
}
- if (log) {
- SBStream sstr;
- sb_bp.GetDescription(sstr);
- LLDB_LOG(log, "location = {0}, breakpoint = {1} ({2})", loc_sp.get(),
- sb_bp.GetSP().get(), sstr.GetData());
- }
return LLDB_RECORD_RESULT(sb_bp);
}
#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"
if (!name || name[0] == '\0')
return;
m_name.assign(name);
-
+
if (!target_sp)
return;
-
+
m_target_wp = target_sp;
}
// 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();
}
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());
m_impl_up.reset();
return *this;
}
-
+
m_impl_up.reset(new SBBreakpointNameImpl(rhs.m_impl_up->GetTarget(),
rhs.m_impl_up->GetName()));
return *this;
void SBBreakpointName::SetEnabled(bool enable) {
LLDB_RECORD_METHOD(void, SBBreakpointName, SetEnabled, (bool), enable);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
bool SBBreakpointName::IsEnabled() {
LLDB_RECORD_METHOD_NO_ARGS(bool, SBBreakpointName, IsEnabled);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
void SBBreakpointName::SetOneShot(bool one_shot) {
LLDB_RECORD_METHOD(void, SBBreakpointName, SetOneShot, (bool), one_shot);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
bool SBBreakpointName::IsOneShot() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBreakpointName, IsOneShot);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
void SBBreakpointName::SetIgnoreCount(uint32_t count) {
LLDB_RECORD_METHOD(void, SBBreakpointName, SetIgnoreCount, (uint32_t), count);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
uint32_t SBBreakpointName::GetIgnoreCount() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBBreakpointName, GetIgnoreCount);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
LLDB_RECORD_METHOD(void, SBBreakpointName, SetCondition, (const char *),
condition);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
const char *SBBreakpointName::GetCondition() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBBreakpointName, GetCondition);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
LLDB_RECORD_METHOD(void, SBBreakpointName, SetAutoContinue, (bool),
auto_continue);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
bool SBBreakpointName::GetAutoContinue() {
LLDB_RECORD_METHOD_NO_ARGS(bool, SBBreakpointName, GetAutoContinue);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
void SBBreakpointName::SetThreadID(tid_t tid) {
LLDB_RECORD_METHOD(void, SBBreakpointName, SetThreadID, (lldb::tid_t), tid);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
tid_t SBBreakpointName::GetThreadID() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::tid_t, SBBreakpointName, GetThreadID);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
void SBBreakpointName::SetThreadIndex(uint32_t index) {
LLDB_RECORD_METHOD(void, SBBreakpointName, SetThreadIndex, (uint32_t), index);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
uint32_t SBBreakpointName::GetThreadIndex() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBBreakpointName, GetThreadIndex);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
LLDB_RECORD_METHOD(void, SBBreakpointName, SetThreadName, (const char *),
thread_name);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBBreakpointName,
GetThreadName);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
LLDB_RECORD_METHOD(void, SBBreakpointName, SetQueueName, (const char *),
queue_name);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBBreakpointName,
GetQueueName);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
LLDB_RECORD_METHOD(void, SBBreakpointName, SetCommandLineCommands,
(lldb::SBStringList &), commands);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
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());
LLDB_RECORD_METHOD(bool, SBBreakpointName, GetCommandLineCommands,
(lldb::SBStringList &), commands);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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);
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBBreakpointName,
GetHelpString);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return "";
-
- LLDB_LOG(log, "Help: {0}\n", bp_name->GetHelp());
+
return bp_name->GetHelp();
}
LLDB_RECORD_METHOD(void, SBBreakpointName, SetHelpString, (const char *),
help_string);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
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());
LLDB_RECORD_METHOD(bool, SBBreakpointName, GetDescription, (lldb::SBStream &),
s);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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);
void SBBreakpointName::SetCallback(SBBreakpointHitCallback callback,
void *baton) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
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());
LLDB_RECORD_METHOD(void, SBBreakpointName, SetScriptCallbackFunction,
(const char *), callback_function_name);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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());
LLDB_RECORD_METHOD(lldb::SBError, SBBreakpointName, SetScriptCallbackBody,
(const char *), callback_body_text);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBError sb_error;
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
return LLDB_RECORD_RESULT(sb_error);
- LLDB_LOG(log, "Name: {0} callback: {1}\n", bp_name->GetName(),
- callback_body_text);
-
std::lock_guard<std::recursive_mutex> guard(
m_impl_up->GetTarget()->GetAPIMutex());
void SBBreakpointName::SetAllowList(bool value) {
LLDB_RECORD_METHOD(void, SBBreakpointName, SetAllowList, (bool), value);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
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);
}
void SBBreakpointName::SetAllowDelete(bool value) {
LLDB_RECORD_METHOD(void, SBBreakpointName, SetAllowDelete, (bool), value);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
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);
}
void SBBreakpointName::SetAllowDisable(bool value) {
LLDB_RECORD_METHOD(void, SBBreakpointName, SetAllowDisable, (bool), value);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
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);
}
#include "SBReproducerPrivate.h"
#include "lldb/Utility/Broadcaster.h"
-#include "lldb/Utility/Log.h"
#include "lldb/API/SBBroadcaster.h"
#include "lldb/API/SBEvent.h"
LLDB_RECORD_CONSTRUCTOR(SBBroadcaster, (const char *), name);
m_opaque_ptr = m_opaque_sp.get();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- LLDB_LOGV(log, "(name=\"{0}\") => SBBroadcaster({1})", name, m_opaque_ptr);
}
SBBroadcaster::SBBroadcaster(lldb_private::Broadcaster *broadcaster, bool owns)
: m_opaque_sp(owns ? broadcaster : NULL), m_opaque_ptr(broadcaster) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- LLDB_LOGV(log, "(broadcaster={0}, owns={1}) => SBBroadcaster({2})",
- broadcaster, owns, m_opaque_ptr);
}
SBBroadcaster::SBBroadcaster(const SBBroadcaster &rhs)
LLDB_RECORD_METHOD(void, SBBroadcaster, BroadcastEventByType,
(uint32_t, bool), event_type, unique);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf("SBBroadcaster(%p)::BroadcastEventByType (event_type=0x%8.8x, "
- "unique=%i)",
- static_cast<void *>(m_opaque_ptr), event_type, unique);
-
if (m_opaque_ptr == NULL)
return;
LLDB_RECORD_METHOD(void, SBBroadcaster, BroadcastEvent,
(const lldb::SBEvent &, bool), event, unique);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf(
- "SBBroadcaster(%p)::BroadcastEventByType (SBEvent(%p), unique=%i)",
- static_cast<void *>(m_opaque_ptr), static_cast<void *>(event.get()),
- unique);
-
if (m_opaque_ptr == NULL)
return;
(const lldb::SBListener &, uint32_t), listener,
requested_events);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBBroadcaster(%p)::AddInitialEventsToListener "
- "(SBListener(%p), event_mask=0x%8.8x)",
- static_cast<void *>(m_opaque_ptr),
- static_cast<void *>(listener.get()), requested_events);
if (m_opaque_ptr)
m_opaque_ptr->AddInitialEventsToListener(listener.m_opaque_sp,
requested_events);
LLDB_RECORD_CONSTRUCTOR(SBCommandInterpreter,
(lldb_private::CommandInterpreter *), interpreter);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf("SBCommandInterpreter::SBCommandInterpreter (interpreter=%p)"
- " => SBCommandInterpreter(%p)",
- static_cast<void *>(interpreter),
- static_cast<void *>(m_opaque_ptr));
}
SBCommandInterpreter::SBCommandInterpreter(const SBCommandInterpreter &rhs)
lldb::SBCommandReturnObject &, bool),
command_line, override_context, result, add_to_history);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", "
- "SBCommandReturnObject(%p), add_to_history=%i)",
- static_cast<void *>(m_opaque_ptr), command_line,
- static_cast<void *>(result.get()), add_to_history);
ExecutionContext ctx, *ctx_ptr;
if (override_context.get()) {
result->SetStatus(eReturnStatusFailed);
}
- // We need to get the value again, in case the command disabled the log!
- log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API);
- if (log) {
- SBStream sstr;
- result.GetDescription(sstr);
- log->Printf("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", "
- "SBCommandReturnObject(%p): %s, add_to_history=%i) => %i",
- static_cast<void *>(m_opaque_ptr), command_line,
- static_cast<void *>(result.get()), sstr.GetData(),
- add_to_history, result.GetStatus());
- }
return result.GetStatus();
}
lldb::SBCommandReturnObject),
file, override_context, options, result);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log) {
- SBStream s;
- file.GetDescription(s);
- log->Printf("SBCommandInterpreter(%p)::HandleCommandsFromFile "
- "(file=\"%s\", SBCommandReturnObject(%p))",
- static_cast<void *>(m_opaque_ptr), s.GetData(),
- static_cast<void *>(result.get()));
- }
-
if (!IsValid()) {
result->AppendError("SBCommandInterpreter is not valid.");
result->SetStatus(eReturnStatusFailed);
current_line, cursor, last_char, match_start_point,
max_return_elements, matches, descriptions);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
int num_completions = 0;
// Sanity check the arguments that are passed in: cursor & last_char have to
last_char - current_line > static_cast<ptrdiff_t>(current_line_size))
return 0;
- if (log)
- log->Printf("SBCommandInterpreter(%p)::HandleCompletion "
- "(current_line=\"%s\", cursor at: %" PRId64
- ", last char at: %" PRId64
- ", match_start_point: %d, max_return_elements: %d)",
- static_cast<void *>(m_opaque_ptr), current_line,
- static_cast<uint64_t>(cursor - current_line),
- static_cast<uint64_t>(last_char - current_line),
- match_start_point, max_return_elements);
if (IsValid()) {
lldb_private::StringList lldb_matches, lldb_descriptions;
SBStringList temp_descriptions_list(&lldb_descriptions);
descriptions.AppendList(temp_descriptions_list);
}
- if (log)
- log->Printf(
- "SBCommandInterpreter(%p)::HandleCompletion - Found %d completions.",
- static_cast<void *>(m_opaque_ptr), num_completions);
return num_completions;
}
sb_process.SetSP(process_sp);
}
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf("SBCommandInterpreter(%p)::GetProcess () => SBProcess(%p)",
- static_cast<void *>(m_opaque_ptr),
- static_cast<void *>(process_sp.get()));
return LLDB_RECORD_RESULT(sb_process);
}
SBDebugger sb_debugger;
if (IsValid())
sb_debugger.reset(m_opaque_ptr->GetDebugger().shared_from_this());
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf("SBCommandInterpreter(%p)::GetDebugger () => SBDebugger(%p)",
- static_cast<void *>(m_opaque_ptr),
- static_cast<void *>(sb_debugger.get()));
return LLDB_RECORD_RESULT(sb_debugger);
}
result->AppendError("SBCommandInterpreter is not valid");
result->SetStatus(eReturnStatusFailed);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf("SBCommandInterpreter(%p)::SourceInitFileInHomeDirectory "
- "(&SBCommandReturnObject(%p))",
- static_cast<void *>(m_opaque_ptr),
- static_cast<void *>(result.get()));
}
void SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory(
result->AppendError("SBCommandInterpreter is not valid");
result->SetStatus(eReturnStatusFailed);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf(
- "SBCommandInterpreter(%p)::SourceInitFileInCurrentWorkingDirectory "
- "(&SBCommandReturnObject(%p))",
- static_cast<void *>(m_opaque_ptr), static_cast<void *>(result.get()));
}
SBBroadcaster SBCommandInterpreter::GetBroadcaster() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBBroadcaster, SBCommandInterpreter,
GetBroadcaster);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBroadcaster broadcaster(m_opaque_ptr, false);
- if (log)
- log->Printf(
- "SBCommandInterpreter(%p)::GetBroadcaster() => SBBroadcaster(%p)",
- static_cast<void *>(m_opaque_ptr),
- static_cast<void *>(broadcaster.get()));
return LLDB_RECORD_RESULT(broadcaster);
}
#include "lldb/API/SBStream.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Utility/ConstString.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/Status.h"
using namespace lldb;
const char *SBCommandReturnObject::GetOutput() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBCommandReturnObject, GetOutput);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
if (m_opaque_up) {
llvm::StringRef output = m_opaque_up->GetOutputData();
ConstString result(output.empty() ? llvm::StringRef("") : output);
- if (log)
- log->Printf("SBCommandReturnObject(%p)::GetOutput () => \"%s\"",
- static_cast<void *>(m_opaque_up.get()), result.AsCString());
-
return result.AsCString();
}
- if (log)
- log->Printf("SBCommandReturnObject(%p)::GetOutput () => nullptr",
- static_cast<void *>(m_opaque_up.get()));
-
return nullptr;
}
const char *SBCommandReturnObject::GetError() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBCommandReturnObject, GetError);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
if (m_opaque_up) {
llvm::StringRef output = m_opaque_up->GetErrorData();
ConstString result(output.empty() ? llvm::StringRef("") : output);
- if (log)
- log->Printf("SBCommandReturnObject(%p)::GetError () => \"%s\"",
- static_cast<void *>(m_opaque_up.get()), result.AsCString());
-
return result.AsCString();
}
- if (log)
- log->Printf("SBCommandReturnObject(%p)::GetError () => nullptr",
- static_cast<void *>(m_opaque_up.get()));
-
return nullptr;
}
#include "lldb/Core/Communication.h"
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/Host.h"
-#include "lldb/Utility/Log.h"
using namespace lldb;
using namespace lldb_private;
SBCommunication::SBCommunication(const char *broadcaster_name)
: m_opaque(new Communication(broadcaster_name)), m_opaque_owned(true) {
LLDB_RECORD_CONSTRUCTOR(SBCommunication, (const char *), broadcaster_name);
-
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf("SBCommunication::SBCommunication (broadcaster_name=\"%s\") => "
- "SBCommunication(%p)",
- broadcaster_name, static_cast<void *>(m_opaque));
}
SBCommunication::~SBCommunication() {
LLDB_RECORD_METHOD(lldb::ConnectionStatus, SBCommunication,
AdoptFileDesriptor, (int, bool), fd, owns_fd);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
ConnectionStatus status = eConnectionStatusNoConnection;
if (m_opaque) {
if (m_opaque->HasConnection()) {
else
status = eConnectionStatusLostConnection;
}
-
- if (log)
- log->Printf(
- "SBCommunication(%p)::AdoptFileDescriptor (fd=%d, ownd_fd=%i) => %s",
- static_cast<void *>(m_opaque), fd, owns_fd,
- Communication::ConnectionStatusAsCString(status));
-
return status;
}
LLDB_RECORD_METHOD_NO_ARGS(lldb::ConnectionStatus, SBCommunication,
Disconnect);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
ConnectionStatus status = eConnectionStatusNoConnection;
if (m_opaque)
status = m_opaque->Disconnect();
-
- if (log)
- log->Printf("SBCommunication(%p)::Disconnect () => %s",
- static_cast<void *>(m_opaque),
- Communication::ConnectionStatusAsCString(status));
-
return status;
}
bool SBCommunication::IsConnected() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommunication, IsConnected);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- bool result = false;
- if (m_opaque)
- result = m_opaque->IsConnected();
-
- if (log)
- log->Printf("SBCommunication(%p)::IsConnected () => %i",
- static_cast<void *>(m_opaque), result);
-
- return false;
+ return m_opaque ? m_opaque->IsConnected() : false;
}
size_t SBCommunication::Read(void *dst, size_t dst_len, uint32_t timeout_usec,
ConnectionStatus &status) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64
- ", timeout_usec=%u, &status)...",
- static_cast<void *>(m_opaque), static_cast<void *>(dst),
- static_cast<uint64_t>(dst_len), timeout_usec);
size_t bytes_read = 0;
Timeout<std::micro> timeout = timeout_usec == UINT32_MAX
? Timeout<std::micro>(llvm::None)
else
status = eConnectionStatusNoConnection;
- if (log)
- log->Printf("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64
- ", timeout_usec=%u, &status=%s) => %" PRIu64,
- static_cast<void *>(m_opaque), static_cast<void *>(dst),
- static_cast<uint64_t>(dst_len), timeout_usec,
- Communication::ConnectionStatusAsCString(status),
- static_cast<uint64_t>(bytes_read));
return bytes_read;
}
else
status = eConnectionStatusNoConnection;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBCommunication(%p)::Write (src=%p, src_len=%" PRIu64
- ", &status=%s) => %" PRIu64,
- static_cast<void *>(m_opaque), static_cast<const void *>(src),
- static_cast<uint64_t>(src_len),
- Communication::ConnectionStatusAsCString(status),
- static_cast<uint64_t>(bytes_written));
-
- return 0;
+ return bytes_written;
}
bool SBCommunication::ReadThreadStart() {
LLDB_RECORD_METHOD_NO_ARGS(bool, SBCommunication, ReadThreadStart);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- bool success = false;
- if (m_opaque)
- success = m_opaque->StartReadThread();
-
- if (log)
- log->Printf("SBCommunication(%p)::ReadThreadStart () => %i",
- static_cast<void *>(m_opaque), success);
-
- return success;
+ return m_opaque ? m_opaque->StartReadThread() : false;
}
bool SBCommunication::ReadThreadStop() {
LLDB_RECORD_METHOD_NO_ARGS(bool, SBCommunication, ReadThreadStop);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBCommunication(%p)::ReadThreadStop ()...",
- static_cast<void *>(m_opaque));
-
- bool success = false;
- if (m_opaque)
- success = m_opaque->StopReadThread();
-
- if (log)
- log->Printf("SBCommunication(%p)::ReadThreadStop () => %i",
- static_cast<void *>(m_opaque), success);
-
- return success;
+ return m_opaque ? m_opaque->StopReadThread() : false;
}
bool SBCommunication::ReadThreadIsRunning() {
LLDB_RECORD_METHOD_NO_ARGS(bool, SBCommunication, ReadThreadIsRunning);
- bool result = false;
- if (m_opaque)
- result = m_opaque->ReadThreadIsRunning();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBCommunication(%p)::ReadThreadIsRunning () => %i",
- static_cast<void *>(m_opaque), result);
- return result;
+ return m_opaque ? m_opaque->ReadThreadIsRunning() : false;
}
bool SBCommunication::SetReadThreadBytesReceivedCallback(
ReadThreadBytesReceived callback, void *callback_baton) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
bool result = false;
if (m_opaque) {
m_opaque->SetReadThreadBytesReceivedCallback(callback, callback_baton);
result = true;
}
-
- if (log)
- log->Printf("SBCommunication(%p)::SetReadThreadBytesReceivedCallback "
- "(callback=%p, baton=%p) => %i",
- static_cast<void *>(m_opaque),
- reinterpret_cast<void *>(reinterpret_cast<intptr_t>(callback)),
- static_cast<void *>(callback_baton), result);
-
return result;
}
GetBroadcaster);
SBBroadcaster broadcaster(m_opaque, false);
-
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf("SBCommunication(%p)::GetBroadcaster () => SBBroadcaster (%p)",
- static_cast<void *>(m_opaque),
- static_cast<void *>(broadcaster.get()));
-
return LLDB_RECORD_RESULT(broadcaster);
}
return Communication::GetStaticBroadcasterClass().AsCString();
}
-
-//
-// void
-// SBCommunication::CreateIfNeeded ()
-//{
-// if (m_opaque == NULL)
-// {
-// static uint32_t g_broadcaster_num;
-// char broadcaster_name[256];
-// ::snprintf (name, broadcaster_name, "%p SBCommunication", this);
-// m_opaque = new Communication (broadcaster_name);
-// m_opaque_owned = true;
-// }
-// assert (m_opaque);
-//}
-//
-//
#include "lldb/Symbol/LineTable.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/Type.h"
-#include "lldb/Utility/Log.h"
using namespace lldb;
using namespace lldb_private;
uint32_t SBCompileUnit::GetNumLineEntries() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBCompileUnit, GetNumLineEntries);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (m_opaque_ptr) {
LineTable *line_table = m_opaque_ptr->GetLineTable();
if (line_table) {
- if (log)
- log->Printf("SBCompileUnit(%p)::GetNumLineEntries() => %d",
- static_cast<void *>(m_opaque_ptr),
- (int)line_table->GetSize());
return line_table->GetSize();
}
}
LLDB_RECORD_METHOD_CONST(lldb::SBLineEntry, SBCompileUnit,
GetLineEntryAtIndex, (uint32_t), idx);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBLineEntry sb_line_entry;
if (m_opaque_ptr) {
LineTable *line_table = m_opaque_ptr->GetLineTable();
}
}
- if (log) {
- SBStream sstr;
- sb_line_entry.GetDescription(sstr);
- log->Printf("SBCompileUnit(%p)::GetLineEntryAtIndex (idx=%u) => "
- "SBLineEntry(%p): '%s'",
- static_cast<void *>(m_opaque_ptr), idx,
- static_cast<void *>(sb_line_entry.get()), sstr.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_line_entry);
}
(uint32_t, uint32_t, lldb::SBFileSpec *, bool),
start_idx, line, inline_file_spec, exact);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
uint32_t index = UINT32_MAX;
if (m_opaque_ptr) {
FileSpec file_spec;
exact, NULL);
}
- if (log) {
- SBStream sstr;
- if (index == UINT32_MAX) {
- log->Printf("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, "
- "line=%u, SBFileSpec(%p)) => NOT FOUND",
- static_cast<void *>(m_opaque_ptr), start_idx, line,
- inline_file_spec
- ? static_cast<const void *>(inline_file_spec->get())
- : NULL);
- } else {
- log->Printf("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, "
- "line=%u, SBFileSpec(%p)) => %u",
- static_cast<void *>(m_opaque_ptr), start_idx, line,
- inline_file_spec
- ? static_cast<const void *>(inline_file_spec->get())
- : NULL,
- index);
- }
- }
-
return index;
}
LLDB_RECORD_METHOD_CONST(lldb::SBFileSpec, SBCompileUnit,
GetSupportFileAtIndex, (uint32_t), idx);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBFileSpec sb_file_spec;
if (m_opaque_ptr) {
FileSpecList &support_files = m_opaque_ptr->GetSupportFiles();
sb_file_spec.SetFileSpec(file_spec);
}
- if (log) {
- SBStream sstr;
- sb_file_spec.GetDescription(sstr);
- log->Printf("SBCompileUnit(%p)::GetGetFileSpecAtIndex (idx=%u) => "
- "SBFileSpec(%p): '%s'",
- static_cast<void *>(m_opaque_ptr), idx,
- static_cast<const void *>(sb_file_spec.get()), sstr.GetData());
- }
return LLDB_RECORD_RESULT(sb_file_spec);
}
#include "lldb/Core/DumpDataExtractor.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include <cinttypes>
uint8_t SBData::GetAddressByteSize() {
LLDB_RECORD_METHOD_NO_ARGS(uint8_t, SBData, GetAddressByteSize);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint8_t value = 0;
if (m_opaque_sp.get())
value = m_opaque_sp->GetAddressByteSize();
- if (log)
- log->Printf("SBData::GetAddressByteSize () => "
- "(%i)",
- value);
return value;
}
LLDB_RECORD_METHOD(void, SBData, SetAddressByteSize, (uint8_t),
addr_byte_size);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (m_opaque_sp.get())
m_opaque_sp->SetAddressByteSize(addr_byte_size);
- if (log)
- log->Printf("SBData::SetAddressByteSize (%i)", addr_byte_size);
}
void SBData::Clear() {
size_t SBData::GetByteSize() {
LLDB_RECORD_METHOD_NO_ARGS(size_t, SBData, GetByteSize);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
size_t value = 0;
if (m_opaque_sp.get())
value = m_opaque_sp->GetByteSize();
- if (log)
- log->Printf("SBData::GetByteSize () => "
- "( %" PRIu64 " )",
- (uint64_t)value);
return value;
}
lldb::ByteOrder SBData::GetByteOrder() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::ByteOrder, SBData, GetByteOrder);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
lldb::ByteOrder value = eByteOrderInvalid;
if (m_opaque_sp.get())
value = m_opaque_sp->GetByteOrder();
- if (log)
- log->Printf("SBData::GetByteOrder () => "
- "(%i)",
- value);
return value;
}
void SBData::SetByteOrder(lldb::ByteOrder endian) {
LLDB_RECORD_METHOD(void, SBData, SetByteOrder, (lldb::ByteOrder), endian);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (m_opaque_sp.get())
m_opaque_sp->SetByteOrder(endian);
- if (log)
- log->Printf("SBData::GetByteOrder (%i)", endian);
}
float SBData::GetFloat(lldb::SBError &error, lldb::offset_t offset) {
LLDB_RECORD_METHOD(float, SBData, GetFloat, (lldb::SBError &, lldb::offset_t),
error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
float value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset)
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetFloat (error=%p,offset=%" PRIu64 ") => (%f)",
- static_cast<void *>(error.get()), offset, value);
return value;
}
LLDB_RECORD_METHOD(double, SBData, GetDouble,
(lldb::SBError &, lldb::offset_t), error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
double value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset)
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetDouble (error=%p,offset=%" PRIu64 ") => "
- "(%f)",
- static_cast<void *>(error.get()), offset, value);
return value;
}
LLDB_RECORD_METHOD(long double, SBData, GetLongDouble,
(lldb::SBError &, lldb::offset_t), error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
long double value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset)
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetLongDouble (error=%p,offset=%" PRIu64 ") => "
- "(%Lf)",
- static_cast<void *>(error.get()), offset, value);
return value;
}
LLDB_RECORD_METHOD(lldb::addr_t, SBData, GetAddress,
(lldb::SBError &, lldb::offset_t), error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
lldb::addr_t value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset)
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetAddress (error=%p,offset=%" PRIu64 ") => "
- "(%p)",
- static_cast<void *>(error.get()), offset,
- reinterpret_cast<void *>(value));
return value;
}
LLDB_RECORD_METHOD(uint8_t, SBData, GetUnsignedInt8,
(lldb::SBError &, lldb::offset_t), error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint8_t value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset)
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetUnsignedInt8 (error=%p,offset=%" PRIu64 ") => "
- "(%c)",
- static_cast<void *>(error.get()), offset, value);
return value;
}
LLDB_RECORD_METHOD(uint16_t, SBData, GetUnsignedInt16,
(lldb::SBError &, lldb::offset_t), error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint16_t value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset)
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetUnsignedInt16 (error=%p,offset=%" PRIu64 ") => "
- "(%hd)",
- static_cast<void *>(error.get()), offset, value);
return value;
}
LLDB_RECORD_METHOD(uint32_t, SBData, GetUnsignedInt32,
(lldb::SBError &, lldb::offset_t), error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint32_t value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset)
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetUnsignedInt32 (error=%p,offset=%" PRIu64 ") => "
- "(%d)",
- static_cast<void *>(error.get()), offset, value);
return value;
}
LLDB_RECORD_METHOD(uint64_t, SBData, GetUnsignedInt64,
(lldb::SBError &, lldb::offset_t), error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint64_t value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset)
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetUnsignedInt64 (error=%p,offset=%" PRIu64 ") => "
- "(%" PRId64 ")",
- static_cast<void *>(error.get()), offset, value);
return value;
}
LLDB_RECORD_METHOD(int8_t, SBData, GetSignedInt8,
(lldb::SBError &, lldb::offset_t), error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
int8_t value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset)
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetSignedInt8 (error=%p,offset=%" PRIu64 ") => "
- "(%c)",
- static_cast<void *>(error.get()), offset, value);
return value;
}
LLDB_RECORD_METHOD(int16_t, SBData, GetSignedInt16,
(lldb::SBError &, lldb::offset_t), error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
int16_t value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset)
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetSignedInt16 (error=%p,offset=%" PRIu64 ") => "
- "(%hd)",
- static_cast<void *>(error.get()), offset, value);
return value;
}
LLDB_RECORD_METHOD(int32_t, SBData, GetSignedInt32,
(lldb::SBError &, lldb::offset_t), error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
int32_t value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset)
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetSignedInt32 (error=%p,offset=%" PRIu64 ") => "
- "(%d)",
- static_cast<void *>(error.get()), offset, value);
return value;
}
LLDB_RECORD_METHOD(int64_t, SBData, GetSignedInt64,
(lldb::SBError &, lldb::offset_t), error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
int64_t value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset)
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetSignedInt64 (error=%p,offset=%" PRIu64 ") => "
- "(%" PRId64 ")",
- static_cast<void *>(error.get()), offset, value);
return value;
}
LLDB_RECORD_METHOD(const char *, SBData, GetString,
(lldb::SBError &, lldb::offset_t), error, offset);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *value = 0;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if (offset == old_offset || (value == NULL))
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::GetString (error=%p,offset=%" PRIu64 ") => (%p)",
- static_cast<void *>(error.get()), offset,
- static_cast<const void *>(value));
return value;
}
size_t SBData::ReadRawData(lldb::SBError &error, lldb::offset_t offset,
void *buf, size_t size) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
void *ok = NULL;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
if ((offset == old_offset) || (ok == NULL))
error.SetErrorString("unable to read data");
}
- if (log)
- log->Printf("SBData::ReadRawData (error=%p,offset=%" PRIu64
- ",buf=%p,size=%" PRIu64 ") => "
- "(%p)",
- static_cast<void *>(error.get()), offset,
- static_cast<void *>(buf), static_cast<uint64_t>(size),
- static_cast<void *>(ok));
return ok ? size : 0;
}
void SBData::SetData(lldb::SBError &error, const void *buf, size_t size,
lldb::ByteOrder endian, uint8_t addr_size) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (!m_opaque_sp.get())
m_opaque_sp = std::make_shared<DataExtractor>(buf, size, endian, addr_size);
else
m_opaque_sp->SetAddressByteSize(addr_size);
}
- if (log)
- log->Printf("SBData::SetData (error=%p,buf=%p,size=%" PRIu64
- ",endian=%d,addr_size=%c) => "
- "(%p)",
- static_cast<void *>(error.get()),
- static_cast<const void *>(buf), static_cast<uint64_t>(size),
- endian, addr_size, static_cast<void *>(m_opaque_sp.get()));
}
bool SBData::Append(const SBData &rhs) {
LLDB_RECORD_METHOD(bool, SBData, Append, (const lldb::SBData &), rhs);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool value = false;
if (m_opaque_sp.get() && rhs.m_opaque_sp.get())
value = m_opaque_sp.get()->Append(*rhs.m_opaque_sp);
- if (log)
- log->Printf("SBData::Append (rhs=%p) => (%s)",
- static_cast<void *>(rhs.get()), value ? "true" : "false");
return value;
}
bool SBData::SetDataFromCString(const char *data) {
LLDB_RECORD_METHOD(bool, SBData, SetDataFromCString, (const char *), data);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (!data) {
- if (log)
- log->Printf("SBData::SetDataFromCString (data=%p) => false",
- static_cast<const void *>(data));
return false;
}
else
m_opaque_sp->SetData(buffer_sp);
- if (log)
- log->Printf("SBData::SetDataFromCString (data=%p) => true",
- static_cast<const void *>(data));
return true;
}
LLDB_RECORD_METHOD(bool, SBData, SetDataFromUInt64Array, (uint64_t *, size_t),
array, array_len);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (!array || array_len == 0) {
- if (log)
- log->Printf(
- "SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64
- ") => "
- "false",
- static_cast<void *>(array), static_cast<uint64_t>(array_len));
return false;
}
else
m_opaque_sp->SetData(buffer_sp);
- if (log)
- log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64
- ") => "
- "true",
- static_cast<void *>(array), static_cast<uint64_t>(array_len));
return true;
}
LLDB_RECORD_METHOD(bool, SBData, SetDataFromUInt32Array, (uint32_t *, size_t),
array, array_len);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (!array || array_len == 0) {
- if (log)
- log->Printf(
- "SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64
- ") => "
- "false",
- static_cast<void *>(array), static_cast<uint64_t>(array_len));
return false;
}
else
m_opaque_sp->SetData(buffer_sp);
- if (log)
- log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64
- ") => "
- "true",
- static_cast<void *>(array), static_cast<uint64_t>(array_len));
-
return true;
}
LLDB_RECORD_METHOD(bool, SBData, SetDataFromSInt64Array, (int64_t *, size_t),
array, array_len);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (!array || array_len == 0) {
- if (log)
- log->Printf(
- "SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64
- ") => "
- "false",
- static_cast<void *>(array), static_cast<uint64_t>(array_len));
return false;
}
else
m_opaque_sp->SetData(buffer_sp);
- if (log)
- log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64
- ") => "
- "true",
- static_cast<void *>(array), static_cast<uint64_t>(array_len));
-
return true;
}
LLDB_RECORD_METHOD(bool, SBData, SetDataFromSInt32Array, (int32_t *, size_t),
array, array_len);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (!array || array_len == 0) {
- if (log)
- log->Printf(
- "SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64
- ") => "
- "false",
- static_cast<void *>(array), static_cast<uint64_t>(array_len));
return false;
}
else
m_opaque_sp->SetData(buffer_sp);
- if (log)
- log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64
- ") => "
- "true",
- static_cast<void *>(array), static_cast<uint64_t>(array_len));
-
return true;
}
LLDB_RECORD_METHOD(bool, SBData, SetDataFromDoubleArray, (double *, size_t),
array, array_len);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (!array || array_len == 0) {
- if (log)
- log->Printf(
- "SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64
- ") => "
- "false",
- static_cast<void *>(array), static_cast<uint64_t>(array_len));
return false;
}
else
m_opaque_sp->SetData(buffer_sp);
- if (log)
- log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64
- ") => "
- "true",
- static_cast<void *>(array), static_cast<uint64_t>(array_len));
-
return true;
}
LLDB_RECORD_STATIC_METHOD_NO_ARGS(lldb::SBError, SBDebugger,
InitializeWithErrorHandling);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBDebugger::Initialize ()");
SBError error;
if (auto e = g_debugger_lifetime->Initialize(
void SBDebugger::Clear() {
LLDB_RECORD_METHOD_NO_ARGS(void, SBDebugger, Clear);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf("SBDebugger(%p)::Clear ()",
- static_cast<void *>(m_opaque_sp.get()));
if (m_opaque_sp)
m_opaque_sp->ClearIOHandlers();
lldb::LogOutputCallback callback, void *baton)
{
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBDebugger debugger;
debugger.reset(Debugger::CreateInstance(callback, baton));
- if (log) {
- SBStream sstr;
- debugger.GetDescription(sstr);
- log->Printf("SBDebugger::Create () => SBDebugger(%p): %s",
- static_cast<void *>(debugger.m_opaque_sp.get()),
- sstr.GetData());
- }
SBCommandInterpreter interp = debugger.GetCommandInterpreter();
if (source_init_files) {
LLDB_RECORD_STATIC_METHOD(void, SBDebugger, Destroy, (lldb::SBDebugger &),
debugger);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log) {
- SBStream sstr;
- debugger.GetDescription(sstr);
- log->Printf("SBDebugger::Destroy () => SBDebugger(%p): %s",
- static_cast<void *>(debugger.m_opaque_sp.get()),
- sstr.GetData());
- }
Debugger::Destroy(debugger.m_opaque_sp);
// mandatory. We have seen deadlocks with this function when called so we
// need to safeguard against this until we can determine what is causing the
// deadlocks.
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const bool mandatory = false;
- if (log) {
- log->Printf("SBDebugger::MemoryPressureDetected (), mandatory = %d",
- mandatory);
- }
ModuleList::RemoveOrphanSharedModules(mandatory);
}
LLDB_RECORD_METHOD(void, SBDebugger, SetInputFileHandle, (FILE *, bool), fh,
transfer_ownership);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf(
- "SBDebugger(%p)::SetInputFileHandle (fh=%p, transfer_ownership=%i)",
- static_cast<void *>(m_opaque_sp.get()), static_cast<void *>(fh),
- transfer_ownership);
-
if (!m_opaque_sp)
return;
LLDB_RECORD_METHOD(void, SBDebugger, SetOutputFileHandle, (FILE *, bool), fh,
transfer_ownership);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf(
- "SBDebugger(%p)::SetOutputFileHandle (fh=%p, transfer_ownership=%i)",
- static_cast<void *>(m_opaque_sp.get()), static_cast<void *>(fh),
- transfer_ownership);
-
if (m_opaque_sp)
m_opaque_sp->SetOutputFileHandle(fh, transfer_ownership);
}
LLDB_RECORD_METHOD(void, SBDebugger, SetErrorFileHandle, (FILE *, bool), fh,
transfer_ownership);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf(
- "SBDebugger(%p)::SetErrorFileHandle (fh=%p, transfer_ownership=%i)",
- static_cast<void *>(m_opaque_sp.get()), static_cast<void *>(fh),
- transfer_ownership);
if (m_opaque_sp)
m_opaque_sp->SetErrorFileHandle(fh, transfer_ownership);
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBCommandInterpreter, SBDebugger,
GetCommandInterpreter);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBCommandInterpreter sb_interpreter;
if (m_opaque_sp)
sb_interpreter.reset(&m_opaque_sp->GetCommandInterpreter());
- if (log)
- log->Printf(
- "SBDebugger(%p)::GetCommandInterpreter () => SBCommandInterpreter(%p)",
- static_cast<void *>(m_opaque_sp.get()),
- static_cast<void *>(sb_interpreter.get()));
return LLDB_RECORD_RESULT(sb_interpreter);
}
SBListener SBDebugger::GetListener() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBListener, SBDebugger, GetListener);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBListener sb_listener;
if (m_opaque_sp)
sb_listener.reset(m_opaque_sp->GetListener());
- if (log)
- log->Printf("SBDebugger(%p)::GetListener () => SBListener(%p)",
- static_cast<void *>(m_opaque_sp.get()),
- static_cast<void *>(sb_listener.get()));
return LLDB_RECORD_RESULT(sb_listener);
}
LLDB_RECORD_STATIC_METHOD(bool, SBDebugger, StateIsRunningState,
(lldb::StateType), state);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const bool result = lldb_private::StateIsRunningState(state);
- if (log)
- log->Printf("SBDebugger::StateIsRunningState (state=%s) => %i",
- StateAsCString(state), result);
return result;
}
LLDB_RECORD_STATIC_METHOD(bool, SBDebugger, StateIsStoppedState,
(lldb::StateType), state);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const bool result = lldb_private::StateIsStoppedState(state, false);
- if (log)
- log->Printf("SBDebugger::StateIsStoppedState (state=%s) => %i",
- StateAsCString(state), result);
return result;
}
#include "lldb/API/SBStream.h"
#include "lldb/Host/PosixApi.h"
#include "lldb/Symbol/Declaration.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include <limits.h>
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBDeclaration,
GetFileSpec);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBFileSpec sb_file_spec;
if (m_opaque_up.get() && m_opaque_up->GetFile())
sb_file_spec.SetFileSpec(m_opaque_up->GetFile());
- if (log) {
- SBStream sstr;
- sb_file_spec.GetDescription(sstr);
- log->Printf("SBLineEntry(%p)::GetFileSpec () => SBFileSpec(%p): %s",
- static_cast<void *>(m_opaque_up.get()),
- static_cast<const void *>(sb_file_spec.get()), sstr.GetData());
- }
return LLDB_RECORD_RESULT(sb_file_spec);
}
uint32_t SBDeclaration::GetLine() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBDeclaration, GetLine);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint32_t line = 0;
if (m_opaque_up)
line = m_opaque_up->GetLine();
- if (log)
- log->Printf("SBLineEntry(%p)::GetLine () => %u",
- static_cast<void *>(m_opaque_up.get()), line);
return line;
}
#include "SBReproducerPrivate.h"
#include "Utils.h"
#include "lldb/API/SBStream.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/Status.h"
#include <stdarg.h>
bool SBError::Fail() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBError, Fail);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
bool ret_value = false;
if (m_opaque_up)
ret_value = m_opaque_up->Fail();
- if (log)
- log->Printf("SBError(%p)::Fail () => %i",
- static_cast<void *>(m_opaque_up.get()), ret_value);
return ret_value;
}
bool SBError::Success() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBError, Success);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool ret_value = true;
if (m_opaque_up)
ret_value = m_opaque_up->Success();
- if (log)
- log->Printf("SBError(%p)::Success () => %i",
- static_cast<void *>(m_opaque_up.get()), ret_value);
-
return ret_value;
}
uint32_t SBError::GetError() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBError, GetError);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
uint32_t err = 0;
if (m_opaque_up)
err = m_opaque_up->GetError();
- if (log)
- log->Printf("SBError(%p)::GetError () => 0x%8.8x",
- static_cast<void *>(m_opaque_up.get()), err);
return err;
}
ErrorType SBError::GetType() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::ErrorType, SBError, GetType);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ErrorType err_type = eErrorTypeInvalid;
if (m_opaque_up)
err_type = m_opaque_up->GetType();
- if (log)
- log->Printf("SBError(%p)::GetType () => %i",
- static_cast<void *>(m_opaque_up.get()), err_type);
-
return err_type;
}
uint32_t SBEvent::GetType() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBEvent, GetType);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const Event *lldb_event = get();
uint32_t event_type = 0;
if (lldb_event)
event_type = lldb_event->GetType();
- if (log) {
- StreamString sstr;
- if (lldb_event && lldb_event->GetBroadcaster() &&
- lldb_event->GetBroadcaster()->GetEventNames(sstr, event_type, true))
- log->Printf("SBEvent(%p)::GetType () => 0x%8.8x (%s)",
- static_cast<void *>(get()), event_type, sstr.GetData());
- else
- log->Printf("SBEvent(%p)::GetType () => 0x%8.8x",
- static_cast<void *>(get()), event_type);
- }
return event_type;
}
if (lldb_event)
success = lldb_event->BroadcasterIs(broadcaster.get());
- // For logging, this gets a little chatty so only enable this when verbose
- // logging is on
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- LLDB_LOGV(log, "({0}) (SBBroadcaster({1}): {2}) => {3}", get(),
- broadcaster.get(), broadcaster.GetName(), success);
return success;
}
LLDB_RECORD_STATIC_METHOD(const char *, SBEvent, GetCStringFromEvent,
(const lldb::SBEvent &), event);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf("SBEvent(%p)::GetCStringFromEvent () => \"%s\"",
- static_cast<void *>(event.get()),
- reinterpret_cast<const char *>(
- EventDataBytes::GetBytesFromEvent(event.get())));
-
return reinterpret_cast<const char *>(
EventDataBytes::GetBytesFromEvent(event.get()));
}
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/PosixApi.h"
#include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include "llvm/ADT/SmallString.h"
bool SBFileSpec::Exists() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFileSpec, Exists);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- bool result = FileSystem::Instance().Exists(*m_opaque_up);
-
- if (log)
- log->Printf("SBFileSpec(%p)::Exists () => %s",
- static_cast<void *>(m_opaque_up.get()),
- (result ? "true" : "false"));
-
- return result;
+ return FileSystem::Instance().Exists(*m_opaque_up);
}
bool SBFileSpec::ResolveExecutableLocation() {
const char *SBFileSpec::GetFilename() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFileSpec, GetFilename);
- const char *s = m_opaque_up->GetFilename().AsCString();
-
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (s)
- log->Printf("SBFileSpec(%p)::GetFilename () => \"%s\"",
- static_cast<void *>(m_opaque_up.get()), s);
- else
- log->Printf("SBFileSpec(%p)::GetFilename () => NULL",
- static_cast<void *>(m_opaque_up.get()));
- }
-
- return s;
+ return m_opaque_up->GetFilename().AsCString();
}
const char *SBFileSpec::GetDirectory() const {
FileSpec directory{*m_opaque_up};
directory.GetFilename().Clear();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (directory)
- log->Printf("SBFileSpec(%p)::GetDirectory () => \"%s\"",
- static_cast<void *>(m_opaque_up.get()),
- directory.GetCString());
- else
- log->Printf("SBFileSpec(%p)::GetDirectory () => NULL",
- static_cast<void *>(m_opaque_up.get()));
- }
return directory.GetCString();
}
LLDB_RECORD_METHOD_CONST(uint32_t, SBFileSpec, GetPath, (char *, size_t),
dst_path, dst_len);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
uint32_t result = m_opaque_up->GetPath(dst_path, dst_len);
- if (log)
- log->Printf("SBFileSpec(%p)::GetPath (dst_path=\"%.*s\", dst_len=%" PRIu64
- ") => %u",
- static_cast<void *>(m_opaque_up.get()), result, dst_path,
- static_cast<uint64_t>(dst_len), result);
-
if (result == 0 && dst_path && dst_len > 0)
*dst_path = '\0';
return result;
#include "lldb/Core/FileSpecList.h"
#include "lldb/Host/PosixApi.h"
#include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include <limits.h>
SBFileSpecList::SBFileSpecList(const SBFileSpecList &rhs) : m_opaque_up() {
LLDB_RECORD_CONSTRUCTOR(SBFileSpecList, (const lldb::SBFileSpecList &), rhs);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
m_opaque_up = clone(rhs.m_opaque_up);
-
- if (log) {
- log->Printf("SBFileSpecList::SBFileSpecList (const SBFileSpecList "
- "rhs.ap=%p) => SBFileSpecList(%p)",
- static_cast<void *>(rhs.m_opaque_up.get()),
- static_cast<void *>(m_opaque_up.get()));
- }
}
SBFileSpecList::~SBFileSpecList() {}
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/ConstString.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include "lldb/API/SBAddress.h"
: m_opaque_sp(new ExecutionContextRef(lldb_object_sp)) {
LLDB_RECORD_CONSTRUCTOR(SBFrame, (const lldb::StackFrameSP &),
lldb_object_sp);
-
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log) {
- SBStream sstr;
- GetDescription(sstr);
- log->Printf("SBFrame::SBFrame (sp=%p) => SBFrame(%p): %s",
- static_cast<void *>(lldb_object_sp.get()),
- static_cast<void *>(lldb_object_sp.get()), sstr.GetData());
- }
}
SBFrame::SBFrame(const SBFrame &rhs) : m_opaque_sp() {
LLDB_RECORD_METHOD_CONST(lldb::SBSymbolContext, SBFrame, GetSymbolContext,
(uint32_t), resolve_scope);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBSymbolContext sb_sym_ctx;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&process->GetRunLock())) {
frame = exe_ctx.GetFramePtr();
- if (frame) {
+ if (frame)
sb_sym_ctx.SetSymbolContext(&frame->GetSymbolContext(scope));
- } else {
- if (log)
- log->Printf("SBFrame::GetVariables () => error: could not "
- "reconstruct frame object for this SBFrame.");
- }
- } else {
- if (log)
- log->Printf(
- "SBFrame::GetSymbolContext () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetSymbolContext (resolve_scope=0x%8.8x) => "
- "SBSymbolContext(%p)",
- static_cast<void *>(frame), resolve_scope,
- static_cast<void *>(sb_sym_ctx.get()));
-
return LLDB_RECORD_RESULT(sb_sym_ctx);
}
SBModule SBFrame::GetModule() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBModule, SBFrame, GetModule);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBModule sb_module;
ModuleSP module_sp;
std::unique_lock<std::recursive_mutex> lock;
if (frame) {
module_sp = frame->GetSymbolContext(eSymbolContextModule).module_sp;
sb_module.SetSP(module_sp);
- } else {
- if (log)
- log->Printf("SBFrame::GetModule () => error: could not reconstruct "
- "frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::GetModule () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetModule () => SBModule(%p)",
- static_cast<void *>(frame),
- static_cast<void *>(module_sp.get()));
-
return LLDB_RECORD_RESULT(sb_module);
}
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBCompileUnit, SBFrame,
GetCompileUnit);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBCompileUnit sb_comp_unit;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
if (frame) {
sb_comp_unit.reset(
frame->GetSymbolContext(eSymbolContextCompUnit).comp_unit);
- } else {
- if (log)
- log->Printf("SBFrame::GetCompileUnit () => error: could not "
- "reconstruct frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::GetCompileUnit () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetCompileUnit () => SBCompileUnit(%p)",
- static_cast<void *>(frame),
- static_cast<void *>(sb_comp_unit.get()));
return LLDB_RECORD_RESULT(sb_comp_unit);
}
SBFunction SBFrame::GetFunction() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFunction, SBFrame, GetFunction);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBFunction sb_function;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
if (frame) {
sb_function.reset(
frame->GetSymbolContext(eSymbolContextFunction).function);
- } else {
- if (log)
- log->Printf("SBFrame::GetFunction () => error: could not reconstruct "
- "frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::GetFunction () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetFunction () => SBFunction(%p)",
- static_cast<void *>(frame),
- static_cast<void *>(sb_function.get()));
return LLDB_RECORD_RESULT(sb_function);
}
SBSymbol SBFrame::GetSymbol() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBSymbol, SBFrame, GetSymbol);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBSymbol sb_symbol;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
frame = exe_ctx.GetFramePtr();
if (frame) {
sb_symbol.reset(frame->GetSymbolContext(eSymbolContextSymbol).symbol);
- } else {
- if (log)
- log->Printf("SBFrame::GetSymbol () => error: could not reconstruct "
- "frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::GetSymbol () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetSymbol () => SBSymbol(%p)",
- static_cast<void *>(frame),
- static_cast<void *>(sb_symbol.get()));
+
return LLDB_RECORD_RESULT(sb_symbol);
}
SBBlock SBFrame::GetBlock() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBBlock, SBFrame, GetBlock);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBlock sb_block;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&process->GetRunLock())) {
frame = exe_ctx.GetFramePtr();
- if (frame) {
+ if (frame)
sb_block.SetPtr(frame->GetSymbolContext(eSymbolContextBlock).block);
- } else {
- if (log)
- log->Printf("SBFrame::GetBlock () => error: could not reconstruct "
- "frame object for this SBFrame.");
- }
- } else {
- if (log)
- log->Printf("SBFrame(%p)::GetBlock () => error: process is running",
- static_cast<void *>(frame));
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetBlock () => SBBlock(%p)",
- static_cast<void *>(frame),
- static_cast<void *>(sb_block.GetPtr()));
return LLDB_RECORD_RESULT(sb_block);
}
StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
Process *process = exe_ctx.GetProcessPtr();
if (target && process) {
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&process->GetRunLock())) {
frame = exe_ctx.GetFramePtr();
- if (frame) {
+ if (frame)
sb_block.SetPtr(frame->GetFrameBlock());
- } else {
- if (log)
- log->Printf("SBFrame::GetFrameBlock () => error: could not "
- "reconstruct frame object for this SBFrame.");
- }
- } else {
- if (log)
- log->Printf("SBFrame::GetFrameBlock () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetFrameBlock () => SBBlock(%p)",
- static_cast<void *>(frame),
- static_cast<void *>(sb_block.GetPtr()));
return LLDB_RECORD_RESULT(sb_block);
}
SBLineEntry SBFrame::GetLineEntry() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBLineEntry, SBFrame, GetLineEntry);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBLineEntry sb_line_entry;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
if (frame) {
sb_line_entry.SetLineEntry(
frame->GetSymbolContext(eSymbolContextLineEntry).line_entry);
- } else {
- if (log)
- log->Printf("SBFrame::GetLineEntry () => error: could not "
- "reconstruct frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::GetLineEntry () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetLineEntry () => SBLineEntry(%p)",
- static_cast<void *>(frame),
- static_cast<void *>(sb_line_entry.get()));
return LLDB_RECORD_RESULT(sb_line_entry);
}
if (frame)
frame_idx = frame->GetFrameIndex();
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBFrame(%p)::GetFrameID () => %u", static_cast<void *>(frame),
- frame_idx);
return frame_idx;
}
addr_t SBFrame::GetPC() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::addr_t, SBFrame, GetPC);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
addr_t addr = LLDB_INVALID_ADDRESS;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
if (frame) {
addr = frame->GetFrameCodeAddress().GetOpcodeLoadAddress(
target, AddressClass::eCode);
- } else {
- if (log)
- log->Printf("SBFrame::GetPC () => error: could not reconstruct frame "
- "object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::GetPC () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetPC () => 0x%" PRIx64,
- static_cast<void *>(frame), addr);
-
return addr;
}
bool SBFrame::SetPC(addr_t new_pc) {
LLDB_RECORD_METHOD(bool, SBFrame, SetPC, (lldb::addr_t), new_pc);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool ret_val = false;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
frame = exe_ctx.GetFramePtr();
if (frame) {
ret_val = frame->GetRegisterContext()->SetPC(new_pc);
- } else {
- if (log)
- log->Printf("SBFrame::SetPC () => error: could not reconstruct frame "
- "object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::SetPC () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::SetPC (new_pc=0x%" PRIx64 ") => %i",
- static_cast<void *>(frame), new_pc, ret_val);
-
return ret_val;
}
addr_t SBFrame::GetSP() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::addr_t, SBFrame, GetSP);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
addr_t addr = LLDB_INVALID_ADDRESS;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
frame = exe_ctx.GetFramePtr();
if (frame) {
addr = frame->GetRegisterContext()->GetSP();
- } else {
- if (log)
- log->Printf("SBFrame::GetSP () => error: could not reconstruct frame "
- "object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::GetSP () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetSP () => 0x%" PRIx64,
- static_cast<void *>(frame), addr);
return addr;
}
addr_t SBFrame::GetFP() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::addr_t, SBFrame, GetFP);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
addr_t addr = LLDB_INVALID_ADDRESS;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&process->GetRunLock())) {
frame = exe_ctx.GetFramePtr();
- if (frame) {
+ if (frame)
addr = frame->GetRegisterContext()->GetFP();
- } else {
- if (log)
- log->Printf("SBFrame::GetFP () => error: could not reconstruct frame "
- "object for this SBFrame.");
- }
- } else {
- if (log)
- log->Printf("SBFrame::GetFP () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetFP () => 0x%" PRIx64,
- static_cast<void *>(frame), addr);
return addr;
}
SBAddress SBFrame::GetPCAddress() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBAddress, SBFrame, GetPCAddress);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBAddress sb_addr;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&process->GetRunLock())) {
frame = exe_ctx.GetFramePtr();
- if (frame) {
+ if (frame)
sb_addr.SetAddress(&frame->GetFrameCodeAddress());
- } else {
- if (log)
- log->Printf("SBFrame::GetPCAddress () => error: could not "
- "reconstruct frame object for this SBFrame.");
- }
- } else {
- if (log)
- log->Printf("SBFrame::GetPCAddress () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetPCAddress () => SBAddress(%p)",
- static_cast<void *>(frame), static_cast<void *>(sb_addr.get()));
return LLDB_RECORD_RESULT(sb_addr);
}
use_dynamic);
SBValue sb_value;
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (var_path == nullptr || var_path[0] == '\0') {
- if (log)
- log->Printf(
- "SBFrame::GetValueForVariablePath called with empty variable path.");
return LLDB_RECORD_RESULT(sb_value);
}
StackFrame::eExpressionPathOptionsAllowDirectIVarAccess,
var_sp, error));
sb_value.SetSP(value_sp, use_dynamic);
- } else {
- if (log)
- log->Printf("SBFrame::GetValueForVariablePath () => error: could not "
- "reconstruct frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf(
- "SBFrame::GetValueForVariablePath () => error: process is running");
}
}
return LLDB_RECORD_RESULT(sb_value);
LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, FindVariable,
(const char *, lldb::DynamicValueType), name, use_dynamic);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
VariableSP var_sp;
SBValue sb_value;
if (name == nullptr || name[0] == '\0') {
- if (log)
- log->Printf("SBFrame::FindVariable called with empty name");
return LLDB_RECORD_RESULT(sb_value);
}
if (value_sp)
sb_value.SetSP(value_sp, use_dynamic);
- } else {
- if (log)
- log->Printf("SBFrame::FindVariable () => error: could not "
- "reconstruct frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::FindVariable () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::FindVariable (name=\"%s\") => SBValue(%p)",
- static_cast<void *>(frame), name,
- static_cast<void *>(value_sp.get()));
-
return LLDB_RECORD_RESULT(sb_value);
}
(const char *, lldb::ValueType, lldb::DynamicValueType),
name, value_type, use_dynamic);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBValue sb_value;
if (name == nullptr || name[0] == '\0') {
- if (log)
- log->Printf("SBFrame::FindValue called with empty name.");
return LLDB_RECORD_RESULT(sb_value);
}
default:
break;
}
- } else {
- if (log)
- log->Printf("SBFrame::FindValue () => error: could not reconstruct "
- "frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::FindValue () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::FindVariableInScope (name=\"%s\", value_type=%i) "
- "=> SBValue(%p)",
- static_cast<void *>(frame), name, value_type,
- static_cast<void *>(value_sp.get()));
-
return LLDB_RECORD_RESULT(sb_value);
}
SBThread SBFrame::GetThread() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBThread, SBFrame, GetThread);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
ThreadSP thread_sp(exe_ctx.GetThreadSP());
SBThread sb_thread(thread_sp);
- if (log) {
- SBStream sstr;
- sb_thread.GetDescription(sstr);
- log->Printf("SBFrame(%p)::GetThread () => SBThread(%p): %s",
- static_cast<void *>(exe_ctx.GetFramePtr()),
- static_cast<void *>(thread_sp.get()), sstr.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_thread);
}
const char *SBFrame::Disassemble() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFrame, Disassemble);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *disassembly = nullptr;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
frame = exe_ctx.GetFramePtr();
if (frame) {
disassembly = frame->Disassemble();
- } else {
- if (log)
- log->Printf("SBFrame::Disassemble () => error: could not reconstruct "
- "frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::Disassemble () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::Disassemble () => %s", static_cast<void *>(frame),
- disassembly);
-
return disassembly;
}
LLDB_RECORD_METHOD(lldb::SBValueList, SBFrame, GetVariables,
(const lldb::SBVariablesOptions &), options);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBValueList value_list;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
options.GetIncludeRuntimeSupportValues();
const lldb::DynamicValueType use_dynamic = options.GetUseDynamic();
- if (log)
- log->Printf(
- "SBFrame::GetVariables (arguments=%i, recognized_arguments=%i, "
- "locals=%i, statics=%i, in_scope_only=%i runtime=%i dynamic=%i)",
- arguments, recognized_arguments, locals, statics, in_scope_only,
- include_runtime_support_values, use_dynamic);
std::set<VariableSP> variable_set;
Process *process = exe_ctx.GetProcessPtr();
}
}
}
- } else {
- if (log)
- log->Printf("SBFrame::GetVariables () => error: could not "
- "reconstruct frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::GetVariables () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetVariables (...) => SBValueList(%p)",
- static_cast<void *>(frame),
- static_cast<void *>(value_list.opaque_ptr()));
-
return LLDB_RECORD_RESULT(value_list);
}
SBValueList SBFrame::GetRegisters() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBValueList, SBFrame, GetRegisters);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBValueList value_list;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
ValueObjectRegisterSet::Create(frame, reg_ctx, set_idx));
}
}
- } else {
- if (log)
- log->Printf("SBFrame::GetRegisters () => error: could not "
- "reconstruct frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::GetRegisters () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::GetRegisters () => SBValueList(%p)",
- static_cast<void *>(frame),
- static_cast<void *>(value_list.opaque_ptr()));
-
return LLDB_RECORD_RESULT(value_list);
}
LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, FindRegister, (const char *),
name);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBValue result;
ValueObjectSP value_sp;
std::unique_lock<std::recursive_mutex> lock;
}
}
}
- } else {
- if (log)
- log->Printf("SBFrame::FindRegister () => error: could not "
- "reconstruct frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::FindRegister () => error: process is running");
}
}
- if (log)
- log->Printf("SBFrame(%p)::FindRegister () => SBValue(%p)",
- static_cast<void *>(frame),
- static_cast<void *>(value_sp.get()));
-
return LLDB_RECORD_RESULT(result);
}
LLDB_RECORD_METHOD(bool, SBFrame, GetDescription, (lldb::SBStream &),
description);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
Stream &strm = description.ref();
std::unique_lock<std::recursive_mutex> lock;
frame = exe_ctx.GetFramePtr();
if (frame) {
frame->DumpUsingSettingsFormat(&strm);
- } else {
- if (log)
- log->Printf("SBFrame::GetDescription () => error: could not "
- "reconstruct frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::GetDescription () => error: process is running");
}
} else
(const char *, const lldb::SBExpressionOptions &), expr,
options);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
#ifndef LLDB_DISABLE_PYTHON
Log *expr_log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
#endif
SBValue expr_result;
if (expr == nullptr || expr[0] == '\0') {
- if (log)
- log->Printf(
- "SBFrame::EvaluateExpression called with an empty expression");
return LLDB_RECORD_RESULT(expr_result);
}
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- if (log)
- log->Printf("SBFrame()::EvaluateExpression (expr=\"%s\")...", expr);
StackFrame *frame = nullptr;
Target *target = exe_ctx.GetTargetPtr();
exe_results = target->EvaluateExpression(expr, frame, expr_value_sp,
options.ref());
expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue());
- } else {
- if (log)
- log->Printf("SBFrame::EvaluateExpression () => error: could not "
- "reconstruct frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf(
- "SBFrame::EvaluateExpression () => error: process is running");
}
}
expr_log->Printf("** [SBFrame::EvaluateExpression] Expression result is "
"%s, summary %s **",
expr_result.GetValue(), expr_result.GetSummary());
-
- if (log)
- log->Printf("SBFrame(%p)::EvaluateExpression (expr=\"%s\") => SBValue(%p) "
- "(execution result=%d)",
- static_cast<void *>(frame), expr,
- static_cast<void *>(expr_value_sp.get()), exe_results);
#endif
return LLDB_RECORD_RESULT(expr_result);
bool SBFrame::IsInlined() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFrame, IsInlined);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
Block *block = frame->GetSymbolContext(eSymbolContextBlock).block;
if (block)
return block->GetContainingInlinedBlock() != nullptr;
- } else {
- if (log)
- log->Printf("SBFrame::IsInlined () => error: could not reconstruct "
- "frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::IsInlined () => error: process is running");
}
}
return false;
const char *SBFrame::GetFunctionName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFrame, GetFunctionName);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *name = nullptr;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
if (sc.symbol)
name = sc.symbol->GetName().GetCString();
}
- } else {
- if (log)
- log->Printf("SBFrame::GetFunctionName () => error: could not "
- "reconstruct frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf("SBFrame::GetFunctionName() => error: process is running");
}
}
return name;
const char *SBFrame::GetDisplayFunctionName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBFrame, GetDisplayFunctionName);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *name = nullptr;
std::unique_lock<std::recursive_mutex> lock;
if (sc.symbol)
name = sc.symbol->GetDisplayName().GetCString();
}
- } else {
- if (log)
- log->Printf("SBFrame::GetDisplayFunctionName () => error: could not "
- "reconstruct frame object for this SBFrame.");
}
- } else {
- if (log)
- log->Printf(
- "SBFrame::GetDisplayFunctionName() => error: process is running");
}
}
return name;
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Target.h"
-#include "lldb/Utility/Log.h"
using namespace lldb;
using namespace lldb_private;
if (m_opaque_ptr)
cstr = m_opaque_ptr->GetName().AsCString();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (cstr)
- log->Printf("SBFunction(%p)::GetName () => \"%s\"",
- static_cast<void *>(m_opaque_ptr), cstr);
- else
- log->Printf("SBFunction(%p)::GetName () => NULL",
- static_cast<void *>(m_opaque_ptr));
- }
return cstr;
}
.GetDisplayDemangledName(m_opaque_ptr->GetLanguage())
.AsCString();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (cstr)
- log->Printf("SBFunction(%p)::GetDisplayName () => \"%s\"",
- static_cast<void *>(m_opaque_ptr), cstr);
- else
- log->Printf("SBFunction(%p)::GetDisplayName () => NULL",
- static_cast<void *>(m_opaque_ptr));
- }
return cstr;
}
const char *cstr = NULL;
if (m_opaque_ptr)
cstr = m_opaque_ptr->GetMangled().GetMangledName().AsCString();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (cstr)
- log->Printf("SBFunction(%p)::GetMangledName () => \"%s\"",
- static_cast<void *>(m_opaque_ptr), cstr);
- else
- log->Printf("SBFunction(%p)::GetMangledName () => NULL",
- static_cast<void *>(m_opaque_ptr));
- }
return cstr;
}
#include "lldb/Host/HostThread.h"
#include "lldb/Host/ThreadLauncher.h"
#include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/Log.h"
#include "Plugins/ExpressionParser/Clang/ClangHost.h"
#ifndef LLDB_DISABLE_PYTHON
lldb::thread_t SBHostOS::ThreadCreate(const char *name,
lldb::thread_func_t thread_function,
void *thread_arg, SBError *error_ptr) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf(
- "SBHostOS::ThreadCreate (name=\"%s\", thread_function=%p, "
- "thread_arg=%p, error_ptr=%p)",
- name,
- reinterpret_cast<void *>(reinterpret_cast<intptr_t>(thread_function)),
- static_cast<void *>(thread_arg), static_cast<void *>(error_ptr));
-
- // FIXME: You should log the return value?
-
HostThread thread(ThreadLauncher::LaunchThread(
name, thread_function, thread_arg, error_ptr ? error_ptr->get() : NULL));
return thread.Release();
#include "lldb/API/SBStream.h"
#include "lldb/Host/PosixApi.h"
#include "lldb/Symbol/LineEntry.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
#include <limits.h>
if (m_opaque_up)
sb_address.SetAddress(&m_opaque_up->range.GetBaseAddress());
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- StreamString sstr;
- const Address *addr = sb_address.get();
- if (addr)
- addr->Dump(&sstr, NULL, Address::DumpStyleModuleWithFileAddress,
- Address::DumpStyleInvalid, 4);
- log->Printf("SBLineEntry(%p)::GetStartAddress () => SBAddress (%p): %s",
- static_cast<void *>(m_opaque_up.get()),
- static_cast<void *>(sb_address.get()), sstr.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_address);
}
sb_address.SetAddress(&m_opaque_up->range.GetBaseAddress());
sb_address.OffsetAddress(m_opaque_up->range.GetByteSize());
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- StreamString sstr;
- const Address *addr = sb_address.get();
- if (addr)
- addr->Dump(&sstr, NULL, Address::DumpStyleModuleWithFileAddress,
- Address::DumpStyleInvalid, 4);
- log->Printf("SBLineEntry(%p)::GetEndAddress () => SBAddress (%p): %s",
- static_cast<void *>(m_opaque_up.get()),
- static_cast<void *>(sb_address.get()), sstr.GetData());
- }
return LLDB_RECORD_RESULT(sb_address);
}
SBFileSpec SBLineEntry::GetFileSpec() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBLineEntry, GetFileSpec);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBFileSpec sb_file_spec;
if (m_opaque_up.get() && m_opaque_up->file)
sb_file_spec.SetFileSpec(m_opaque_up->file);
- if (log) {
- SBStream sstr;
- sb_file_spec.GetDescription(sstr);
- log->Printf("SBLineEntry(%p)::GetFileSpec () => SBFileSpec(%p): %s",
- static_cast<void *>(m_opaque_up.get()),
- static_cast<const void *>(sb_file_spec.get()), sstr.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_file_spec);
}
uint32_t SBLineEntry::GetLine() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBLineEntry, GetLine);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
uint32_t line = 0;
if (m_opaque_up)
line = m_opaque_up->line;
- if (log)
- log->Printf("SBLineEntry(%p)::GetLine () => %u",
- static_cast<void *>(m_opaque_up.get()), line);
-
return line;
}
#include "lldb/Core/Debugger.h"
#include "lldb/Utility/Broadcaster.h"
#include "lldb/Utility/Listener.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
using namespace lldb;
SBListener::SBListener(const char *name)
: m_opaque_sp(Listener::MakeListener(name)), m_unused_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR(SBListener, (const char *), name);
-
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf("SBListener::SBListener (name=\"%s\") => SBListener(%p)", name,
- static_cast<void *>(m_opaque_sp.get()));
}
SBListener::SBListener(const SBListener &rhs)
m_opaque_sp->StartListeningForEvents(broadcaster.get(), event_mask);
}
- Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API);
- if (log) {
- StreamString sstr_requested;
- StreamString sstr_acquired;
-
- Broadcaster *lldb_broadcaster = broadcaster.get();
- if (lldb_broadcaster) {
- const bool got_requested_names =
- lldb_broadcaster->GetEventNames(sstr_requested, event_mask, false);
- const bool got_acquired_names = lldb_broadcaster->GetEventNames(
- sstr_acquired, acquired_event_mask, false);
- log->Printf("SBListener(%p)::StartListeneingForEvents "
- "(SBBroadcaster(%p): %s, event_mask=0x%8.8x%s%s%s) => "
- "0x%8.8x%s%s%s",
- static_cast<void *>(m_opaque_sp.get()),
- static_cast<void *>(lldb_broadcaster),
- lldb_broadcaster->GetBroadcasterName().GetCString(),
- event_mask, got_requested_names ? " (" : "",
- sstr_requested.GetData(), got_requested_names ? ")" : "",
- acquired_event_mask, got_acquired_names ? " (" : "",
- sstr_acquired.GetData(), got_acquired_names ? ")" : "");
- } else {
- log->Printf("SBListener(%p)::StartListeneingForEvents "
- "(SBBroadcaster(%p), event_mask=0x%8.8x) => 0x%8.8x",
- static_cast<void *>(m_opaque_sp.get()),
- static_cast<void *>(lldb_broadcaster), event_mask,
- acquired_event_mask);
- }
- }
-
return acquired_event_mask;
}
LLDB_RECORD_METHOD(bool, SBListener, WaitForEvent,
(uint32_t, lldb::SBEvent &), timeout_secs, event);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (timeout_secs == UINT32_MAX) {
- log->Printf("SBListener(%p)::WaitForEvent (timeout_secs=INFINITE, "
- "SBEvent(%p))...",
- static_cast<void *>(m_opaque_sp.get()),
- static_cast<void *>(event.get()));
- } else {
- log->Printf(
- "SBListener(%p)::WaitForEvent (timeout_secs=%d, SBEvent(%p))...",
- static_cast<void *>(m_opaque_sp.get()), timeout_secs,
- static_cast<void *>(event.get()));
- }
- }
bool success = false;
if (m_opaque_sp) {
}
}
- if (log) {
- if (timeout_secs == UINT32_MAX) {
- log->Printf("SBListener(%p)::WaitForEvent (timeout_secs=INFINITE, "
- "SBEvent(%p)) => %i",
- static_cast<void *>(m_opaque_sp.get()),
- static_cast<void *>(event.get()), success);
- } else {
- log->Printf(
- "SBListener(%p)::WaitForEvent (timeout_secs=%d, SBEvent(%p)) => %i",
- static_cast<void *>(m_opaque_sp.get()), timeout_secs,
- static_cast<void *>(event.get()), success);
- }
- }
if (!success)
event.reset(NULL);
return success;
#include "lldb/API/SBMemoryRegionInfo.h"
#include "lldb/API/SBStream.h"
#include "lldb/Target/MemoryRegionInfo.h"
-#include "lldb/Utility/Log.h"
#include <vector>
LLDB_RECORD_METHOD(bool, SBMemoryRegionInfoList, GetMemoryRegionAtIndex,
(uint32_t, lldb::SBMemoryRegionInfo &), idx, region_info);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- bool result = m_opaque_up->GetMemoryRegionInfoAtIndex(idx, region_info.ref());
-
- if (log) {
- SBStream sstr;
- region_info.GetDescription(sstr);
- log->Printf("SBMemoryRegionInfoList::GetMemoryRegionAtIndex (this.ap=%p, "
- "idx=%d) => SBMemoryRegionInfo (this.ap=%p, '%s')",
- static_cast<void *>(m_opaque_up.get()), idx,
- static_cast<void *>(region_info.m_opaque_up.get()),
- sstr.GetData());
- }
-
- return result;
+ return m_opaque_up->GetMemoryRegionInfoAtIndex(idx, region_info.ref());
}
void SBMemoryRegionInfoList::Clear() {
#include "lldb/Symbol/TypeSystem.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/Target.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
using namespace lldb;
SBFileSpec SBModule::GetFileSpec() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule, GetFileSpec);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBFileSpec file_spec;
ModuleSP module_sp(GetSP());
if (module_sp)
file_spec.SetFileSpec(module_sp->GetFileSpec());
- if (log)
- log->Printf("SBModule(%p)::GetFileSpec () => SBFileSpec(%p)",
- static_cast<void *>(module_sp.get()),
- static_cast<const void *>(file_spec.get()));
-
return LLDB_RECORD_RESULT(file_spec);
}
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule,
GetPlatformFileSpec);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBFileSpec file_spec;
ModuleSP module_sp(GetSP());
if (module_sp)
file_spec.SetFileSpec(module_sp->GetPlatformFileSpec());
- if (log)
- log->Printf("SBModule(%p)::GetPlatformFileSpec () => SBFileSpec(%p)",
- static_cast<void *>(module_sp.get()),
- static_cast<const void *>(file_spec.get()));
-
return LLDB_RECORD_RESULT(file_spec);
}
(const lldb::SBFileSpec &), platform_file);
bool result = false;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ModuleSP module_sp(GetSP());
if (module_sp) {
result = true;
}
- if (log)
- log->Printf("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s)) => %i",
- static_cast<void *>(module_sp.get()),
- static_cast<const void *>(platform_file.get()),
- platform_file->GetPath().c_str(), result);
return result;
}
const uint8_t *SBModule::GetUUIDBytes() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const uint8_t *, SBModule, GetUUIDBytes);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
const uint8_t *uuid_bytes = NULL;
ModuleSP module_sp(GetSP());
if (module_sp)
uuid_bytes = module_sp->GetUUID().GetBytes().data();
- if (log) {
- if (uuid_bytes) {
- StreamString s;
- module_sp->GetUUID().Dump(&s);
- log->Printf("SBModule(%p)::GetUUIDBytes () => %s",
- static_cast<void *>(module_sp.get()), s.GetData());
- } else
- log->Printf("SBModule(%p)::GetUUIDBytes () => NULL",
- static_cast<void *>(module_sp.get()));
- }
return uuid_bytes;
}
const char *SBModule::GetUUIDString() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBModule, GetUUIDString);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *uuid_cstr = NULL;
ModuleSP module_sp(GetSP());
}
if (uuid_cstr && uuid_cstr[0]) {
- if (log)
- log->Printf("SBModule(%p)::GetUUIDString () => %s",
- static_cast<void *>(module_sp.get()), uuid_cstr);
return uuid_cstr;
}
- if (log)
- log->Printf("SBModule(%p)::GetUUIDString () => NULL",
- static_cast<void *>(module_sp.get()));
return NULL;
}
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/Args.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/ProcessInfo.h"
#include "lldb/Utility/State.h"
#include "lldb/Utility/Stream.h"
argv, envp, stdin_path, stdout_path, stderr_path,
working_directory, launch_flags, stop_at_entry, error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::RemoteLaunch (argv=%p, envp=%p, stdin=%s, "
- "stdout=%s, stderr=%s, working-dir=%s, launch_flags=0x%x, "
- "stop_at_entry=%i, &error (%p))...",
- static_cast<void *>(m_opaque_wp.lock().get()),
- static_cast<void *>(argv), static_cast<void *>(envp),
- stdin_path ? stdin_path : "NULL",
- stdout_path ? stdout_path : "NULL",
- stderr_path ? stderr_path : "NULL",
- working_directory ? working_directory : "NULL", launch_flags,
- stop_at_entry, static_cast<void *>(error.get()));
-
ProcessSP process_sp(GetSP());
if (process_sp) {
std::lock_guard<std::recursive_mutex> guard(
error.SetErrorString("unable to attach pid");
}
- if (log) {
- SBStream sstr;
- error.GetDescription(sstr);
- log->Printf("SBProcess(%p)::RemoteLaunch (...) => SBError (%p): %s",
- static_cast<void *>(process_sp.get()),
- static_cast<void *>(error.get()), sstr.GetData());
- }
-
return error.Success();
}
error.SetErrorString("unable to attach pid");
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- SBStream sstr;
- error.GetDescription(sstr);
- log->Printf("SBProcess(%p)::RemoteAttachToProcessWithID (%" PRIu64
- ") => SBError (%p): %s",
- static_cast<void *>(process_sp.get()), pid,
- static_cast<void *>(error.get()), sstr.GetData());
- }
-
return error.Success();
}
uint32_t SBProcess::GetNumThreads() {
LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBProcess, GetNumThreads);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
uint32_t num_threads = 0;
ProcessSP process_sp(GetSP());
if (process_sp) {
num_threads = process_sp->GetThreadList().GetSize(can_update);
}
- if (log)
- log->Printf("SBProcess(%p)::GetNumThreads () => %d",
- static_cast<void *>(process_sp.get()), num_threads);
-
return num_threads;
}
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBThread, SBProcess,
GetSelectedThread);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBThread sb_thread;
ThreadSP thread_sp;
ProcessSP process_sp(GetSP());
sb_thread.SetThread(thread_sp);
}
- if (log)
- log->Printf("SBProcess(%p)::GetSelectedThread () => SBThread(%p)",
- static_cast<void *>(process_sp.get()),
- static_cast<void *>(thread_sp.get()));
-
return LLDB_RECORD_RESULT(sb_thread);
}
LLDB_RECORD_METHOD(lldb::SBThread, SBProcess, CreateOSPluginThread,
(lldb::tid_t, lldb::addr_t), tid, context);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBThread sb_thread;
ThreadSP thread_sp;
ProcessSP process_sp(GetSP());
sb_thread.SetThread(thread_sp);
}
- if (log)
- log->Printf("SBProcess(%p)::CreateOSPluginThread (tid=0x%" PRIx64
- ", context=0x%" PRIx64 ") => SBThread(%p)",
- static_cast<void *>(process_sp.get()), tid, context,
- static_cast<void *>(thread_sp.get()));
-
return LLDB_RECORD_RESULT(sb_thread);
}
SBTarget SBProcess::GetTarget() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBTarget, SBProcess, GetTarget);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBTarget sb_target;
TargetSP target_sp;
ProcessSP process_sp(GetSP());
sb_target.SetSP(target_sp);
}
- if (log)
- log->Printf("SBProcess(%p)::GetTarget () => SBTarget(%p)",
- static_cast<void *>(process_sp.get()),
- static_cast<void *>(target_sp.get()));
-
return LLDB_RECORD_RESULT(sb_target);
}
LLDB_RECORD_METHOD(size_t, SBProcess, PutSTDIN, (const char *, size_t), src,
src_len);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
size_t ret_val = 0;
ProcessSP process_sp(GetSP());
if (process_sp) {
ret_val = process_sp->PutSTDIN(src, src_len, error);
}
- if (log)
- log->Printf("SBProcess(%p)::PutSTDIN (src=\"%s\", src_len=%" PRIu64
- ") => %" PRIu64,
- static_cast<void *>(process_sp.get()), src,
- static_cast<uint64_t>(src_len), static_cast<uint64_t>(ret_val));
-
return ret_val;
}
bytes_read = process_sp->GetSTDOUT(dst, dst_len, error);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf(
- "SBProcess(%p)::GetSTDOUT (dst=\"%.*s\", dst_len=%" PRIu64
- ") => %" PRIu64,
- static_cast<void *>(process_sp.get()), static_cast<int>(bytes_read),
- dst, static_cast<uint64_t>(dst_len), static_cast<uint64_t>(bytes_read));
-
return bytes_read;
}
bytes_read = process_sp->GetSTDERR(dst, dst_len, error);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf(
- "SBProcess(%p)::GetSTDERR (dst=\"%.*s\", dst_len=%" PRIu64
- ") => %" PRIu64,
- static_cast<void *>(process_sp.get()), static_cast<int>(bytes_read),
- dst, static_cast<uint64_t>(dst_len), static_cast<uint64_t>(bytes_read));
-
return bytes_read;
}
bytes_read = process_sp->GetAsyncProfileData(dst, dst_len, error);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf(
- "SBProcess(%p)::GetAsyncProfileData (dst=\"%.*s\", dst_len=%" PRIu64
- ") => %" PRIu64,
- static_cast<void *>(process_sp.get()), static_cast<int>(bytes_read),
- dst, static_cast<uint64_t>(dst_len), static_cast<uint64_t>(bytes_read));
-
return bytes_read;
}
LLDB_RECORD_METHOD(lldb::SBTrace, SBProcess, StartTrace,
(lldb::SBTraceOptions &, lldb::SBError &), options, error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ProcessSP process_sp(GetSP());
error.Clear();
SBTrace trace_instance;
} else {
uid = process_sp->StartTrace(*(options.m_traceoptions_sp), error.ref());
trace_instance.SetTraceUID(uid);
- LLDB_LOG(log, "SBProcess::returned uid - {0}", uid);
}
return LLDB_RECORD_RESULT(trace_instance);
}
LLDB_RECORD_METHOD(bool, SBProcess, SetSelectedThreadByID, (lldb::tid_t),
tid);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool ret_val = false;
ProcessSP process_sp(GetSP());
ret_val = process_sp->GetThreadList().SetSelectedThreadByID(tid);
}
- if (log)
- log->Printf("SBProcess(%p)::SetSelectedThreadByID (tid=0x%4.4" PRIx64
- ") => %s",
- static_cast<void *>(process_sp.get()), tid,
- (ret_val ? "true" : "false"));
-
return ret_val;
}
LLDB_RECORD_METHOD(bool, SBProcess, SetSelectedThreadByIndexID, (uint32_t),
index_id);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
bool ret_val = false;
ProcessSP process_sp(GetSP());
if (process_sp) {
ret_val = process_sp->GetThreadList().SetSelectedThreadByIndexID(index_id);
}
- if (log)
- log->Printf("SBProcess(%p)::SetSelectedThreadByID (tid=0x%x) => %s",
- static_cast<void *>(process_sp.get()), index_id,
- (ret_val ? "true" : "false"));
return ret_val;
}
LLDB_RECORD_METHOD(lldb::SBThread, SBProcess, GetThreadAtIndex, (size_t),
index);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBThread sb_thread;
ThreadSP thread_sp;
ProcessSP process_sp(GetSP());
sb_thread.SetThread(thread_sp);
}
- if (log)
- log->Printf("SBProcess(%p)::GetThreadAtIndex (index=%d) => SBThread(%p)",
- static_cast<void *>(process_sp.get()),
- static_cast<uint32_t>(index),
- static_cast<void *>(thread_sp.get()));
-
return LLDB_RECORD_RESULT(sb_thread);
}
uint32_t SBProcess::GetNumQueues() {
LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBProcess, GetNumQueues);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
uint32_t num_queues = 0;
ProcessSP process_sp(GetSP());
if (process_sp) {
}
}
- if (log)
- log->Printf("SBProcess(%p)::GetNumQueues () => %d",
- static_cast<void *>(process_sp.get()), num_queues);
-
return num_queues;
}
LLDB_RECORD_METHOD(lldb::SBQueue, SBProcess, GetQueueAtIndex, (size_t),
index);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBQueue sb_queue;
QueueSP queue_sp;
ProcessSP process_sp(GetSP());
}
}
- if (log)
- log->Printf("SBProcess(%p)::GetQueueAtIndex (index=%d) => SBQueue(%p)",
- static_cast<void *>(process_sp.get()),
- static_cast<uint32_t>(index),
- static_cast<void *>(queue_sp.get()));
-
return LLDB_RECORD_RESULT(sb_queue);
}
LLDB_RECORD_METHOD(lldb::SBEvent, SBProcess, GetStopEventForStopID,
(uint32_t), stop_id);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBEvent sb_event;
EventSP event_sp;
ProcessSP process_sp(GetSP());
sb_event.reset(event_sp);
}
- if (log)
- log->Printf("SBProcess(%p)::GetStopEventForStopID (stop_id=%" PRIu32
- ") => SBEvent(%p)",
- static_cast<void *>(process_sp.get()), stop_id,
- static_cast<void *>(event_sp.get()));
-
return LLDB_RECORD_RESULT(sb_event);
}
ret_val = process_sp->GetState();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::GetState () => %s",
- static_cast<void *>(process_sp.get()),
- lldb_private::StateAsCString(ret_val));
-
return ret_val;
}
process_sp->GetTarget().GetAPIMutex());
exit_status = process_sp->GetExitStatus();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::GetExitStatus () => %i (0x%8.8x)",
- static_cast<void *>(process_sp.get()), exit_status,
- exit_status);
return exit_status;
}
process_sp->GetTarget().GetAPIMutex());
exit_desc = process_sp->GetExitDescription();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::GetExitDescription () => %s",
- static_cast<void *>(process_sp.get()), exit_desc);
return exit_desc;
}
if (process_sp)
ret_val = process_sp->GetID();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::GetProcessID () => %" PRIu64,
- static_cast<void *>(process_sp.get()), ret_val);
-
return ret_val;
}
ProcessSP process_sp(GetSP());
if (process_sp)
ret_val = process_sp->GetUniqueID();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::GetUniqueID () => %" PRIu32,
- static_cast<void *>(process_sp.get()), ret_val);
return ret_val;
}
if (process_sp)
byteOrder = process_sp->GetTarget().GetArchitecture().GetByteOrder();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::GetByteOrder () => %d",
- static_cast<void *>(process_sp.get()), byteOrder);
return byteOrder;
}
if (process_sp)
size = process_sp->GetTarget().GetArchitecture().GetAddressByteSize();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::GetAddressByteSize () => %d",
- static_cast<void *>(process_sp.get()), size);
return size;
}
SBError SBProcess::Continue() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBError, SBProcess, Continue);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBError sb_error;
ProcessSP process_sp(GetSP());
- if (log)
- log->Printf("SBProcess(%p)::Continue ()...",
- static_cast<void *>(process_sp.get()));
-
if (process_sp) {
std::lock_guard<std::recursive_mutex> guard(
process_sp->GetTarget().GetAPIMutex());
} else
sb_error.SetErrorString("SBProcess is invalid");
- if (log) {
- SBStream sstr;
- sb_error.GetDescription(sstr);
- log->Printf("SBProcess(%p)::Continue () => SBError (%p): %s",
- static_cast<void *>(process_sp.get()),
- static_cast<void *>(sb_error.get()), sstr.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_error);
}
} else
sb_error.SetErrorString("SBProcess is invalid");
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- SBStream sstr;
- sb_error.GetDescription(sstr);
- log->Printf("SBProcess(%p)::Destroy () => SBError (%p): %s",
- static_cast<void *>(process_sp.get()),
- static_cast<void *>(sb_error.get()), sstr.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_error);
}
} else
sb_error.SetErrorString("SBProcess is invalid");
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- SBStream sstr;
- sb_error.GetDescription(sstr);
- log->Printf("SBProcess(%p)::Stop () => SBError (%p): %s",
- static_cast<void *>(process_sp.get()),
- static_cast<void *>(sb_error.get()), sstr.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_error);
}
} else
sb_error.SetErrorString("SBProcess is invalid");
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- SBStream sstr;
- sb_error.GetDescription(sstr);
- log->Printf("SBProcess(%p)::Kill () => SBError (%p): %s",
- static_cast<void *>(process_sp.get()),
- static_cast<void *>(sb_error.get()), sstr.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_error);
}
sb_error.SetError(process_sp->Signal(signo));
} else
sb_error.SetErrorString("SBProcess is invalid");
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- SBStream sstr;
- sb_error.GetDescription(sstr);
- log->Printf("SBProcess(%p)::Signal (signo=%i) => SBError (%p): %s",
- static_cast<void *>(process_sp.get()), signo,
- static_cast<void *>(sb_error.get()), sstr.GetData());
- }
+
return LLDB_RECORD_RESULT(sb_error);
}
sb_thread.SetThread(thread_sp);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::GetThreadByID (tid=0x%4.4" PRIx64
- ") => SBThread (%p)",
- static_cast<void *>(process_sp.get()), tid,
- static_cast<void *>(thread_sp.get()));
-
return LLDB_RECORD_RESULT(sb_thread);
}
sb_thread.SetThread(thread_sp);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::GetThreadByID (tid=0x%x) => SBThread (%p)",
- static_cast<void *>(process_sp.get()), index_id,
- static_cast<void *>(thread_sp.get()));
-
return LLDB_RECORD_RESULT(sb_thread);
}
LLDB_RECORD_STATIC_METHOD(lldb::StateType, SBProcess, GetStateFromEvent,
(const lldb::SBEvent &), event);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
StateType ret_val = Process::ProcessEventData::GetStateFromEvent(event.get());
- if (log)
- log->Printf("SBProcess::GetStateFromEvent (event.sp=%p) => %s",
- static_cast<void *>(event.get()),
- lldb_private::StateAsCString(ret_val));
-
return ret_val;
}
LLDB_RECORD_STATIC_METHOD(bool, SBProcess, GetRestartedFromEvent,
(const lldb::SBEvent &), event);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
bool ret_val = Process::ProcessEventData::GetRestartedFromEvent(event.get());
- if (log)
- log->Printf("SBProcess::%s (event.sp=%p) => %d", __FUNCTION__,
- static_cast<void *>(event.get()), ret_val);
-
return ret_val;
}
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBBroadcaster, SBProcess,
GetBroadcaster);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ProcessSP process_sp(GetSP());
SBBroadcaster broadcaster(process_sp.get(), false);
- if (log)
- log->Printf("SBProcess(%p)::GetBroadcaster () => SBBroadcaster (%p)",
- static_cast<void *>(process_sp.get()),
- static_cast<void *>(broadcaster.get()));
return LLDB_RECORD_RESULT(broadcaster);
}
size_t SBProcess::ReadMemory(addr_t addr, void *dst, size_t dst_len,
SBError &sb_error) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
size_t bytes_read = 0;
ProcessSP process_sp(GetSP());
- if (log)
- log->Printf("SBProcess(%p)::ReadMemory (addr=0x%" PRIx64
- ", dst=%p, dst_len=%" PRIu64 ", SBError (%p))...",
- static_cast<void *>(process_sp.get()), addr,
- static_cast<void *>(dst), static_cast<uint64_t>(dst_len),
- static_cast<void *>(sb_error.get()));
if (process_sp) {
Process::StopLocker stop_locker;
process_sp->GetTarget().GetAPIMutex());
bytes_read = process_sp->ReadMemory(addr, dst, dst_len, sb_error.ref());
} else {
- if (log)
- log->Printf("SBProcess(%p)::ReadMemory() => error: process is running",
- static_cast<void *>(process_sp.get()));
sb_error.SetErrorString("process is running");
}
} else {
sb_error.SetErrorString("SBProcess is invalid");
}
- if (log) {
- SBStream sstr;
- sb_error.GetDescription(sstr);
- log->Printf("SBProcess(%p)::ReadMemory (addr=0x%" PRIx64
- ", dst=%p, dst_len=%" PRIu64 ", SBError (%p): %s) => %" PRIu64,
- static_cast<void *>(process_sp.get()), addr,
- static_cast<void *>(dst), static_cast<uint64_t>(dst_len),
- static_cast<void *>(sb_error.get()), sstr.GetData(),
- static_cast<uint64_t>(bytes_read));
- }
-
return bytes_read;
}
bytes_read = process_sp->ReadCStringFromMemory(addr, (char *)buf, size,
sb_error.ref());
} else {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::ReadCStringFromMemory() => error: process "
- "is running",
- static_cast<void *>(process_sp.get()));
sb_error.SetErrorString("process is running");
}
} else {
value = process_sp->ReadUnsignedIntegerFromMemory(addr, byte_size, 0,
sb_error.ref());
} else {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::ReadUnsignedFromMemory() => error: process "
- "is running",
- static_cast<void *>(process_sp.get()));
sb_error.SetErrorString("process is running");
}
} else {
process_sp->GetTarget().GetAPIMutex());
ptr = process_sp->ReadPointerFromMemory(addr, sb_error.ref());
} else {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::ReadPointerFromMemory() => error: process "
- "is running",
- static_cast<void *>(process_sp.get()));
sb_error.SetErrorString("process is running");
}
} else {
SBError &sb_error) {
size_t bytes_written = 0;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
ProcessSP process_sp(GetSP());
- if (log)
- log->Printf("SBProcess(%p)::WriteMemory (addr=0x%" PRIx64
- ", src=%p, src_len=%" PRIu64 ", SBError (%p))...",
- static_cast<void *>(process_sp.get()), addr,
- static_cast<const void *>(src), static_cast<uint64_t>(src_len),
- static_cast<void *>(sb_error.get()));
-
if (process_sp) {
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&process_sp->GetRunLock())) {
bytes_written =
process_sp->WriteMemory(addr, src, src_len, sb_error.ref());
} else {
- if (log)
- log->Printf("SBProcess(%p)::WriteMemory() => error: process is running",
- static_cast<void *>(process_sp.get()));
sb_error.SetErrorString("process is running");
}
}
- if (log) {
- SBStream sstr;
- sb_error.GetDescription(sstr);
- log->Printf("SBProcess(%p)::WriteMemory (addr=0x%" PRIx64
- ", src=%p, src_len=%" PRIu64 ", SBError (%p): %s) => %" PRIu64,
- static_cast<void *>(process_sp.get()), addr,
- static_cast<const void *>(src), static_cast<uint64_t>(src_len),
- static_cast<void *>(sb_error.get()), sstr.GetData(),
- static_cast<uint64_t>(bytes_written));
- }
-
return bytes_written;
}
GetNumSupportedHardwareWatchpoints,
(lldb::SBError &), sb_error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
uint32_t num = 0;
ProcessSP process_sp(GetSP());
if (process_sp) {
std::lock_guard<std::recursive_mutex> guard(
process_sp->GetTarget().GetAPIMutex());
sb_error.SetError(process_sp->GetWatchpointSupportInfo(num));
- if (log)
- log->Printf("SBProcess(%p)::GetNumSupportedHardwareWatchpoints () => %u",
- static_cast<void *>(process_sp.get()), num);
} else {
sb_error.SetErrorString("SBProcess is invalid");
}
(const lldb::SBFileSpec &, const lldb::SBFileSpec &, lldb::SBError &),
sb_local_image_spec, sb_remote_image_spec, sb_error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ProcessSP process_sp(GetSP());
if (process_sp) {
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&process_sp->GetRunLock())) {
- if (log)
- log->Printf("SBProcess(%p)::LoadImage() => calling Platform::LoadImage"
- "for: %s",
- static_cast<void *>(process_sp.get()),
- sb_local_image_spec.GetFilename());
-
std::lock_guard<std::recursive_mutex> guard(
process_sp->GetTarget().GetAPIMutex());
PlatformSP platform_sp = process_sp->GetTarget().GetPlatform();
return platform_sp->LoadImage(process_sp.get(), *sb_local_image_spec,
*sb_remote_image_spec, sb_error.ref());
} else {
- if (log)
- log->Printf("SBProcess(%p)::LoadImage() => error: process is running",
- static_cast<void *>(process_sp.get()));
sb_error.SetErrorString("process is running");
}
- } else {
- if (log)
- log->Printf("SBProcess(%p)::LoadImage() => error: called with invalid"
- " process",
- static_cast<void *>(process_sp.get()));
+ } else {
sb_error.SetErrorString("process is invalid");
}
return LLDB_INVALID_IMAGE_TOKEN;
lldb::SBFileSpec &, lldb::SBError &),
image_spec, paths, loaded_path, error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ProcessSP process_sp(GetSP());
if (process_sp) {
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&process_sp->GetRunLock())) {
- if (log)
- log->Printf("SBProcess(%p)::LoadImageUsingPaths() => "
- "calling Platform::LoadImageUsingPaths for: %s",
- static_cast<void *>(process_sp.get()),
- image_spec.GetFilename());
-
std::lock_guard<std::recursive_mutex> guard(
process_sp->GetTarget().GetAPIMutex());
PlatformSP platform_sp = process_sp->GetTarget().GetPlatform();
for (size_t i = 0; i < num_paths; i++)
paths_vec.push_back(paths.GetStringAtIndex(i));
FileSpec loaded_spec;
-
- uint32_t token = platform_sp->LoadImageUsingPaths(process_sp.get(),
- *image_spec,
- paths_vec,
- error.ref(),
- &loaded_spec);
- if (token != LLDB_INVALID_IMAGE_TOKEN)
- loaded_path = loaded_spec;
- return token;
+
+ uint32_t token = platform_sp->LoadImageUsingPaths(
+ process_sp.get(), *image_spec, paths_vec, error.ref(), &loaded_spec);
+ if (token != LLDB_INVALID_IMAGE_TOKEN)
+ loaded_path = loaded_spec;
+ return token;
} else {
- if (log)
- log->Printf("SBProcess(%p)::LoadImageUsingPaths() => error: "
- "process is running",
- static_cast<void *>(process_sp.get()));
error.SetErrorString("process is running");
}
- } else {
- if (log)
- log->Printf("SBProcess(%p)::LoadImageUsingPaths() => error: "
- "called with invalid process",
- static_cast<void *>(process_sp.get()));
+ } else {
error.SetErrorString("process is invalid");
}
-
+
return LLDB_INVALID_IMAGE_TOKEN;
}
sb_error.SetError(
platform_sp->UnloadImage(process_sp.get(), image_token));
} else {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::UnloadImage() => error: process is running",
- static_cast<void *>(process_sp.get()));
sb_error.SetErrorString("process is running");
}
} else
process_sp->GetTarget().GetAPIMutex());
sb_error.SetError(process_sp->SendEventData(event_data));
} else {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf(
- "SBProcess(%p)::SendEventData() => error: process is running",
- static_cast<void *>(process_sp.get()));
sb_error.SetErrorString("process is running");
}
} else
runtime->GetExtendedBacktraceTypes();
if (idx < names.size()) {
return names[idx].AsCString();
- } else {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBProcess(%p)::GetExtendedBacktraceTypeAtIndex() => "
- "error: requested extended backtrace name out of bounds",
- static_cast<void *>(process_sp.get()));
}
}
return NULL;
sb_error.ref() =
process_sp->GetMemoryRegionInfo(load_addr, sb_region_info.ref());
} else {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf(
- "SBProcess(%p)::GetMemoryRegionInfo() => error: process is running",
- static_cast<void *>(process_sp.get()));
sb_error.SetErrorString("process is running");
}
} else {
process_sp->GetTarget().GetAPIMutex());
process_sp->GetMemoryRegions(sb_region_list.ref());
- } else {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf(
- "SBProcess(%p)::GetMemoryRegionInfo() => error: process is running",
- static_cast<void *>(process_sp.get()));
}
return LLDB_RECORD_RESULT(sb_region_list);
#include "lldb/Target/Queue.h"
#include "lldb/Target/QueueItem.h"
#include "lldb/Target/Thread.h"
-#include "lldb/Utility/Log.h"
using namespace lldb;
using namespace lldb_private;
if (queue_sp) {
result = queue_sp->GetID();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueue(%p)::GetQueueID () => 0x%" PRIx64,
- static_cast<const void *>(this), result);
return result;
}
if (queue_sp) {
result = queue_sp->GetIndexID();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueueImpl(%p)::GetIndexID () => %d",
- static_cast<const void *>(this), result);
return result;
}
if (queue_sp.get()) {
name = queue_sp->GetName();
}
-
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueueImpl(%p)::GetName () => %s",
- static_cast<const void *>(this), name ? name : "NULL");
-
return name;
}
bool SBQueue::IsValid() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBQueue, IsValid);
- bool is_valid = m_opaque_sp->IsValid();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueue(0x%" PRIx64 ")::IsValid() == %s",
- m_opaque_sp->GetQueueID(), is_valid ? "true" : "false");
- return is_valid;
+ return m_opaque_sp->IsValid();
}
void SBQueue::Clear() {
LLDB_RECORD_METHOD_NO_ARGS(void, SBQueue, Clear);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueue(0x%" PRIx64 ")::Clear()", m_opaque_sp->GetQueueID());
m_opaque_sp->Clear();
}
lldb::queue_id_t SBQueue::GetQueueID() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::queue_id_t, SBQueue, GetQueueID);
- lldb::queue_id_t qid = m_opaque_sp->GetQueueID();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueue(0x%" PRIx64 ")::GetQueueID() == 0x%" PRIx64,
- m_opaque_sp->GetQueueID(), (uint64_t)qid);
- return qid;
+ return m_opaque_sp->GetQueueID();
}
uint32_t SBQueue::GetIndexID() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBQueue, GetIndexID);
uint32_t index_id = m_opaque_sp->GetIndexID();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueue(0x%" PRIx64 ")::GetIndexID() == 0x%" PRIx32,
- m_opaque_sp->GetQueueID(), index_id);
return index_id;
}
const char *SBQueue::GetName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBQueue, GetName);
- const char *name = m_opaque_sp->GetName();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueue(0x%" PRIx64 ")::GetName() == %s",
- m_opaque_sp->GetQueueID(), name ? name : "");
- return name;
+ return m_opaque_sp->GetName();
}
uint32_t SBQueue::GetNumThreads() {
LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBQueue, GetNumThreads);
- uint32_t numthreads = m_opaque_sp->GetNumThreads();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueue(0x%" PRIx64 ")::GetNumThreads() == %d",
- m_opaque_sp->GetQueueID(), numthreads);
- return numthreads;
+ return m_opaque_sp->GetNumThreads();
}
SBThread SBQueue::GetThreadAtIndex(uint32_t idx) {
idx);
SBThread th = m_opaque_sp->GetThreadAtIndex(idx);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueue(0x%" PRIx64 ")::GetThreadAtIndex(%d)",
- m_opaque_sp->GetQueueID(), idx);
return LLDB_RECORD_RESULT(th);
}
uint32_t SBQueue::GetNumPendingItems() {
LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBQueue, GetNumPendingItems);
- uint32_t pending_items = m_opaque_sp->GetNumPendingItems();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueue(0x%" PRIx64 ")::GetNumPendingItems() == %d",
- m_opaque_sp->GetQueueID(), pending_items);
- return pending_items;
+ return m_opaque_sp->GetNumPendingItems();
}
SBQueueItem SBQueue::GetPendingItemAtIndex(uint32_t idx) {
LLDB_RECORD_METHOD(lldb::SBQueueItem, SBQueue, GetPendingItemAtIndex,
(uint32_t), idx);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueue(0x%" PRIx64 ")::GetPendingItemAtIndex(%d)",
- m_opaque_sp->GetQueueID(), idx);
return LLDB_RECORD_RESULT(m_opaque_sp->GetPendingItemAtIndex(idx));
}
uint32_t SBQueue::GetNumRunningItems() {
LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBQueue, GetNumRunningItems);
- uint32_t running_items = m_opaque_sp->GetNumRunningItems();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueue(0x%" PRIx64 ")::GetNumRunningItems() == %d",
- m_opaque_sp->GetQueueID(), running_items);
- return running_items;
+ return m_opaque_sp->GetNumRunningItems();
}
SBProcess SBQueue::GetProcess() {
#include "lldb/Target/Process.h"
#include "lldb/Target/QueueItem.h"
#include "lldb/Target/Thread.h"
-#include "lldb/Utility/Log.h"
using namespace lldb;
using namespace lldb_private;
bool SBQueueItem::IsValid() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBQueueItem, IsValid);
- bool is_valid = m_queue_item_sp.get() != NULL;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueueItem(%p)::IsValid() == %s",
- static_cast<void *>(m_queue_item_sp.get()),
- is_valid ? "true" : "false");
- return is_valid;
+ return m_queue_item_sp.get() != NULL;
}
void SBQueueItem::Clear() {
LLDB_RECORD_METHOD_NO_ARGS(void, SBQueueItem, Clear);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBQueueItem(%p)::Clear()",
- static_cast<void *>(m_queue_item_sp.get()));
m_queue_item_sp.reset();
}
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::QueueItemKind, SBQueueItem, GetKind);
QueueItemKind result = eQueueItemKindUnknown;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (m_queue_item_sp) {
result = m_queue_item_sp->GetKind();
}
- if (log)
- log->Printf("SBQueueItem(%p)::GetKind() == %d",
- static_cast<void *>(m_queue_item_sp.get()),
- static_cast<int>(result));
return result;
}
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBAddress, SBQueueItem, GetAddress);
SBAddress result;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (m_queue_item_sp) {
result.SetAddress(&m_queue_item_sp->GetAddress());
}
- if (log) {
- StreamString sstr;
- const Address *addr = result.get();
- if (addr)
- addr->Dump(&sstr, NULL, Address::DumpStyleModuleWithFileAddress,
- Address::DumpStyleInvalid, 4);
- log->Printf("SBQueueItem(%p)::GetAddress() == SBAddress(%p): %s",
- static_cast<void *>(m_queue_item_sp.get()),
- static_cast<void *>(result.get()), sstr.GetData());
- }
return LLDB_RECORD_RESULT(result);
}
(const char *), type);
SBThread result;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (m_queue_item_sp) {
ProcessSP process_sp = m_queue_item_sp->GetProcessSP();
Process::StopLocker stop_locker;
// retains the object
process_sp->GetExtendedThreadList().AddThread(thread_sp);
result.SetThread(thread_sp);
- if (log) {
- const char *queue_name = thread_sp->GetQueueName();
- if (queue_name == NULL)
- queue_name = "";
- log->Printf(
- "SBQueueItem(%p)::GetExtendedBacktraceThread() = new extended "
- "Thread created (%p) with queue_id 0x%" PRIx64 " queue name '%s'",
- static_cast<void *>(m_queue_item_sp.get()),
- static_cast<void *>(thread_sp.get()),
- static_cast<uint64_t>(thread_sp->GetQueueID()), queue_name);
- }
}
}
}
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Utility/DataBuffer.h"
#include "lldb/Utility/DataExtractor.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
using namespace lldb;
#include "lldb/Symbol/Symbol.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Target.h"
-#include "lldb/Utility/Log.h"
using namespace lldb;
using namespace lldb_private;
if (m_opaque_ptr)
name = m_opaque_ptr->GetName().AsCString();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBSymbol(%p)::GetName () => \"%s\"",
- static_cast<void *>(m_opaque_ptr), name ? name : "");
return name;
}
.GetDisplayDemangledName(m_opaque_ptr->GetLanguage())
.AsCString();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBSymbol(%p)::GetDisplayName () => \"%s\"",
- static_cast<void *>(m_opaque_ptr), name ? name : "");
return name;
}
const char *name = NULL;
if (m_opaque_ptr)
name = m_opaque_ptr->GetMangled().GetMangledName().AsCString();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBSymbol(%p)::GetMangledName () => \"%s\"",
- static_cast<void *>(m_opaque_ptr), name ? name : "");
-
return name;
}
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/SymbolContext.h"
-#include "lldb/Utility/Log.h"
using namespace lldb;
using namespace lldb_private;
SBModule SBSymbolContext::GetModule() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBModule, SBSymbolContext, GetModule);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBModule sb_module;
ModuleSP module_sp;
if (m_opaque_up) {
sb_module.SetSP(module_sp);
}
- if (log) {
- SBStream sstr;
- sb_module.GetDescription(sstr);
- log->Printf("SBSymbolContext(%p)::GetModule () => SBModule(%p): %s",
- static_cast<void *>(m_opaque_up.get()),
- static_cast<void *>(module_sp.get()), sstr.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_module);
}
SBFunction SBSymbolContext::GetFunction() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBFunction, SBSymbolContext, GetFunction);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
Function *function = NULL;
if (m_opaque_up)
SBFunction sb_function(function);
- if (log)
- log->Printf("SBSymbolContext(%p)::GetFunction () => SBFunction(%p)",
- static_cast<void *>(m_opaque_up.get()),
- static_cast<void *>(function));
-
return LLDB_RECORD_RESULT(sb_function);
}
SBLineEntry SBSymbolContext::GetLineEntry() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBLineEntry, SBSymbolContext, GetLineEntry);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBLineEntry sb_line_entry;
if (m_opaque_up)
sb_line_entry.SetLineEntry(m_opaque_up->line_entry);
- if (log) {
- log->Printf("SBSymbolContext(%p)::GetLineEntry () => SBLineEntry(%p)",
- static_cast<void *>(m_opaque_up.get()),
- static_cast<void *>(sb_line_entry.get()));
- }
-
return LLDB_RECORD_RESULT(sb_line_entry);
}
SBSymbol SBSymbolContext::GetSymbol() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBSymbol, SBSymbolContext, GetSymbol);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
Symbol *symbol = NULL;
if (m_opaque_up)
SBSymbol sb_symbol(symbol);
- if (log)
- log->Printf("SBSymbolContext(%p)::GetSymbol () => SBSymbol(%p)",
- static_cast<void *>(m_opaque_up.get()),
- static_cast<void *>(symbol));
-
return LLDB_RECORD_RESULT(sb_symbol);
}
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/Args.h"
#include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/ProcessInfo.h"
#include "lldb/Utility/RegularExpression.h"
sb_process.SetSP(process_sp);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBTarget(%p)::GetProcess () => SBProcess(%p)",
- static_cast<void *>(target_sp.get()),
- static_cast<void *>(process_sp.get()));
-
return LLDB_RECORD_RESULT(sb_process);
}
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;
ProcessSP process_sp;
TargetSP target_sp(GetSP());
- if (log)
- log->Printf("SBTarget(%p)::Launch (argv=%p, envp=%p, stdin=%s, stdout=%s, "
- "stderr=%s, working-dir=%s, launch_flags=0x%x, "
- "stop_at_entry=%i, &error (%p))...",
- static_cast<void *>(target_sp.get()), static_cast<void *>(argv),
- static_cast<void *>(envp), stdin_path ? stdin_path : "NULL",
- stdout_path ? stdout_path : "NULL",
- stderr_path ? stderr_path : "NULL",
- working_directory ? working_directory : "NULL", launch_flags,
- stop_at_entry, static_cast<void *>(error.get()));
-
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
error.SetErrorString("SBTarget is invalid");
}
- log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API);
- if (log)
- log->Printf("SBTarget(%p)::Launch (...) => SBProcess(%p), SBError(%s)",
- static_cast<void *>(target_sp.get()),
- static_cast<void *>(sb_process.GetSP().get()),
- error.GetCString());
-
return LLDB_RECORD_RESULT(sb_process);
}
(lldb::SBLaunchInfo &, lldb::SBError &), sb_launch_info,
error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBProcess sb_process;
TargetSP target_sp(GetSP());
- if (log)
- log->Printf("SBTarget(%p)::Launch (launch_info, error)...",
- static_cast<void *>(target_sp.get()));
-
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
StateType state = eStateInvalid;
error.SetErrorString("SBTarget is invalid");
}
- log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API);
- if (log)
- log->Printf("SBTarget(%p)::Launch (...) => SBProcess(%p)",
- static_cast<void *>(target_sp.get()),
- static_cast<void *>(sb_process.GetSP().get()));
-
return LLDB_RECORD_RESULT(sb_process);
}
(lldb::SBAttachInfo &, lldb::SBError &), sb_attach_info,
error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBProcess sb_process;
TargetSP target_sp(GetSP());
- if (log)
- log->Printf("SBTarget(%p)::Attach (sb_attach_info, error)...",
- static_cast<void *>(target_sp.get()));
-
if (target_sp) {
ProcessAttachInfo &attach_info = sb_attach_info.ref();
if (attach_info.ProcessIDIsValid() && !attach_info.UserIDIsValid()) {
} else {
error.ref().SetErrorStringWithFormat(
"no process found with process ID %" PRIu64, attach_pid);
- if (log) {
- log->Printf("SBTarget(%p)::Attach (...) => error %s",
- static_cast<void *>(target_sp.get()),
- error.GetCString());
- }
return LLDB_RECORD_RESULT(sb_process);
}
}
error.SetErrorString("SBTarget is invalid");
}
- if (log)
- log->Printf("SBTarget(%p)::Attach (...) => SBProcess(%p)",
- static_cast<void *>(target_sp.get()),
- static_cast<void *>(sb_process.GetSP().get()));
-
return LLDB_RECORD_RESULT(sb_process);
}
(lldb::SBListener &, lldb::pid_t, lldb::SBError &),
listener, pid, error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBProcess sb_process;
TargetSP target_sp(GetSP());
- if (log)
- log->Printf("SBTarget(%p)::%s (listener, pid=%" PRId64 ", error)...",
- static_cast<void *>(target_sp.get()), __FUNCTION__, pid);
-
if (target_sp) {
ProcessAttachInfo attach_info;
attach_info.SetProcessID(pid);
} else
error.SetErrorString("SBTarget is invalid");
- if (log)
- log->Printf("SBTarget(%p)::%s (...) => SBProcess(%p)",
- static_cast<void *>(target_sp.get()), __FUNCTION__,
- static_cast<void *>(sb_process.GetSP().get()));
return LLDB_RECORD_RESULT(sb_process);
}
(lldb::SBListener &, const char *, bool, lldb::SBError &),
listener, name, wait_for, error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBProcess sb_process;
TargetSP target_sp(GetSP());
- if (log)
- log->Printf("SBTarget(%p)::%s (listener, name=%s, wait_for=%s, error)...",
- static_cast<void *>(target_sp.get()), __FUNCTION__, name,
- wait_for ? "true" : "false");
-
if (name && target_sp) {
ProcessAttachInfo attach_info;
attach_info.GetExecutableFile().SetFile(name, FileSpec::Style::native);
} else
error.SetErrorString("SBTarget is invalid");
- if (log)
- log->Printf("SBTarget(%p)::%s (...) => SBProcess(%p)",
- static_cast<void *>(target_sp.get()), __FUNCTION__,
- static_cast<void *>(sb_process.GetSP().get()));
return LLDB_RECORD_RESULT(sb_process);
}
(lldb::SBListener &, const char *, const char *, lldb::SBError &),
listener, url, plugin_name, error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBProcess sb_process;
ProcessSP process_sp;
TargetSP target_sp(GetSP());
- if (log)
- log->Printf("SBTarget(%p)::ConnectRemote (listener, url=%s, "
- "plugin_name=%s, error)...",
- static_cast<void *>(target_sp.get()), url, plugin_name);
-
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
if (listener.IsValid())
error.SetErrorString("SBTarget is invalid");
}
- if (log)
- log->Printf("SBTarget(%p)::ConnectRemote (...) => SBProcess(%p)",
- static_cast<void *>(target_sp.get()),
- static_cast<void *>(process_sp.get()));
return LLDB_RECORD_RESULT(sb_process);
}
exe_file_spec.SetFileSpec(exe_module->GetFileSpec());
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- log->Printf("SBTarget(%p)::GetExecutable () => SBFileSpec(%p)",
- static_cast<void *>(target_sp.get()),
- static_cast<const void *>(exe_file_spec.get()));
- }
-
return LLDB_RECORD_RESULT(exe_file_spec);
}
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;
TargetSP target_sp(GetSP());
if (target_sp && line != 0) {
skip_prologue, internal, hardware, move_to_nearest_code);
}
- if (log) {
- SBStream sstr;
- sb_bp.GetDescription(sstr);
- char path[PATH_MAX];
- sb_file_spec->GetPath(path, sizeof(path));
- log->Printf("SBTarget(%p)::BreakpointCreateByLocation ( %s:%u ) => "
- "SBBreakpoint(%p): %s",
- static_cast<void *>(target_sp.get()), path, line,
- static_cast<void *>(sb_bp.GetSP().get()), sstr.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_bp);
}
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;
TargetSP target_sp(GetSP());
if (target_sp.get()) {
}
}
- if (log)
- log->Printf("SBTarget(%p)::BreakpointCreateByName (symbol=\"%s\", "
- "module=\"%s\") => SBBreakpoint(%p)",
- static_cast<void *>(target_sp.get()), symbol_name, module_name,
- static_cast<void *>(sb_bp.GetSP().get()));
-
return LLDB_RECORD_RESULT(sb_bp);
}
symbol_name, name_type_mask, symbol_language, module_list,
comp_unit_list);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBBreakpoint sb_bp;
TargetSP target_sp(GetSP());
if (target_sp && symbol_name && symbol_name[0]) {
skip_prologue, internal, hardware);
}
- if (log)
- log->Printf("SBTarget(%p)::BreakpointCreateByName (symbol=\"%s\", "
- "name_type: %d) => SBBreakpoint(%p)",
- static_cast<void *>(target_sp.get()), symbol_name,
- name_type_mask, static_cast<void *>(sb_bp.GetSP().get()));
-
return LLDB_RECORD_RESULT(sb_bp);
}
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;
TargetSP target_sp(GetSP());
if (target_sp && num_names > 0) {
symbol_language, offset, skip_prologue, internal, hardware);
}
- if (log) {
- log->Printf("SBTarget(%p)::BreakpointCreateByName (symbols={",
- static_cast<void *>(target_sp.get()));
- for (uint32_t i = 0; i < num_names; i++) {
- char sep;
- if (i < num_names - 1)
- sep = ',';
- else
- sep = '}';
- if (symbol_names[i] != NULL)
- log->Printf("\"%s\"%c ", symbol_names[i], sep);
- else
- log->Printf("\"<NULL>\"%c ", sep);
- }
- log->Printf("name_type: %d) => SBBreakpoint(%p)", name_type_mask,
- static_cast<void *>(sb_bp.GetSP().get()));
- }
-
return LLDB_RECORD_RESULT(sb_bp);
}
const lldb::SBFileSpecList &),
symbol_name_regex, symbol_language, module_list, comp_unit_list);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBBreakpoint sb_bp;
TargetSP target_sp(GetSP());
skip_prologue, internal, hardware);
}
- if (log)
- log->Printf("SBTarget(%p)::BreakpointCreateByRegex (symbol_regex=\"%s\") "
- "=> SBBreakpoint(%p)",
- static_cast<void *>(target_sp.get()), symbol_name_regex,
- static_cast<void *>(sb_bp.GetSP().get()));
-
return LLDB_RECORD_RESULT(sb_bp);
}
LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateByAddress,
(lldb::addr_t), address);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBBreakpoint sb_bp;
TargetSP target_sp(GetSP());
if (target_sp) {
sb_bp = target_sp->CreateBreakpoint(address, false, hardware);
}
- if (log)
- log->Printf("SBTarget(%p)::BreakpointCreateByAddress (address=%" PRIu64
- ") => SBBreakpoint(%p)",
- static_cast<void *>(target_sp.get()),
- static_cast<uint64_t>(address),
- static_cast<void *>(sb_bp.GetSP().get()));
-
return LLDB_RECORD_RESULT(sb_bp);
}
LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, BreakpointCreateBySBAddress,
(lldb::SBAddress &), sb_address);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBBreakpoint sb_bp;
TargetSP target_sp(GetSP());
if (!sb_address.IsValid()) {
- if (log)
- log->Printf("SBTarget(%p)::BreakpointCreateBySBAddress called with "
- "invalid address",
- static_cast<void *>(target_sp.get()));
return LLDB_RECORD_RESULT(sb_bp);
}
sb_bp = target_sp->CreateBreakpoint(sb_address.ref(), false, hardware);
}
- if (log) {
- SBStream s;
- sb_address.GetDescription(s);
- log->Printf("SBTarget(%p)::BreakpointCreateBySBAddress (address=%s) => "
- "SBBreakpoint(%p)",
- static_cast<void *>(target_sp.get()), s.GetData(),
- static_cast<void *>(sb_bp.GetSP().get()));
- }
-
return LLDB_RECORD_RESULT(sb_bp);
}
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;
TargetSP target_sp(GetSP());
if (target_sp && source_regex && source_regex[0]) {
false, hardware, move_to_nearest_code);
}
- if (log)
- log->Printf("SBTarget(%p)::BreakpointCreateByRegex (source_regex=\"%s\") "
- "=> SBBreakpoint(%p)",
- static_cast<void *>(target_sp.get()), source_regex,
- static_cast<void *>(sb_bp.GetSP().get()));
-
return LLDB_RECORD_RESULT(sb_bp);
}
(lldb::LanguageType, bool, bool), language, catch_bp,
throw_bp);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBBreakpoint sb_bp;
TargetSP target_sp(GetSP());
if (target_sp) {
hardware);
}
- if (log)
- log->Printf("SBTarget(%p)::BreakpointCreateForException (Language: %s, catch: "
- "%s throw: %s) => SBBreakpoint(%p)",
- static_cast<void *>(target_sp.get()),
- Language::GetNameForLanguageType(language),
- catch_bp ? "on" : "off", throw_bp ? "on" : "off",
- static_cast<void *>(sb_bp.GetSP().get()));
-
return LLDB_RECORD_RESULT(sb_bp);
}
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;
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
Status error;
-
+
StructuredData::ObjectSP obj_sp = extra_args.m_impl_up->GetObjectSP();
sb_bp =
target_sp->CreateScriptedBreakpoint(class_name,
obj_sp,
&error);
}
- if (log)
- log->Printf("SBTarget(%p)::BreakpointCreateFromScript (class name: %s) "
- " => SBBreakpoint(%p)",
- static_cast<void *>(target_sp.get()),
- class_name,
- static_cast<void *>(sb_bp.GetSP().get()));
return LLDB_RECORD_RESULT(sb_bp);
}
LLDB_RECORD_METHOD(bool, SBTarget, BreakpointDelete, (lldb::break_id_t),
bp_id);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
bool result = false;
TargetSP target_sp(GetSP());
if (target_sp) {
result = target_sp->RemoveBreakpointByID(bp_id);
}
- if (log)
- log->Printf("SBTarget(%p)::BreakpointDelete (bp_id=%d) => %i",
- static_cast<void *>(target_sp.get()),
- static_cast<uint32_t>(bp_id), result);
-
return result;
}
LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBTarget, FindBreakpointByID,
(lldb::break_id_t), bp_id);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBBreakpoint sb_breakpoint;
TargetSP target_sp(GetSP());
if (target_sp && bp_id != LLDB_INVALID_BREAK_ID) {
sb_breakpoint = target_sp->GetBreakpointByID(bp_id);
}
- if (log)
- log->Printf(
- "SBTarget(%p)::FindBreakpointByID (bp_id=%d) => SBBreakpoint(%p)",
- static_cast<void *>(target_sp.get()), static_cast<uint32_t>(bp_id),
- static_cast<void *>(sb_breakpoint.GetSP().get()));
-
return LLDB_RECORD_RESULT(sb_breakpoint);
}
LLDB_RECORD_METHOD(bool, SBTarget, DeleteWatchpoint, (lldb::watch_id_t),
wp_id);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool result = false;
TargetSP target_sp(GetSP());
result = target_sp->RemoveWatchpointByID(wp_id);
}
- if (log)
- log->Printf("SBTarget(%p)::WatchpointDelete (wp_id=%d) => %i",
- static_cast<void *>(target_sp.get()),
- static_cast<uint32_t>(wp_id), result);
-
return result;
}
LLDB_RECORD_METHOD(lldb::SBWatchpoint, SBTarget, FindWatchpointByID,
(lldb::watch_id_t), wp_id);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBWatchpoint sb_watchpoint;
lldb::WatchpointSP watchpoint_sp;
sb_watchpoint.SetSP(watchpoint_sp);
}
- if (log)
- log->Printf(
- "SBTarget(%p)::FindWatchpointByID (bp_id=%d) => SBWatchpoint(%p)",
- static_cast<void *>(target_sp.get()), static_cast<uint32_t>(wp_id),
- static_cast<void *>(watchpoint_sp.get()));
-
return LLDB_RECORD_RESULT(sb_watchpoint);
}
(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;
lldb::WatchpointSP watchpoint_sp;
TargetSP target_sp(GetSP());
sb_watchpoint.SetSP(watchpoint_sp);
}
- if (log)
- log->Printf("SBTarget(%p)::WatchAddress (addr=0x%" PRIx64
- ", 0x%u) => SBWatchpoint(%p)",
- static_cast<void *>(target_sp.get()), addr,
- static_cast<uint32_t>(size),
- static_cast<void *>(watchpoint_sp.get()));
-
return LLDB_RECORD_RESULT(sb_watchpoint);
}
exe_ctx, ast_type);
}
sb_value.SetSP(new_value_sp);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (new_value_sp)
- log->Printf("SBTarget(%p)::CreateValueFromAddress => \"%s\"",
- static_cast<void *>(m_opaque_sp.get()),
- new_value_sp->GetName().AsCString());
- else
- log->Printf("SBTarget(%p)::CreateValueFromAddress => NULL",
- static_cast<void *>(m_opaque_sp.get()));
- }
return LLDB_RECORD_RESULT(sb_value);
}
exe_ctx, ast_type);
}
sb_value.SetSP(new_value_sp);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (new_value_sp)
- log->Printf("SBTarget(%p)::CreateValueFromData => \"%s\"",
- static_cast<void *>(m_opaque_sp.get()),
- new_value_sp->GetName().AsCString());
- else
- log->Printf("SBTarget(%p)::CreateValueFromData => NULL",
- static_cast<void *>(m_opaque_sp.get()));
- }
return LLDB_RECORD_RESULT(sb_value);
}
ValueObject::CreateValueObjectFromExpression(name, expr, exe_ctx);
}
sb_value.SetSP(new_value_sp);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (new_value_sp)
- log->Printf("SBTarget(%p)::CreateValueFromExpression => \"%s\"",
- static_cast<void *>(m_opaque_sp.get()),
- new_value_sp->GetName().AsCString());
- else
- log->Printf("SBTarget(%p)::CreateValueFromExpression => NULL",
- static_cast<void *>(m_opaque_sp.get()));
- }
return LLDB_RECORD_RESULT(sb_value);
}
if (!csTo)
return error.SetErrorString("<to> path can't be empty");
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBTarget(%p)::%s: '%s' -> '%s'",
- static_cast<void *>(target_sp.get()), __FUNCTION__,
- from, to);
target_sp->GetImageSearchPathList().Append(csFrom, csTo, true);
}
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;
TargetSP target_sp(GetSP());
if (target_sp) {
num = target_sp->GetImages().GetSize();
}
- if (log)
- log->Printf("SBTarget(%p)::GetNumModules () => %d",
- static_cast<void *>(target_sp.get()), num);
-
return num;
}
void SBTarget::Clear() {
LLDB_RECORD_METHOD_NO_ARGS(void, SBTarget, Clear);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log)
- log->Printf("SBTarget(%p)::Clear ()",
- static_cast<void *>(m_opaque_sp.get()));
-
m_opaque_sp.reset();
}
LLDB_RECORD_METHOD(lldb::SBModule, SBTarget, GetModuleAtIndex, (uint32_t),
idx);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBModule sb_module;
ModuleSP module_sp;
TargetSP target_sp(GetSP());
sb_module.SetSP(module_sp);
}
- if (log)
- log->Printf("SBTarget(%p)::GetModuleAtIndex (idx=%d) => SBModule(%p)",
- static_cast<void *>(target_sp.get()), idx,
- static_cast<void *>(module_sp.get()));
-
return LLDB_RECORD_RESULT(sb_module);
}
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBBroadcaster, SBTarget,
GetBroadcaster);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
TargetSP target_sp(GetSP());
SBBroadcaster broadcaster(target_sp.get(), false);
- if (log)
- log->Printf("SBTarget(%p)::GetBroadcaster () => SBBroadcaster(%p)",
- static_cast<void *>(target_sp.get()),
- static_cast<void *>(broadcaster.get()));
return LLDB_RECORD_RESULT(broadcaster);
}
(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));
#endif
StackFrame *frame = NULL;
if (target_sp) {
if (expr == NULL || expr[0] == '\0') {
- if (log)
- log->Printf(
- "SBTarget::EvaluateExpression called with an empty expression");
return LLDB_RECORD_RESULT(expr_result);
}
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
ExecutionContext exe_ctx(m_opaque_sp.get());
- if (log)
- log->Printf("SBTarget()::EvaluateExpression (expr=\"%s\")...", expr);
frame = exe_ctx.GetFramePtr();
Target *target = exe_ctx.GetTargetPtr();
target->EvaluateExpression(expr, frame, expr_value_sp, options.ref());
expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue());
- } else {
- if (log)
- log->Printf("SBTarget::EvaluateExpression () => error: could not "
- "reconstruct frame object for this SBTarget.");
}
}
#ifndef LLDB_DISABLE_PYTHON
expr_log->Printf("** [SBTarget::EvaluateExpression] Expression result is "
"%s, summary %s **",
expr_result.GetValue(), expr_result.GetSummary());
-
- if (log)
- log->Printf("SBTarget(%p)::EvaluateExpression (expr=\"%s\") => SBValue(%p) "
- "(execution result=%d)",
- static_cast<void *>(frame), expr,
- static_cast<void *>(expr_value_sp.get()), exe_results);
#endif
return LLDB_RECORD_RESULT(expr_result);
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (exe_ctx.HasThreadScope()) {
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock())) {
if (queue_sp) {
sb_queue.SetQueue(queue_sp);
}
- } else {
- if (log)
- log->Printf("SBThread(%p)::GetQueue() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
- if (log)
- log->Printf("SBThread(%p)::GetQueue () => SBQueue(%p)",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- static_cast<void *>(queue_sp.get()));
-
return LLDB_RECORD_RESULT(sb_queue);
}
StopReason SBThread::GetStopReason() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::StopReason, SBThread, GetStopReason);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
StopReason reason = eStopReasonInvalid;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock())) {
return exe_ctx.GetThreadPtr()->GetStopReason();
- } else {
- if (log)
- log->Printf(
- "SBThread(%p)::GetStopReason() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
- if (log)
- log->Printf("SBThread(%p)::GetStopReason () => %s",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- Thread::StopReasonAsCString(reason));
-
return reason;
}
return 1;
}
}
- } else {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBThread(%p)::GetStopReasonDataCount() => error: process "
- "is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
return 0;
return stop_info_sp->GetValue();
}
}
- } else {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBThread(%p)::GetStopReasonDataAtIndex() => error: "
- "process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
return 0;
LLDB_RECORD_METHOD(size_t, SBThread, GetStopDescription, (char *, size_t),
dst, dst_len);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
if (stop_info_sp) {
const char *stop_desc = stop_info_sp->GetDescription();
if (stop_desc) {
- if (log)
- log->Printf(
- "SBThread(%p)::GetStopDescription (dst, dst_len) => \"%s\"",
- static_cast<void *>(exe_ctx.GetThreadPtr()), stop_desc);
if (dst)
return ::snprintf(dst, dst_len, "%s", stop_desc);
else {
}
if (stop_desc && stop_desc[0]) {
- if (log)
- log->Printf(
- "SBThread(%p)::GetStopDescription (dst, dst_len) => '%s'",
- static_cast<void *>(exe_ctx.GetThreadPtr()), stop_desc);
-
if (dst)
return ::snprintf(dst, dst_len, "%s", stop_desc) +
1; // Include the NULL byte
}
}
}
- } else {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf(
- "SBThread(%p)::GetStopDescription() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
if (dst)
SBValue SBThread::GetStopReturnValue() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBValue, SBThread, GetStopReturnValue);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ValueObjectSP return_valobj_sp;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
if (stop_info_sp) {
return_valobj_sp = StopInfo::GetReturnValueObject(stop_info_sp);
}
- } else {
- if (log)
- log->Printf(
- "SBThread(%p)::GetStopReturnValue() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
- if (log)
- log->Printf("SBThread(%p)::GetStopReturnValue () => %s",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- return_valobj_sp.get() ? return_valobj_sp->GetValueAsCString()
- : "<no return value>");
-
return LLDB_RECORD_RESULT(SBValue(return_valobj_sp));
}
const char *SBThread::GetName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBThread, GetName);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *name = NULL;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock())) {
name = exe_ctx.GetThreadPtr()->GetName();
- } else {
- if (log)
- log->Printf("SBThread(%p)::GetName() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
- if (log)
- log->Printf("SBThread(%p)::GetName () => %s",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- name ? name : "NULL");
-
return name;
}
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (exe_ctx.HasThreadScope()) {
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock())) {
name = exe_ctx.GetThreadPtr()->GetQueueName();
- } else {
- if (log)
- log->Printf("SBThread(%p)::GetQueueName() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
- if (log)
- log->Printf("SBThread(%p)::GetQueueName () => %s",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- name ? name : "NULL");
-
return name;
}
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (exe_ctx.HasThreadScope()) {
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock())) {
id = exe_ctx.GetThreadPtr()->GetQueueID();
- } else {
- if (log)
- log->Printf("SBThread(%p)::GetQueueID() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
- if (log)
- log->Printf("SBThread(%p)::GetQueueID () => 0x%" PRIx64,
- static_cast<void *>(exe_ctx.GetThreadPtr()), id);
-
return id;
}
LLDB_RECORD_METHOD(bool, SBThread, GetInfoItemByPathAsString,
(const char *, lldb::SBStream &), path, strm);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool success = false;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
}
}
}
- } else {
- if (log)
- log->Printf("SBThread(%p)::GetInfoItemByPathAsString() => error: "
- "process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
- if (log)
- log->Printf("SBThread(%p)::GetInfoItemByPathAsString (\"%s\") => \"%s\"",
- static_cast<void *>(exe_ctx.GetThreadPtr()), path, strm.GetData());
-
return success;
}
LLDB_RECORD_METHOD(void, SBThread, StepOver, (lldb::RunMode, lldb::SBError &),
stop_other_threads, error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- if (log)
- log->Printf("SBThread(%p)::StepOver (stop_other_threads='%s')",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- Thread::RunModeAsCString(stop_other_threads));
-
if (!exe_ctx.HasThreadScope()) {
error.SetErrorString("this SBThread object is invalid");
return;
(const char *, uint32_t, lldb::SBError &, lldb::RunMode),
target_name, end_line, error, stop_other_threads);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- if (log)
- log->Printf(
- "SBThread(%p)::StepInto (target_name='%s', stop_other_threads='%s')",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- target_name ? target_name : "<NULL>",
- Thread::RunModeAsCString(stop_other_threads));
-
if (!exe_ctx.HasThreadScope()) {
error.SetErrorString("this SBThread object is invalid");
return;
void SBThread::StepOut(SBError &error) {
LLDB_RECORD_METHOD(void, SBThread, StepOut, (lldb::SBError &), error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- if (log)
- log->Printf("SBThread(%p)::StepOut ()",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
-
if (!exe_ctx.HasThreadScope()) {
error.SetErrorString("this SBThread object is invalid");
return;
LLDB_RECORD_METHOD(void, SBThread, StepOutOfFrame,
(lldb::SBFrame &, lldb::SBError &), sb_frame, error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
if (!sb_frame.IsValid()) {
- if (log)
- log->Printf(
- "SBThread(%p)::StepOutOfFrame passed an invalid frame, returning.",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
error.SetErrorString("passed invalid SBFrame object");
return;
}
StackFrameSP frame_sp(sb_frame.GetFrameSP());
- if (log) {
- SBStream frame_desc_strm;
- sb_frame.GetDescription(frame_desc_strm);
- log->Printf("SBThread(%p)::StepOutOfFrame (frame = SBFrame(%p): %s)",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- static_cast<void *>(frame_sp.get()), frame_desc_strm.GetData());
- }
if (!exe_ctx.HasThreadScope()) {
error.SetErrorString("this SBThread object is invalid");
bool stop_other_threads = false;
Thread *thread = exe_ctx.GetThreadPtr();
if (sb_frame.GetThread().GetThreadID() != thread->GetID()) {
- log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from another "
- "thread (0x%" PRIx64 " vrs. 0x%" PRIx64 ", returning.",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- sb_frame.GetThread().GetThreadID(), thread->GetID());
error.SetErrorString("passed a frame from another thread");
return;
}
LLDB_RECORD_METHOD(void, SBThread, StepInstruction, (bool, lldb::SBError &),
step_over, error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- if (log)
- log->Printf("SBThread(%p)::StepInstruction (step_over=%i)",
- static_cast<void *>(exe_ctx.GetThreadPtr()), step_over);
-
if (!exe_ctx.HasThreadScope()) {
error.SetErrorString("this SBThread object is invalid");
return;
LLDB_RECORD_METHOD(void, SBThread, RunToAddress,
(lldb::addr_t, lldb::SBError &), addr, error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- if (log)
- log->Printf("SBThread(%p)::RunToAddress (addr=0x%" PRIx64 ")",
- static_cast<void *>(exe_ctx.GetThreadPtr()), addr);
-
if (!exe_ctx.HasThreadScope()) {
error.SetErrorString("this SBThread object is invalid");
return;
sb_file_spec, line);
SBError sb_error;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
char path[PATH_MAX];
std::unique_lock<std::recursive_mutex> lock;
StackFrameSP frame_sp(sb_frame.GetFrameSP());
- if (log) {
- SBStream frame_desc_strm;
- sb_frame.GetDescription(frame_desc_strm);
- sb_file_spec->GetPath(path, sizeof(path));
- log->Printf("SBThread(%p)::StepOverUntil (frame = SBFrame(%p): %s, "
- "file+line = %s:%u)",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- static_cast<void *>(frame_sp.get()), frame_desc_strm.GetData(),
- path, line);
- }
-
if (exe_ctx.HasThreadScope()) {
Target *target = exe_ctx.GetTargetPtr();
Thread *thread = exe_ctx.GetThreadPtr();
(const char *, bool), script_class_name,
resume_immediately);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBError error;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- if (log) {
- log->Printf("SBThread(%p)::StepUsingScriptedThreadPlan: class name: %s",
- static_cast<void *>(exe_ctx.GetThreadPtr()), script_class_name);
- }
-
if (!exe_ctx.HasThreadScope()) {
error.SetErrorString("this SBThread object is invalid");
return LLDB_RECORD_RESULT(error);
LLDB_RECORD_METHOD(lldb::SBError, SBThread, JumpToLine,
(lldb::SBFileSpec &, uint32_t), file_spec, line);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBError sb_error;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- if (log)
- log->Printf("SBThread(%p)::JumpToLine (file+line = %s:%u)",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- file_spec->GetPath().c_str(), line);
-
if (!exe_ctx.HasThreadScope()) {
sb_error.SetErrorString("this SBThread object is invalid");
return LLDB_RECORD_RESULT(sb_error);
SBError sb_error;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- if (log)
- log->Printf("SBThread(%p)::ReturnFromFrame (frame=%d)",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- frame.GetFrameID());
-
if (exe_ctx.HasThreadScope()) {
Thread *thread = exe_ctx.GetThreadPtr();
sb_error.SetError(
SBError sb_error;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
- if (log)
- log->Printf("SBThread(%p)::UnwindExpressionEvaluation",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
-
if (exe_ctx.HasThreadScope()) {
Thread *thread = exe_ctx.GetThreadPtr();
sb_error.SetError(thread->UnwindInnermostExpression());
bool SBThread::Suspend(SBError &error) {
LLDB_RECORD_METHOD(bool, SBThread, Suspend, (lldb::SBError &), error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
result = true;
} else {
error.SetErrorString("process is running");
- if (log)
- log->Printf("SBThread(%p)::Suspend() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
} else
error.SetErrorString("this SBThread object is invalid");
- if (log)
- log->Printf("SBThread(%p)::Suspend() => %i",
- static_cast<void *>(exe_ctx.GetThreadPtr()), result);
return result;
}
bool SBThread::Resume(SBError &error) {
LLDB_RECORD_METHOD(bool, SBThread, Resume, (lldb::SBError &), error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
result = true;
} else {
error.SetErrorString("process is running");
- if (log)
- log->Printf("SBThread(%p)::Resume() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
} else
error.SetErrorString("this SBThread object is invalid");
- if (log)
- log->Printf("SBThread(%p)::Resume() => %i",
- static_cast<void *>(exe_ctx.GetThreadPtr()), result);
return result;
}
sb_process.SetSP(exe_ctx.GetProcessSP());
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- SBStream frame_desc_strm;
- sb_process.GetDescription(frame_desc_strm);
- log->Printf("SBThread(%p)::GetProcess () => SBProcess(%p): %s",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- static_cast<void *>(sb_process.GetSP().get()),
- frame_desc_strm.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_process);
}
uint32_t SBThread::GetNumFrames() {
LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBThread, GetNumFrames);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
uint32_t num_frames = 0;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock())) {
num_frames = exe_ctx.GetThreadPtr()->GetStackFrameCount();
- } else {
- if (log)
- log->Printf("SBThread(%p)::GetNumFrames() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
- if (log)
- log->Printf("SBThread(%p)::GetNumFrames () => %u",
- static_cast<void *>(exe_ctx.GetThreadPtr()), num_frames);
-
return num_frames;
}
SBFrame SBThread::GetFrameAtIndex(uint32_t idx) {
LLDB_RECORD_METHOD(lldb::SBFrame, SBThread, GetFrameAtIndex, (uint32_t), idx);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBFrame sb_frame;
StackFrameSP frame_sp;
std::unique_lock<std::recursive_mutex> lock;
if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock())) {
frame_sp = exe_ctx.GetThreadPtr()->GetStackFrameAtIndex(idx);
sb_frame.SetFrameSP(frame_sp);
- } else {
- if (log)
- log->Printf(
- "SBThread(%p)::GetFrameAtIndex() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
- if (log) {
- SBStream frame_desc_strm;
- sb_frame.GetDescription(frame_desc_strm);
- log->Printf("SBThread(%p)::GetFrameAtIndex (idx=%d) => SBFrame(%p): %s",
- static_cast<void *>(exe_ctx.GetThreadPtr()), idx,
- static_cast<void *>(frame_sp.get()), frame_desc_strm.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_frame);
}
lldb::SBFrame SBThread::GetSelectedFrame() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBFrame, SBThread, GetSelectedFrame);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBFrame sb_frame;
StackFrameSP frame_sp;
std::unique_lock<std::recursive_mutex> lock;
if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock())) {
frame_sp = exe_ctx.GetThreadPtr()->GetSelectedFrame();
sb_frame.SetFrameSP(frame_sp);
- } else {
- if (log)
- log->Printf(
- "SBThread(%p)::GetSelectedFrame() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
- if (log) {
- SBStream frame_desc_strm;
- sb_frame.GetDescription(frame_desc_strm);
- log->Printf("SBThread(%p)::GetSelectedFrame () => SBFrame(%p): %s",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- static_cast<void *>(frame_sp.get()), frame_desc_strm.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_frame);
}
LLDB_RECORD_METHOD(lldb::SBFrame, SBThread, SetSelectedFrame, (uint32_t),
idx);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
SBFrame sb_frame;
StackFrameSP frame_sp;
std::unique_lock<std::recursive_mutex> lock;
thread->SetSelectedFrame(frame_sp.get());
sb_frame.SetFrameSP(frame_sp);
}
- } else {
- if (log)
- log->Printf(
- "SBThread(%p)::SetSelectedFrame() => error: process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
- if (log) {
- SBStream frame_desc_strm;
- sb_frame.GetDescription(frame_desc_strm);
- log->Printf("SBThread(%p)::SetSelectedFrame (idx=%u) => SBFrame(%p): %s",
- static_cast<void *>(exe_ctx.GetThreadPtr()), idx,
- static_cast<void *>(frame_sp.get()), frame_desc_strm.GetData());
- }
return LLDB_RECORD_RESULT(sb_frame);
}
LLDB_RECORD_METHOD(lldb::SBThread, SBThread, GetExtendedBacktraceThread,
(const char *), type);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
SBThread sb_origin_thread;
// pointer retains the object.
process->GetExtendedThreadList().AddThread(new_thread_sp);
sb_origin_thread.SetThread(new_thread_sp);
- if (log) {
- const char *queue_name = new_thread_sp->GetQueueName();
- if (queue_name == NULL)
- queue_name = "";
- log->Printf("SBThread(%p)::GetExtendedBacktraceThread() => new "
- "extended Thread "
- "created (%p) with queue_id 0x%" PRIx64
- " queue name '%s'",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- static_cast<void *>(new_thread_sp.get()),
- new_thread_sp->GetQueueID(), queue_name);
- }
}
}
}
}
- } else {
- if (log)
- log->Printf("SBThread(%p)::GetExtendedBacktraceThread() => error: "
- "process is running",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
}
}
- if (log && !sb_origin_thread.IsValid())
- log->Printf("SBThread(%p)::GetExtendedBacktraceThread() is not returning a "
- "Valid thread",
- static_cast<void *>(exe_ctx.GetThreadPtr()));
return LLDB_RECORD_RESULT(sb_origin_thread);
}
#include "SBReproducerPrivate.h"
#include "lldb/Target/Process.h"
-#include "lldb/Utility/Log.h"
#include "lldb/API/SBTrace.h"
#include "lldb/API/SBTraceOptions.h"
size_t SBTrace::GetTraceData(SBError &error, void *buf, size_t size,
size_t offset, lldb::tid_t thread_id) {
ProcessSP process_sp(GetSP());
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
llvm::MutableArrayRef<uint8_t> buffer(static_cast<uint8_t *>(buf), size);
error.Clear();
} else {
error.SetError(
process_sp->GetData(GetTraceUID(), thread_id, buffer, offset));
- LLDB_LOG(log, "SBTrace::bytes_read - {0}", buffer.size());
}
return buffer.size();
}
size_t SBTrace::GetMetaData(SBError &error, void *buf, size_t size,
size_t offset, lldb::tid_t thread_id) {
ProcessSP process_sp(GetSP());
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
llvm::MutableArrayRef<uint8_t> buffer(static_cast<uint8_t *>(buf), size);
error.Clear();
if (!process_sp) {
error.SetErrorString("invalid process");
} else {
-
error.SetError(
process_sp->GetMetaData(GetTraceUID(), thread_id, buffer, offset));
- LLDB_LOG(log, "SBTrace::bytes_read - {0}", buffer.size());
}
return buffer.size();
}
#include "lldb/Symbol/Type.h"
#include "lldb/Symbol/TypeSystem.h"
#include "lldb/Utility/ConstString.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include "llvm/ADT/APSInt.h"
#include "lldb/Target/Platform.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/UnixSignals.h"
-#include "lldb/Utility/Log.h"
#include "lldb/lldb-defines.h"
#include "lldb/API/SBUnixSignals.h"
LLDB_RECORD_METHOD(bool, SBUnixSignals, SetShouldSuppress, (int32_t, bool),
signo, value);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
auto signals_sp = GetSP();
- if (log) {
- log->Printf("SBUnixSignals(%p)::SetShouldSuppress (signo=%d, value=%d)",
- static_cast<void *>(signals_sp.get()), signo, value);
- }
-
if (signals_sp)
return signals_sp->SetShouldSuppress(signo, value);
LLDB_RECORD_METHOD(bool, SBUnixSignals, SetShouldStop, (int32_t, bool), signo,
value);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
auto signals_sp = GetSP();
- if (log) {
- log->Printf("SBUnixSignals(%p)::SetShouldStop (signo=%d, value=%d)",
- static_cast<void *>(signals_sp.get()), signo, value);
- }
-
if (signals_sp)
return signals_sp->SetShouldStop(signo, value);
LLDB_RECORD_METHOD(bool, SBUnixSignals, SetShouldNotify, (int32_t, bool),
signo, value);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
auto signals_sp = GetSP();
- if (log) {
- log->Printf("SBUnixSignals(%p)::SetShouldNotify (signo=%d, value=%d)",
- static_cast<void *>(signals_sp.get()), signo, value);
- }
-
if (signals_sp)
return signals_sp->SetShouldNotify(signo, value);
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/DataExtractor.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/Scalar.h"
#include "lldb/Utility/Stream.h"
lldb::ValueObjectSP GetSP(Process::StopLocker &stop_locker,
std::unique_lock<std::recursive_mutex> &lock,
Status &error) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (!m_valobj_sp) {
error.SetErrorString("invalid value object");
return m_valobj_sp;
// We don't allow people to play around with ValueObject if the process
// is running. If you want to look at values, pause the process, then
// look.
- if (log)
- log->Printf("SBValue(%p)::GetSP() => error: process is running",
- static_cast<void *>(value_sp.get()));
error.SetErrorString("process must be stopped.");
return ValueObjectSP();
}
if (value_sp)
name = value_sp->GetName().GetCString();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (name)
- log->Printf("SBValue(%p)::GetName () => \"%s\"",
- static_cast<void *>(value_sp.get()), name);
- else
- log->Printf("SBValue(%p)::GetName () => NULL",
- static_cast<void *>(value_sp.get()));
- }
-
return name;
}
const char *SBValue::GetTypeName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetTypeName);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *name = NULL;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
name = value_sp->GetQualifiedTypeName().GetCString();
}
- if (log) {
- if (name)
- log->Printf("SBValue(%p)::GetTypeName () => \"%s\"",
- static_cast<void *>(value_sp.get()), name);
- else
- log->Printf("SBValue(%p)::GetTypeName () => NULL",
- static_cast<void *>(value_sp.get()));
- }
-
return name;
}
const char *SBValue::GetDisplayTypeName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetDisplayTypeName);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *name = NULL;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
name = value_sp->GetDisplayTypeName().GetCString();
}
- if (log) {
- if (name)
- log->Printf("SBValue(%p)::GetTypeName () => \"%s\"",
- static_cast<void *>(value_sp.get()), name);
- else
- log->Printf("SBValue(%p)::GetTypeName () => NULL",
- static_cast<void *>(value_sp.get()));
- }
-
return name;
}
size_t SBValue::GetByteSize() {
LLDB_RECORD_METHOD_NO_ARGS(size_t, SBValue, GetByteSize);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
size_t result = 0;
ValueLocker locker;
result = value_sp->GetByteSize();
}
- if (log)
- log->Printf("SBValue(%p)::GetByteSize () => %" PRIu64,
- static_cast<void *>(value_sp.get()),
- static_cast<uint64_t>(result));
-
return result;
}
result = value_sp->IsInScope();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBValue(%p)::IsInScope () => %i",
- static_cast<void *>(value_sp.get()), result);
-
return result;
}
const char *SBValue::GetValue() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetValue);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
const char *cstr = NULL;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
cstr = value_sp->GetValueAsCString();
}
- if (log) {
- if (cstr)
- log->Printf("SBValue(%p)::GetValue() => \"%s\"",
- static_cast<void *>(value_sp.get()), cstr);
- else
- log->Printf("SBValue(%p)::GetValue() => NULL",
- static_cast<void *>(value_sp.get()));
- }
return cstr;
}
if (value_sp)
result = value_sp->GetValueType();
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- switch (result) {
- case eValueTypeInvalid:
- log->Printf("SBValue(%p)::GetValueType () => eValueTypeInvalid",
- static_cast<void *>(value_sp.get()));
- break;
- case eValueTypeVariableGlobal:
- log->Printf("SBValue(%p)::GetValueType () => eValueTypeVariableGlobal",
- static_cast<void *>(value_sp.get()));
- break;
- case eValueTypeVariableStatic:
- log->Printf("SBValue(%p)::GetValueType () => eValueTypeVariableStatic",
- static_cast<void *>(value_sp.get()));
- break;
- case eValueTypeVariableArgument:
- log->Printf("SBValue(%p)::GetValueType () => eValueTypeVariableArgument",
- static_cast<void *>(value_sp.get()));
- break;
- case eValueTypeVariableLocal:
- log->Printf("SBValue(%p)::GetValueType () => eValueTypeVariableLocal",
- static_cast<void *>(value_sp.get()));
- break;
- case eValueTypeRegister:
- log->Printf("SBValue(%p)::GetValueType () => eValueTypeRegister",
- static_cast<void *>(value_sp.get()));
- break;
- case eValueTypeRegisterSet:
- log->Printf("SBValue(%p)::GetValueType () => eValueTypeRegisterSet",
- static_cast<void *>(value_sp.get()));
- break;
- case eValueTypeConstResult:
- log->Printf("SBValue(%p)::GetValueType () => eValueTypeConstResult",
- static_cast<void *>(value_sp.get()));
- break;
- case eValueTypeVariableThreadLocal:
- log->Printf(
- "SBValue(%p)::GetValueType () => eValueTypeVariableThreadLocal",
- static_cast<void *>(value_sp.get()));
- break;
- }
- }
return result;
}
const char *SBValue::GetObjectDescription() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetObjectDescription);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *cstr = NULL;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
cstr = value_sp->GetObjectDescription();
}
- if (log) {
- if (cstr)
- log->Printf("SBValue(%p)::GetObjectDescription() => \"%s\"",
- static_cast<void *>(value_sp.get()), cstr);
- else
- log->Printf("SBValue(%p)::GetObjectDescription() => NULL",
- static_cast<void *>(value_sp.get()));
- }
+
return cstr;
}
const char *SBValue::GetTypeValidatorResult() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetTypeValidatorResult);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *cstr = NULL;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
cstr = validation.second.c_str();
}
}
- if (log) {
- if (cstr)
- log->Printf("SBValue(%p)::GetTypeValidatorResult() => \"%s\"",
- static_cast<void *>(value_sp.get()), cstr);
- else
- log->Printf("SBValue(%p)::GetTypeValidatorResult() => NULL",
- static_cast<void *>(value_sp.get()));
- }
+
return cstr;
}
SBType SBValue::GetType() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBType, SBValue, GetType);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
SBType sb_type;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
type_sp = std::make_shared<TypeImpl>(value_sp->GetTypeImpl());
sb_type.SetSP(type_sp);
}
- if (log) {
- if (type_sp)
- log->Printf("SBValue(%p)::GetType => SBType(%p)",
- static_cast<void *>(value_sp.get()),
- static_cast<void *>(type_sp.get()));
- else
- log->Printf("SBValue(%p)::GetType => NULL",
- static_cast<void *>(value_sp.get()));
- }
+
return LLDB_RECORD_RESULT(sb_type);
}
bool SBValue::GetValueDidChange() {
LLDB_RECORD_METHOD_NO_ARGS(bool, SBValue, GetValueDidChange);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool result = false;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp->UpdateValueIfNeeded(false))
result = value_sp->GetValueDidChange();
}
- if (log)
- log->Printf("SBValue(%p)::GetValueDidChange() => %i",
- static_cast<void *>(value_sp.get()), result);
return result;
}
const char *SBValue::GetSummary() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetSummary);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *cstr = NULL;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
cstr = value_sp->GetSummaryAsCString();
}
- if (log) {
- if (cstr)
- log->Printf("SBValue(%p)::GetSummary() => \"%s\"",
- static_cast<void *>(value_sp.get()), cstr);
- else
- log->Printf("SBValue(%p)::GetSummary() => NULL",
- static_cast<void *>(value_sp.get()));
- }
+
return cstr;
}
(lldb::SBStream &, lldb::SBTypeSummaryOptions &), stream,
options);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
stream.Printf("%s", buffer.c_str());
}
const char *cstr = stream.GetData();
- if (log) {
- if (cstr)
- log->Printf("SBValue(%p)::GetSummary() => \"%s\"",
- static_cast<void *>(value_sp.get()), cstr);
- else
- log->Printf("SBValue(%p)::GetSummary() => NULL",
- static_cast<void *>(value_sp.get()));
- }
return cstr;
}
const char *SBValue::GetLocation() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetLocation);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *cstr = NULL;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
cstr = value_sp->GetLocationAsCString();
}
- if (log) {
- if (cstr)
- log->Printf("SBValue(%p)::GetLocation() => \"%s\"",
- static_cast<void *>(value_sp.get()), cstr);
- else
- log->Printf("SBValue(%p)::GetLocation() => NULL",
- static_cast<void *>(value_sp.get()));
- }
return cstr;
}
bool success = false;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (value_sp) {
success = value_sp->SetValueFromCString(value_str, error.ref());
} else
error.SetErrorStringWithFormat("Could not get value: %s",
locker.GetError().AsCString());
- if (log)
- log->Printf("SBValue(%p)::SetValueFromCString(\"%s\") => %i",
- static_cast<void *>(value_sp.get()), value_str, success);
-
return success;
}
GetPreferDynamicValue(), GetPreferSyntheticValue(), name);
}
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (new_value_sp)
- log->Printf("SBValue(%p)::CreateChildAtOffset => \"%s\"",
- static_cast<void *>(value_sp.get()),
- new_value_sp->GetName().AsCString());
- else
- log->Printf("SBValue(%p)::CreateChildAtOffset => NULL",
- static_cast<void *>(value_sp.get()));
- }
return LLDB_RECORD_RESULT(sb_value);
}
(const char *, const char *, lldb::SBExpressionOptions &),
name, expression, options);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
lldb::SBValue sb_value;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
new_value_sp->SetName(ConstString(name));
}
sb_value.SetSP(new_value_sp);
- if (log) {
- if (new_value_sp)
- log->Printf("SBValue(%p)::CreateValueFromExpression(name=\"%s\", "
- "expression=\"%s\") => SBValue (%p)",
- static_cast<void *>(value_sp.get()), name, expression,
- static_cast<void *>(new_value_sp.get()));
- else
- log->Printf("SBValue(%p)::CreateValueFromExpression(name=\"%s\", "
- "expression=\"%s\") => NULL",
- static_cast<void *>(value_sp.get()), name, expression);
- }
return LLDB_RECORD_RESULT(sb_value);
}
exe_ctx, ast_type);
}
sb_value.SetSP(new_value_sp);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (new_value_sp)
- log->Printf("SBValue(%p)::CreateValueFromAddress => \"%s\"",
- static_cast<void *>(value_sp.get()),
- new_value_sp->GetName().AsCString());
- else
- log->Printf("SBValue(%p)::CreateValueFromAddress => NULL",
- static_cast<void *>(value_sp.get()));
- }
return LLDB_RECORD_RESULT(sb_value);
}
new_value_sp->SetAddressTypeOfChildren(eAddressTypeLoad);
}
sb_value.SetSP(new_value_sp);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (new_value_sp)
- log->Printf("SBValue(%p)::CreateValueFromData => \"%s\"",
- static_cast<void *>(value_sp.get()),
- new_value_sp->GetName().AsCString());
- else
- log->Printf("SBValue(%p)::CreateValueFromData => NULL",
- static_cast<void *>(value_sp.get()));
- }
return LLDB_RECORD_RESULT(sb_value);
}
can_create_synthetic);
lldb::ValueObjectSP child_sp;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
SBValue sb_value;
sb_value.SetSP(child_sp, use_dynamic, GetPreferSyntheticValue());
- if (log)
- log->Printf("SBValue(%p)::GetChildAtIndex (%u) => SBValue(%p)",
- static_cast<void *>(value_sp.get()), idx,
- static_cast<void *>(value_sp.get()));
return LLDB_RECORD_RESULT(sb_value);
}
if (value_sp) {
idx = value_sp->GetIndexOfChildWithName(ConstString(name));
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (idx == UINT32_MAX)
- log->Printf(
- "SBValue(%p)::GetIndexOfChildWithName (name=\"%s\") => NOT FOUND",
- static_cast<void *>(value_sp.get()), name);
- else
- log->Printf("SBValue(%p)::GetIndexOfChildWithName (name=\"%s\") => %u",
- static_cast<void *>(value_sp.get()), name, idx);
- }
return idx;
}
lldb::ValueObjectSP child_sp;
const ConstString str_name(name);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
SBValue sb_value;
sb_value.SetSP(child_sp, use_dynamic_value, GetPreferSyntheticValue());
- if (log)
- log->Printf(
- "SBValue(%p)::GetChildMemberWithName (name=\"%s\") => SBValue(%p)",
- static_cast<void *>(value_sp.get()), name,
- static_cast<void *>(value_sp.get()));
-
return LLDB_RECORD_RESULT(sb_value);
}
LLDB_RECORD_METHOD(lldb::SBValue, SBValue, GetValueForExpressionPath,
(const char *), expr_path);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
lldb::ValueObjectSP child_sp;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
SBValue sb_value;
sb_value.SetSP(child_sp, GetPreferDynamicValue(), GetPreferSyntheticValue());
- if (log)
- log->Printf("SBValue(%p)::GetValueForExpressionPath (expr_path=\"%s\") => "
- "SBValue(%p)",
- static_cast<void *>(value_sp.get()), expr_path,
- static_cast<void *>(value_sp.get()));
-
return LLDB_RECORD_RESULT(sb_value);
}
bool SBValue::MightHaveChildren() {
LLDB_RECORD_METHOD_NO_ARGS(bool, SBValue, MightHaveChildren);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool has_children = false;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp)
has_children = value_sp->MightHaveChildren();
- if (log)
- log->Printf("SBValue(%p)::MightHaveChildren() => %i",
- static_cast<void *>(value_sp.get()), has_children);
return has_children;
}
bool SBValue::IsRuntimeSupportValue() {
LLDB_RECORD_METHOD_NO_ARGS(bool, SBValue, IsRuntimeSupportValue);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
bool is_support = false;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp)
is_support = value_sp->IsRuntimeSupportValue();
- if (log)
- log->Printf("SBValue(%p)::IsRuntimeSupportValue() => %i",
- static_cast<void *>(value_sp.get()), is_support);
return is_support;
}
uint32_t num_children = 0;
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp)
num_children = value_sp->GetNumChildren(max);
- if (log)
- log->Printf("SBValue(%p)::GetNumChildren (%u) => %u",
- static_cast<void *>(value_sp.get()), max, num_children);
-
return num_children;
}
Status error;
sb_value = value_sp->Dereference(error);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBValue(%p)::Dereference () => SBValue(%p)",
- static_cast<void *>(value_sp.get()),
- static_cast<void *>(value_sp.get()));
return LLDB_RECORD_RESULT(sb_value);
}
target_sp = m_opaque_sp->GetTargetSP();
sb_target.SetSP(target_sp);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (target_sp.get() == NULL)
- log->Printf("SBValue(%p)::GetTarget () => NULL",
- static_cast<void *>(m_opaque_sp.get()));
- else
- log->Printf("SBValue(%p)::GetTarget () => %p",
- static_cast<void *>(m_opaque_sp.get()),
- static_cast<void *>(target_sp.get()));
- }
+
return LLDB_RECORD_RESULT(sb_target);
}
process_sp = m_opaque_sp->GetProcessSP();
sb_process.SetSP(process_sp);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (process_sp.get() == NULL)
- log->Printf("SBValue(%p)::GetProcess () => NULL",
- static_cast<void *>(m_opaque_sp.get()));
- else
- log->Printf("SBValue(%p)::GetProcess () => %p",
- static_cast<void *>(m_opaque_sp.get()),
- static_cast<void *>(process_sp.get()));
- }
+
return LLDB_RECORD_RESULT(sb_process);
}
thread_sp = m_opaque_sp->GetThreadSP();
sb_thread.SetThread(thread_sp);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (thread_sp.get() == NULL)
- log->Printf("SBValue(%p)::GetThread () => NULL",
- static_cast<void *>(m_opaque_sp.get()));
- else
- log->Printf("SBValue(%p)::GetThread () => %p",
- static_cast<void *>(m_opaque_sp.get()),
- static_cast<void *>(thread_sp.get()));
- }
+
return LLDB_RECORD_RESULT(sb_thread);
}
frame_sp = m_opaque_sp->GetFrameSP();
sb_frame.SetFrameSP(frame_sp);
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log) {
- if (frame_sp.get() == NULL)
- log->Printf("SBValue(%p)::GetFrame () => NULL",
- static_cast<void *>(m_opaque_sp.get()));
- else
- log->Printf("SBValue(%p)::GetFrame () => %p",
- static_cast<void *>(m_opaque_sp.get()),
- static_cast<void *>(frame_sp.get()));
- }
+
return LLDB_RECORD_RESULT(sb_frame);
}
(const char *, const lldb::SBExpressionOptions &, const char *), expr,
options, name);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
if (!expr || expr[0] == '\0') {
- LLDB_LOG(log,
- "SBValue::EvaluateExpression called with an empty expression");
return LLDB_RECORD_RESULT(SBValue());
}
- LLDB_LOG(log, "SBValue()::EvaluateExpression (expr=\"{0}\")...", expr);
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (!value_sp) {
- LLDB_LOG(log, "SBValue::EvaluateExpression () => error: could not "
- "reconstruct value object for this SBValue");
return LLDB_RECORD_RESULT(SBValue());
}
lldb::TargetSP target_sp = value_sp->GetTargetSP();
if (!target_sp) {
- LLDB_LOG(
- log,
- "SBValue::EvaluateExpression () => error: could not retrieve target");
return LLDB_RECORD_RESULT(SBValue());
}
StackFrame *frame = exe_ctx.GetFramePtr();
if (!frame) {
- LLDB_LOG(log, "SBValue::EvaluateExpression () => error: could not retrieve "
- "current stack frame");
return LLDB_RECORD_RESULT(SBValue());
}
ValueObjectSP res_val_sp;
- ExpressionResults expr_res = target_sp->EvaluateExpression(
- expr, frame, res_val_sp, options.ref(), nullptr, value_sp.get());
+ target_sp->EvaluateExpression(expr, frame, res_val_sp, options.ref(), nullptr,
+ value_sp.get());
if (name)
res_val_sp->SetName(ConstString(name));
- LLDB_LOG(log,
- "SBValue(Name=\"{0}\")::EvaluateExpression (expr=\"{1}\") => "
- "SBValue(Success={2}) (execution result={3})",
- value_sp->GetName(), expr, res_val_sp->GetError().Success(),
- expr_res);
-
SBValue result;
result.SetSP(res_val_sp, options.GetFetchDynamicValue());
return LLDB_RECORD_RESULT(result);
sb_value.SetSP(value_sp->AddressOf(error), GetPreferDynamicValue(),
GetPreferSyntheticValue());
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBValue(%p)::AddressOf () => SBValue(%p)",
- static_cast<void *>(value_sp.get()),
- static_cast<void *>(value_sp.get()));
return LLDB_RECORD_RESULT(sb_value);
}
value = LLDB_INVALID_ADDRESS;
}
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBValue(%p)::GetLoadAddress () => (%" PRIu64 ")",
- static_cast<void *>(value_sp.get()), value);
return value;
}
}
}
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBValue(%p)::GetAddress () => (%s,%" PRIu64 ")",
- static_cast<void *>(value_sp.get()),
- (addr.GetSection() ? addr.GetSection()->GetName().GetCString()
- : "NULL"),
- addr.GetOffset());
+
return LLDB_RECORD_RESULT(SBAddress(new Address(addr)));
}
LLDB_RECORD_METHOD(lldb::SBData, SBValue, GetPointeeData,
(uint32_t, uint32_t), item_idx, item_count);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
lldb::SBData sb_data;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
*sb_data = data_sp;
}
}
- if (log)
- log->Printf("SBValue(%p)::GetPointeeData (%d, %d) => SBData(%p)",
- static_cast<void *>(value_sp.get()), item_idx, item_count,
- static_cast<void *>(sb_data.get()));
return LLDB_RECORD_RESULT(sb_data);
}
lldb::SBData SBValue::GetData() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBData, SBValue, GetData);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
lldb::SBData sb_data;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (error.Success())
*sb_data = data_sp;
}
- if (log)
- log->Printf("SBValue(%p)::GetData () => SBData(%p)",
- static_cast<void *>(value_sp.get()),
- static_cast<void *>(sb_data.get()));
return LLDB_RECORD_RESULT(sb_data);
}
LLDB_RECORD_METHOD(bool, SBValue, SetData, (lldb::SBData &, lldb::SBError &),
data, error);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
bool ret = true;
DataExtractor *data_extractor = data.get();
if (!data_extractor) {
- if (log)
- log->Printf("SBValue(%p)::SetData() => error: no data to set",
- static_cast<void *>(value_sp.get()));
-
error.SetErrorString("No data to set");
ret = false;
} else {
ret = false;
}
- if (log)
- log->Printf("SBValue(%p)::SetData (%p) => %s",
- static_cast<void *>(value_sp.get()),
- static_cast<void *>(data.get()), ret ? "true" : "false");
return ret;
}
}
}
} else if (target_sp) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBValue(%p)::Watch() => error getting SBValue: %s",
- static_cast<void *>(value_sp.get()),
- locker.GetError().AsCString());
-
error.SetErrorStringWithFormat("could not get SBValue: %s",
locker.GetError().AsCString());
} else {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBValue(%p)::Watch() => error getting SBValue: no target",
- static_cast<void *>(value_sp.get()));
error.SetErrorString("could not set watchpoint, a target is required");
}
#include "lldb/API/SBStream.h"
#include "lldb/API/SBValue.h"
#include "lldb/Core/ValueObjectList.h"
-#include "lldb/Utility/Log.h"
#include <vector>
SBValueList::SBValueList(const SBValueList &rhs) : m_opaque_up() {
LLDB_RECORD_CONSTRUCTOR(SBValueList, (const lldb::SBValueList &), rhs);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
if (rhs.IsValid())
m_opaque_up.reset(new ValueListImpl(*rhs));
-
- if (log) {
- log->Printf(
- "SBValueList::SBValueList (rhs.ap=%p) => this.ap = %p",
- static_cast<void *>(rhs.IsValid() ? rhs.m_opaque_up.get() : NULL),
- static_cast<void *>(m_opaque_up.get()));
- }
}
SBValueList::SBValueList(const ValueListImpl *lldb_object_ptr) : m_opaque_up() {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
if (lldb_object_ptr)
m_opaque_up.reset(new ValueListImpl(*lldb_object_ptr));
-
- if (log) {
- log->Printf("SBValueList::SBValueList (lldb_object_ptr=%p) => this.ap = %p",
- static_cast<const void *>(lldb_object_ptr),
- static_cast<void *>(m_opaque_up.get()));
- }
}
SBValueList::~SBValueList() {}
LLDB_RECORD_METHOD_CONST(lldb::SBValue, SBValueList, GetValueAtIndex,
(uint32_t), idx);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- // if (log)
- // log->Printf ("SBValueList::GetValueAtIndex (uint32_t idx) idx = %d",
- // idx);
SBValue sb_value;
if (m_opaque_up)
sb_value = m_opaque_up->GetValueAtIndex(idx);
- if (log) {
- SBStream sstr;
- sb_value.GetDescription(sstr);
- log->Printf("SBValueList::GetValueAtIndex (this.ap=%p, idx=%d) => SBValue "
- "(this.sp = %p, '%s')",
- static_cast<void *>(m_opaque_up.get()), idx,
- static_cast<void *>(sb_value.GetSP().get()), sstr.GetData());
- }
-
return LLDB_RECORD_RESULT(sb_value);
}
uint32_t SBValueList::GetSize() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBValueList, GetSize);
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- // if (log)
- // log->Printf ("SBValueList::GetSize ()");
-
uint32_t size = 0;
if (m_opaque_up)
size = m_opaque_up->GetSize();
- if (log)
- log->Printf("SBValueList::GetSize (this.ap=%p) => %d",
- static_cast<void *>(m_opaque_up.get()), size);
-
return size;
}
#include "lldb/Core/StreamFile.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
-#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
#include "lldb/lldb-defines.h"
#include "lldb/lldb-types.h"
SBWatchpoint::SBWatchpoint(const lldb::WatchpointSP &wp_sp)
: m_opaque_wp(wp_sp) {
LLDB_RECORD_CONSTRUCTOR(SBWatchpoint, (const lldb::WatchpointSP &), wp_sp);
-
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-
- if (log) {
- SBStream sstr;
- GetDescription(sstr, lldb::eDescriptionLevelBrief);
- LLDB_LOG(log, "watchpoint = {0} ({1})", wp_sp.get(), sstr.GetData());
- }
}
SBWatchpoint::SBWatchpoint(const SBWatchpoint &rhs)
watch_id_t SBWatchpoint::GetID() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::watch_id_t, SBWatchpoint, GetID);
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
watch_id_t watch_id = LLDB_INVALID_WATCH_ID;
lldb::WatchpointSP watchpoint_sp(GetSP());
if (watchpoint_sp)
watch_id = watchpoint_sp->GetID();
- if (log) {
- if (watch_id == LLDB_INVALID_WATCH_ID)
- log->Printf("SBWatchpoint(%p)::GetID () => LLDB_INVALID_WATCH_ID",
- static_cast<void *>(watchpoint_sp.get()));
- else
- log->Printf("SBWatchpoint(%p)::GetID () => %u",
- static_cast<void *>(watchpoint_sp.get()), watch_id);
- }
-
return watch_id;
}
count = watchpoint_sp->GetHitCount();
}
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf("SBWatchpoint(%p)::GetHitCount () => %u",
- static_cast<void *>(watchpoint_sp.get()), count);
-
return count;
}