Index: include/lldb/Utility/ReproducerInstrumentation.h =================================================================== --- include/lldb/Utility/ReproducerInstrumentation.h +++ include/lldb/Utility/ReproducerInstrumentation.h @@ -16,7 +16,48 @@ #include "llvm/ADT/StringRef.h" #include "llvm/Support/ErrorHandling.h" +#include #include +#include + +template ::value, int>::type = 0> +void log_append(llvm::raw_string_ostream &ss, const T &t) { + ss << t; +} + +template ::value, + int>::type = 0> +void log_append(llvm::raw_string_ostream &ss, const T &t) { + ss << &t; +} + +template +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 +void log_helper(llvm::raw_string_ostream &ss, const Head &head) { + log_append(ss, head); +} + +template +void log_helper(llvm::raw_string_ostream &ss, const Head &head, + const Tail &... tail) { + log_append(ss, head); + ss << ", "; + log_helper(ss, tail...); +} + +template 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 @@ -38,8 +79,8 @@ #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( \ @@ -61,8 +102,8 @@ } #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 sb_recorder; \ if (lldb_private::repro::InstrumentationData data = \ LLDB_GET_INSTRUMENTATION_DATA()) { \ @@ -75,8 +116,8 @@ } #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 sb_recorder; \ if (lldb_private::repro::InstrumentationData data = \ LLDB_GET_INSTRUMENTATION_DATA()) { \ @@ -116,8 +157,8 @@ } #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 sb_recorder; \ if (lldb_private::repro::InstrumentationData data = \ LLDB_GET_INSTRUMENTATION_DATA()) { \ Index: source/API/SBAddress.cpp =================================================================== --- source/API/SBAddress.cpp +++ source/API/SBAddress.cpp @@ -16,7 +16,6 @@ #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; @@ -111,8 +110,6 @@ 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) { @@ -122,16 +119,6 @@ } } - if (log) { - if (addr == LLDB_INVALID_ADDRESS) - log->Printf( - "SBAddress::GetLoadAddress (SBTarget(%p)) => LLDB_INVALID_ADDRESS", - static_cast(target_sp.get())); - else - log->Printf("SBAddress::GetLoadAddress (SBTarget(%p)) => 0x%" PRIx64, - static_cast(target_sp.get()), addr); - } - return addr; } Index: source/API/SBBlock.cpp =================================================================== --- source/API/SBBlock.cpp +++ source/API/SBBlock.cpp @@ -21,7 +21,6 @@ #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; Index: source/API/SBBreakpoint.cpp =================================================================== --- source/API/SBBreakpoint.cpp +++ source/API/SBBreakpoint.cpp @@ -32,7 +32,6 @@ #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" @@ -83,14 +82,11 @@ 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; } @@ -195,11 +191,8 @@ 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 guard( bkpt_sp->GetTarget().GetAPIMutex()); @@ -222,11 +215,8 @@ 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 guard( bkpt_sp->GetTarget().GetAPIMutex()); @@ -261,11 +251,8 @@ 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 guard( bkpt_sp->GetTarget().GetAPIMutex()); @@ -332,9 +319,6 @@ 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; } @@ -349,9 +333,6 @@ 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; } @@ -364,8 +345,6 @@ 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() { @@ -379,17 +358,13 @@ 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 guard( bkpt_sp->GetTarget().GetAPIMutex()); @@ -410,8 +385,6 @@ 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; } @@ -420,9 +393,7 @@ 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 guard( @@ -444,8 +415,6 @@ 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; } @@ -454,10 +423,7 @@ 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 guard( bkpt_sp->GetTarget().GetAPIMutex()); @@ -478,8 +444,6 @@ 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; } @@ -495,9 +459,6 @@ 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; } @@ -511,8 +472,6 @@ 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; } @@ -613,10 +572,7 @@ 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 guard( @@ -633,10 +589,7 @@ 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 guard( @@ -655,10 +608,7 @@ 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) { @@ -681,9 +631,7 @@ 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 guard( @@ -692,12 +640,7 @@ // 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; @@ -707,24 +650,20 @@ 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 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 guard( @@ -739,9 +678,7 @@ 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 guard( Index: source/API/SBBreakpointLocation.cpp =================================================================== --- source/API/SBBreakpointLocation.cpp +++ source/API/SBBreakpointLocation.cpp @@ -22,7 +22,6 @@ #include "lldb/Interpreter/ScriptInterpreter.h" #include "lldb/Target/Target.h" #include "lldb/Target/ThreadSpec.h" -#include "lldb/Utility/Log.h" #include "lldb/Utility/Stream.h" #include "lldb/lldb-defines.h" #include "lldb/lldb-types.h" @@ -39,14 +38,6 @@ : 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) @@ -216,10 +207,7 @@ 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 guard( @@ -240,10 +228,7 @@ 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) { @@ -452,7 +437,6 @@ LLDB_RECORD_METHOD_NO_ARGS(lldb::SBBreakpoint, SBBreakpointLocation, GetBreakpoint); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); BreakpointLocationSP loc_sp = GetSP(); SBBreakpoint sb_bp; @@ -462,11 +446,5 @@ 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); } Index: source/API/SBBreakpointName.cpp =================================================================== --- source/API/SBBreakpointName.cpp +++ source/API/SBBreakpointName.cpp @@ -21,7 +21,6 @@ #include "lldb/Interpreter/ScriptInterpreter.h" #include "lldb/Target/Target.h" #include "lldb/Target/ThreadSpec.h" -#include "lldb/Utility/Log.h" #include "lldb/Utility/Stream.h" #include "SBBreakpointOptionCommon.h" @@ -37,10 +36,10 @@ if (!name || name[0] == '\0') return; m_name.assign(name); - + if (!target_sp) return; - + m_target_wp = target_sp; } @@ -50,15 +49,15 @@ // 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(); } @@ -133,14 +132,14 @@ 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()); @@ -169,7 +168,7 @@ m_impl_up.reset(); return *this; } - + m_impl_up.reset(new SBBreakpointNameImpl(rhs.m_impl_up->GetTarget(), rhs.m_impl_up->GetName())); return *this; @@ -208,13 +207,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -235,13 +231,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -251,13 +244,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -268,13 +258,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -284,13 +271,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -301,13 +285,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -318,15 +299,10 @@ 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 : ""); - + std::lock_guard guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -337,13 +313,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -354,14 +327,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -372,13 +341,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -388,14 +354,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -406,13 +368,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -422,14 +381,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -440,13 +395,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -457,14 +409,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -476,13 +424,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -493,14 +438,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -512,13 +453,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -529,14 +467,12 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -551,13 +487,10 @@ 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); @@ -570,13 +503,10 @@ 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(); } @@ -584,12 +514,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -600,16 +528,13 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); bp_name->GetDescription(s.get(), eDescriptionLevelFull); @@ -618,11 +543,9 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -639,15 +562,10 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -666,15 +584,11 @@ 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 guard( m_impl_up->GetTarget()->GetAPIMutex()); @@ -704,14 +618,10 @@ 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); } @@ -727,14 +637,10 @@ 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); } @@ -750,14 +656,9 @@ 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); } Index: source/API/SBBroadcaster.cpp =================================================================== --- source/API/SBBroadcaster.cpp +++ source/API/SBBroadcaster.cpp @@ -8,7 +8,6 @@ #include "SBReproducerPrivate.h" #include "lldb/Utility/Broadcaster.h" -#include "lldb/Utility/Log.h" #include "lldb/API/SBBroadcaster.h" #include "lldb/API/SBEvent.h" @@ -26,15 +25,10 @@ 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) @@ -60,13 +54,6 @@ 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(m_opaque_ptr), event_type, unique); - if (m_opaque_ptr == NULL) return; @@ -80,14 +67,6 @@ 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(m_opaque_ptr), static_cast(event.get()), - unique); - if (m_opaque_ptr == NULL) return; @@ -104,12 +83,6 @@ (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(m_opaque_ptr), - static_cast(listener.get()), requested_events); if (m_opaque_ptr) m_opaque_ptr->AddInitialEventsToListener(listener.m_opaque_sp, requested_events); Index: source/API/SBCommandInterpreter.cpp =================================================================== --- source/API/SBCommandInterpreter.cpp +++ source/API/SBCommandInterpreter.cpp @@ -178,13 +178,6 @@ 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(interpreter), - static_cast(m_opaque_ptr)); } SBCommandInterpreter::SBCommandInterpreter(const SBCommandInterpreter &rhs) @@ -271,13 +264,6 @@ 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(m_opaque_ptr), command_line, - static_cast(result.get()), add_to_history); ExecutionContext ctx, *ctx_ptr; if (override_context.get()) { @@ -298,17 +284,6 @@ 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(m_opaque_ptr), command_line, - static_cast(result.get()), sstr.GetData(), - add_to_history, result.GetStatus()); - } return result.GetStatus(); } @@ -323,17 +298,6 @@ 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(m_opaque_ptr), s.GetData(), - static_cast(result.get())); - } - if (!IsValid()) { result->AppendError("SBCommandInterpreter is not valid."); result->SetStatus(eReturnStatusFailed); @@ -385,7 +349,6 @@ 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 @@ -401,15 +364,6 @@ last_char - current_line > static_cast(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(m_opaque_ptr), current_line, - static_cast(cursor - current_line), - static_cast(last_char - current_line), - match_start_point, max_return_elements); if (IsValid()) { lldb_private::StringList lldb_matches, lldb_descriptions; @@ -422,10 +376,6 @@ SBStringList temp_descriptions_list(&lldb_descriptions); descriptions.AppendList(temp_descriptions_list); } - if (log) - log->Printf( - "SBCommandInterpreter(%p)::HandleCompletion - Found %d completions.", - static_cast(m_opaque_ptr), num_completions); return num_completions; } @@ -495,12 +445,6 @@ sb_process.SetSP(process_sp); } } - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - - if (log) - log->Printf("SBCommandInterpreter(%p)::GetProcess () => SBProcess(%p)", - static_cast(m_opaque_ptr), - static_cast(process_sp.get())); return LLDB_RECORD_RESULT(sb_process); } @@ -512,12 +456,6 @@ 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(m_opaque_ptr), - static_cast(sb_debugger.get())); return LLDB_RECORD_RESULT(sb_debugger); } @@ -603,13 +541,6 @@ 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(m_opaque_ptr), - static_cast(result.get())); } void SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory( @@ -629,28 +560,15 @@ 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(m_opaque_ptr), static_cast(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(m_opaque_ptr), - static_cast(broadcaster.get())); return LLDB_RECORD_RESULT(broadcaster); } Index: source/API/SBCommandReturnObject.cpp =================================================================== --- source/API/SBCommandReturnObject.cpp +++ source/API/SBCommandReturnObject.cpp @@ -13,7 +13,6 @@ #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; @@ -68,45 +67,25 @@ 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(m_opaque_up.get()), result.AsCString()); - return result.AsCString(); } - if (log) - log->Printf("SBCommandReturnObject(%p)::GetOutput () => nullptr", - static_cast(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(m_opaque_up.get()), result.AsCString()); - return result.AsCString(); } - if (log) - log->Printf("SBCommandReturnObject(%p)::GetError () => nullptr", - static_cast(m_opaque_up.get())); - return nullptr; } Index: source/API/SBCommunication.cpp =================================================================== --- source/API/SBCommunication.cpp +++ source/API/SBCommunication.cpp @@ -12,7 +12,6 @@ #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; @@ -24,13 +23,6 @@ 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(m_opaque)); } SBCommunication::~SBCommunication() { @@ -77,8 +69,6 @@ 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()) { @@ -91,13 +81,6 @@ else status = eConnectionStatusLostConnection; } - - if (log) - log->Printf( - "SBCommunication(%p)::AdoptFileDescriptor (fd=%d, ownd_fd=%i) => %s", - static_cast(m_opaque), fd, owns_fd, - Communication::ConnectionStatusAsCString(status)); - return status; } @@ -105,43 +88,20 @@ 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(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(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(m_opaque), static_cast(dst), - static_cast(dst_len), timeout_usec); size_t bytes_read = 0; Timeout timeout = timeout_usec == UINT32_MAX ? Timeout(llvm::None) @@ -151,13 +111,6 @@ else status = eConnectionStatusNoConnection; - if (log) - log->Printf("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64 - ", timeout_usec=%u, &status=%s) => %" PRIu64, - static_cast(m_opaque), static_cast(dst), - static_cast(dst_len), timeout_usec, - Communication::ConnectionStatusAsCString(status), - static_cast(bytes_read)); return bytes_read; } @@ -169,83 +122,34 @@ 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(m_opaque), static_cast(src), - static_cast(src_len), - Communication::ConnectionStatusAsCString(status), - static_cast(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(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(m_opaque)); - - bool success = false; - if (m_opaque) - success = m_opaque->StopReadThread(); - - if (log) - log->Printf("SBCommunication(%p)::ReadThreadStop () => %i", - static_cast(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(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(m_opaque), - reinterpret_cast(reinterpret_cast(callback)), - static_cast(callback_baton), result); - return result; } @@ -254,14 +158,6 @@ 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(m_opaque), - static_cast(broadcaster.get())); - return LLDB_RECORD_RESULT(broadcaster); } @@ -271,20 +167,3 @@ 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); -//} -// -// Index: source/API/SBCompileUnit.cpp =================================================================== --- source/API/SBCompileUnit.cpp +++ source/API/SBCompileUnit.cpp @@ -16,7 +16,6 @@ #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; @@ -57,14 +56,9 @@ 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(m_opaque_ptr), - (int)line_table->GetSize()); return line_table->GetSize(); } } @@ -75,8 +69,6 @@ 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(); @@ -87,15 +79,6 @@ } } - if (log) { - SBStream sstr; - sb_line_entry.GetDescription(sstr); - log->Printf("SBCompileUnit(%p)::GetLineEntryAtIndex (idx=%u) => " - "SBLineEntry(%p): '%s'", - static_cast(m_opaque_ptr), idx, - static_cast(sb_line_entry.get()), sstr.GetData()); - } - return LLDB_RECORD_RESULT(sb_line_entry); } @@ -116,8 +99,6 @@ (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; @@ -131,26 +112,6 @@ 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(m_opaque_ptr), start_idx, line, - inline_file_spec - ? static_cast(inline_file_spec->get()) - : NULL); - } else { - log->Printf("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, " - "line=%u, SBFileSpec(%p)) => %u", - static_cast(m_opaque_ptr), start_idx, line, - inline_file_spec - ? static_cast(inline_file_spec->get()) - : NULL, - index); - } - } - return index; } @@ -192,8 +153,6 @@ 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(); @@ -201,14 +160,6 @@ 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(m_opaque_ptr), idx, - static_cast(sb_file_spec.get()), sstr.GetData()); - } return LLDB_RECORD_RESULT(sb_file_spec); } Index: source/API/SBData.cpp =================================================================== --- source/API/SBData.cpp +++ source/API/SBData.cpp @@ -14,7 +14,6 @@ #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 @@ -67,14 +66,9 @@ 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; } @@ -82,11 +76,8 @@ 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() { @@ -99,46 +90,32 @@ 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"); @@ -148,9 +125,6 @@ if (offset == old_offset) error.SetErrorString("unable to read data"); } - if (log) - log->Printf("SBData::GetFloat (error=%p,offset=%" PRIu64 ") => (%f)", - static_cast(error.get()), offset, value); return value; } @@ -158,7 +132,6 @@ 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"); @@ -168,10 +141,6 @@ if (offset == old_offset) error.SetErrorString("unable to read data"); } - if (log) - log->Printf("SBData::GetDouble (error=%p,offset=%" PRIu64 ") => " - "(%f)", - static_cast(error.get()), offset, value); return value; } @@ -179,7 +148,6 @@ 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"); @@ -189,10 +157,6 @@ if (offset == old_offset) error.SetErrorString("unable to read data"); } - if (log) - log->Printf("SBData::GetLongDouble (error=%p,offset=%" PRIu64 ") => " - "(%Lf)", - static_cast(error.get()), offset, value); return value; } @@ -200,7 +164,6 @@ 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"); @@ -210,11 +173,6 @@ if (offset == old_offset) error.SetErrorString("unable to read data"); } - if (log) - log->Printf("SBData::GetAddress (error=%p,offset=%" PRIu64 ") => " - "(%p)", - static_cast(error.get()), offset, - reinterpret_cast(value)); return value; } @@ -222,7 +180,6 @@ 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"); @@ -232,10 +189,6 @@ if (offset == old_offset) error.SetErrorString("unable to read data"); } - if (log) - log->Printf("SBData::GetUnsignedInt8 (error=%p,offset=%" PRIu64 ") => " - "(%c)", - static_cast(error.get()), offset, value); return value; } @@ -243,7 +196,6 @@ 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"); @@ -253,10 +205,6 @@ if (offset == old_offset) error.SetErrorString("unable to read data"); } - if (log) - log->Printf("SBData::GetUnsignedInt16 (error=%p,offset=%" PRIu64 ") => " - "(%hd)", - static_cast(error.get()), offset, value); return value; } @@ -264,7 +212,6 @@ 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"); @@ -274,10 +221,6 @@ if (offset == old_offset) error.SetErrorString("unable to read data"); } - if (log) - log->Printf("SBData::GetUnsignedInt32 (error=%p,offset=%" PRIu64 ") => " - "(%d)", - static_cast(error.get()), offset, value); return value; } @@ -285,7 +228,6 @@ 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"); @@ -295,10 +237,6 @@ if (offset == old_offset) error.SetErrorString("unable to read data"); } - if (log) - log->Printf("SBData::GetUnsignedInt64 (error=%p,offset=%" PRIu64 ") => " - "(%" PRId64 ")", - static_cast(error.get()), offset, value); return value; } @@ -306,7 +244,6 @@ 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"); @@ -316,10 +253,6 @@ if (offset == old_offset) error.SetErrorString("unable to read data"); } - if (log) - log->Printf("SBData::GetSignedInt8 (error=%p,offset=%" PRIu64 ") => " - "(%c)", - static_cast(error.get()), offset, value); return value; } @@ -327,7 +260,6 @@ 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"); @@ -337,10 +269,6 @@ if (offset == old_offset) error.SetErrorString("unable to read data"); } - if (log) - log->Printf("SBData::GetSignedInt16 (error=%p,offset=%" PRIu64 ") => " - "(%hd)", - static_cast(error.get()), offset, value); return value; } @@ -348,7 +276,6 @@ 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"); @@ -358,10 +285,6 @@ if (offset == old_offset) error.SetErrorString("unable to read data"); } - if (log) - log->Printf("SBData::GetSignedInt32 (error=%p,offset=%" PRIu64 ") => " - "(%d)", - static_cast(error.get()), offset, value); return value; } @@ -369,7 +292,6 @@ 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"); @@ -379,10 +301,6 @@ if (offset == old_offset) error.SetErrorString("unable to read data"); } - if (log) - log->Printf("SBData::GetSignedInt64 (error=%p,offset=%" PRIu64 ") => " - "(%" PRId64 ")", - static_cast(error.get()), offset, value); return value; } @@ -390,7 +308,6 @@ 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"); @@ -400,10 +317,6 @@ 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(error.get()), offset, - static_cast(value)); return value; } @@ -425,7 +338,6 @@ 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"); @@ -435,19 +347,11 @@ 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(error.get()), offset, - static_cast(buf), static_cast(size), - static_cast(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(buf, size, endian, addr_size); else @@ -456,25 +360,14 @@ 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(error.get()), - static_cast(buf), static_cast(size), - endian, addr_size, static_cast(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(rhs.get()), value ? "true" : "false"); return value; } @@ -612,12 +505,8 @@ 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(data)); return false; } @@ -631,9 +520,6 @@ else m_opaque_sp->SetData(buffer_sp); - if (log) - log->Printf("SBData::SetDataFromCString (data=%p) => true", - static_cast(data)); return true; } @@ -642,15 +528,8 @@ 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(array), static_cast(array_len)); return false; } @@ -664,11 +543,6 @@ else m_opaque_sp->SetData(buffer_sp); - if (log) - log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64 - ") => " - "true", - static_cast(array), static_cast(array_len)); return true; } @@ -677,15 +551,8 @@ 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(array), static_cast(array_len)); return false; } @@ -699,12 +566,6 @@ else m_opaque_sp->SetData(buffer_sp); - if (log) - log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64 - ") => " - "true", - static_cast(array), static_cast(array_len)); - return true; } @@ -712,15 +573,8 @@ 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(array), static_cast(array_len)); return false; } @@ -734,12 +588,6 @@ else m_opaque_sp->SetData(buffer_sp); - if (log) - log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64 - ") => " - "true", - static_cast(array), static_cast(array_len)); - return true; } @@ -747,15 +595,8 @@ 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(array), static_cast(array_len)); return false; } @@ -769,12 +610,6 @@ else m_opaque_sp->SetData(buffer_sp); - if (log) - log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64 - ") => " - "true", - static_cast(array), static_cast(array_len)); - return true; } @@ -782,15 +617,8 @@ 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(array), static_cast(array_len)); return false; } @@ -804,11 +632,5 @@ else m_opaque_sp->SetData(buffer_sp); - if (log) - log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64 - ") => " - "true", - static_cast(array), static_cast(array_len)); - return true; } Index: source/API/SBDebugger.cpp =================================================================== --- source/API/SBDebugger.cpp +++ source/API/SBDebugger.cpp @@ -184,10 +184,7 @@ 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( @@ -206,11 +203,6 @@ 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(m_opaque_sp.get())); if (m_opaque_sp) m_opaque_sp->ClearIOHandlers(); @@ -236,7 +228,6 @@ lldb::LogOutputCallback callback, void *baton) { - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); SBDebugger debugger; @@ -250,13 +241,6 @@ debugger.reset(Debugger::CreateInstance(callback, baton)); - if (log) { - SBStream sstr; - debugger.GetDescription(sstr); - log->Printf("SBDebugger::Create () => SBDebugger(%p): %s", - static_cast(debugger.m_opaque_sp.get()), - sstr.GetData()); - } SBCommandInterpreter interp = debugger.GetCommandInterpreter(); if (source_init_files) { @@ -275,15 +259,6 @@ 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(debugger.m_opaque_sp.get()), - sstr.GetData()); - } Debugger::Destroy(debugger.m_opaque_sp); @@ -298,13 +273,8 @@ // 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); } @@ -349,14 +319,6 @@ 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(m_opaque_sp.get()), static_cast(fh), - transfer_ownership); - if (!m_opaque_sp) return; @@ -375,14 +337,6 @@ 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(m_opaque_sp.get()), static_cast(fh), - transfer_ownership); - if (m_opaque_sp) m_opaque_sp->SetOutputFileHandle(fh, transfer_ownership); } @@ -391,13 +345,6 @@ 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(m_opaque_sp.get()), static_cast(fh), - transfer_ownership); if (m_opaque_sp) m_opaque_sp->SetErrorFileHandle(fh, transfer_ownership); @@ -453,17 +400,11 @@ 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(m_opaque_sp.get()), - static_cast(sb_interpreter.get())); return LLDB_RECORD_RESULT(sb_interpreter); } @@ -507,16 +448,11 @@ 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(m_opaque_sp.get()), - static_cast(sb_listener.get())); return LLDB_RECORD_RESULT(sb_listener); } @@ -676,12 +612,8 @@ 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; } @@ -690,12 +622,8 @@ 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; } Index: source/API/SBDeclaration.cpp =================================================================== --- source/API/SBDeclaration.cpp +++ source/API/SBDeclaration.cpp @@ -12,7 +12,6 @@ #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 @@ -63,19 +62,11 @@ 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(m_opaque_up.get()), - static_cast(sb_file_spec.get()), sstr.GetData()); - } return LLDB_RECORD_RESULT(sb_file_spec); } @@ -83,15 +74,11 @@ 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(m_opaque_up.get()), line); return line; } Index: source/API/SBError.cpp =================================================================== --- source/API/SBError.cpp +++ source/API/SBError.cpp @@ -10,7 +10,6 @@ #include "SBReproducerPrivate.h" #include "Utils.h" #include "lldb/API/SBStream.h" -#include "lldb/Utility/Log.h" #include "lldb/Utility/Status.h" #include @@ -55,15 +54,10 @@ 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(m_opaque_up.get()), ret_value); return ret_value; } @@ -71,30 +65,21 @@ 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(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(m_opaque_up.get()), err); return err; } @@ -102,15 +87,10 @@ 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(m_opaque_up.get()), err_type); - return err_type; } Index: source/API/SBEvent.cpp =================================================================== --- source/API/SBEvent.cpp +++ source/API/SBEvent.cpp @@ -75,23 +75,12 @@ 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(get()), event_type, sstr.GetData()); - else - log->Printf("SBEvent(%p)::GetType () => 0x%8.8x", - static_cast(get()), event_type); - } return event_type; } @@ -135,11 +124,6 @@ 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; } @@ -187,14 +171,6 @@ 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(event.get()), - reinterpret_cast( - EventDataBytes::GetBytesFromEvent(event.get()))); - return reinterpret_cast( EventDataBytes::GetBytesFromEvent(event.get())); } Index: source/API/SBFileSpec.cpp =================================================================== --- source/API/SBFileSpec.cpp +++ source/API/SBFileSpec.cpp @@ -13,7 +13,6 @@ #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" @@ -72,16 +71,7 @@ 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(m_opaque_up.get()), - (result ? "true" : "false")); - - return result; + return FileSystem::Instance().Exists(*m_opaque_up); } bool SBFileSpec::ResolveExecutableLocation() { @@ -105,19 +95,7 @@ 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(m_opaque_up.get()), s); - else - log->Printf("SBFileSpec(%p)::GetFilename () => NULL", - static_cast(m_opaque_up.get())); - } - - return s; + return m_opaque_up->GetFilename().AsCString(); } const char *SBFileSpec::GetDirectory() const { @@ -125,16 +103,6 @@ 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(m_opaque_up.get()), - directory.GetCString()); - else - log->Printf("SBFileSpec(%p)::GetDirectory () => NULL", - static_cast(m_opaque_up.get())); - } return directory.GetCString(); } @@ -160,16 +128,8 @@ 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(m_opaque_up.get()), result, dst_path, - static_cast(dst_len), result); - if (result == 0 && dst_path && dst_len > 0) *dst_path = '\0'; return result; Index: source/API/SBFileSpecList.cpp =================================================================== --- source/API/SBFileSpecList.cpp +++ source/API/SBFileSpecList.cpp @@ -14,7 +14,6 @@ #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 @@ -29,16 +28,8 @@ 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(rhs.m_opaque_up.get()), - static_cast(m_opaque_up.get())); - } } SBFileSpecList::~SBFileSpecList() {} Index: source/API/SBFrame.cpp =================================================================== --- source/API/SBFrame.cpp +++ source/API/SBFrame.cpp @@ -38,7 +38,6 @@ #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" @@ -63,16 +62,6 @@ : 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(lldb_object_sp.get()), - static_cast(lldb_object_sp.get()), sstr.GetData()); - } } SBFrame::SBFrame(const SBFrame &rhs) : m_opaque_sp() { @@ -122,7 +111,6 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -134,33 +122,17 @@ 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(frame), resolve_scope, - static_cast(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 lock; @@ -176,22 +148,10 @@ 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(frame), - static_cast(module_sp.get())); - return LLDB_RECORD_RESULT(sb_module); } @@ -199,7 +159,6 @@ LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBCompileUnit, SBFrame, GetCompileUnit); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); SBCompileUnit sb_comp_unit; std::unique_lock lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -214,20 +173,9 @@ 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(frame), - static_cast(sb_comp_unit.get())); return LLDB_RECORD_RESULT(sb_comp_unit); } @@ -235,7 +183,6 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -250,20 +197,9 @@ 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(frame), - static_cast(sb_function.get())); return LLDB_RECORD_RESULT(sb_function); } @@ -271,7 +207,6 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -285,27 +220,16 @@ 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(frame), - static_cast(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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -317,23 +241,10 @@ 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(frame)); } } - if (log) - log->Printf("SBFrame(%p)::GetBlock () => SBBlock(%p)", - static_cast(frame), - static_cast(sb_block.GetPtr())); return LLDB_RECORD_RESULT(sb_block); } @@ -346,35 +257,21 @@ 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(frame), - static_cast(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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -389,20 +286,9 @@ 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(frame), - static_cast(sb_line_entry.get())); return LLDB_RECORD_RESULT(sb_line_entry); } @@ -418,10 +304,6 @@ if (frame) frame_idx = frame->GetFrameIndex(); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) - log->Printf("SBFrame(%p)::GetFrameID () => %u", static_cast(frame), - frame_idx); return frame_idx; } @@ -440,7 +322,6 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -455,28 +336,16 @@ 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(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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -490,28 +359,16 @@ 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(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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -525,19 +382,9 @@ 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(frame), addr); return addr; } @@ -545,7 +392,6 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -557,29 +403,17 @@ 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(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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -591,21 +425,10 @@ 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(frame), static_cast(sb_addr.get())); return LLDB_RECORD_RESULT(sb_addr); } @@ -640,11 +463,7 @@ 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); } @@ -667,15 +486,7 @@ 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); @@ -704,13 +515,10 @@ 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); } @@ -730,22 +538,10 @@ 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(frame), name, - static_cast(value_sp.get())); - return LLDB_RECORD_RESULT(sb_value); } @@ -773,12 +569,9 @@ (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); } @@ -886,23 +679,10 @@ 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(frame), name, value_type, - static_cast(value_sp.get())); - return LLDB_RECORD_RESULT(sb_value); } @@ -932,29 +712,18 @@ SBThread SBFrame::GetThread() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBThread, SBFrame, GetThread); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - std::unique_lock 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(exe_ctx.GetFramePtr()), - static_cast(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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -968,21 +737,10 @@ 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(frame), - disassembly); - return disassembly; } @@ -1044,8 +802,6 @@ LLDB_RECORD_METHOD(lldb::SBValueList, SBFrame, GetVariables, (const lldb::SBVariablesOptions &), options); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - SBValueList value_list; std::unique_lock lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1063,12 +819,6 @@ 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 variable_set; Process *process = exe_ctx.GetProcessPtr(); @@ -1144,30 +894,16 @@ } } } - } 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(frame), - static_cast(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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1188,22 +924,10 @@ 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(frame), - static_cast(value_list.opaque_ptr())); - return LLDB_RECORD_RESULT(value_list); } @@ -1211,8 +935,6 @@ LLDB_RECORD_METHOD(lldb::SBValue, SBFrame, FindRegister, (const char *), name); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - SBValue result; ValueObjectSP value_sp; std::unique_lock lock; @@ -1242,22 +964,10 @@ } } } - } 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(frame), - static_cast(value_sp.get())); - return LLDB_RECORD_RESULT(result); } @@ -1265,7 +975,6 @@ LLDB_RECORD_METHOD(bool, SBFrame, GetDescription, (lldb::SBStream &), description); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); Stream &strm = description.ref(); std::unique_lock lock; @@ -1280,14 +989,7 @@ 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 @@ -1374,8 +1076,6 @@ (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 @@ -1384,9 +1084,6 @@ 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); } @@ -1395,8 +1092,6 @@ std::unique_lock 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(); @@ -1421,15 +1116,7 @@ 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"); + } } } @@ -1438,12 +1125,6 @@ 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(frame), expr, - static_cast(expr_value_sp.get()), exe_results); #endif return LLDB_RECORD_RESULT(expr_result); @@ -1458,7 +1139,6 @@ bool SBFrame::IsInlined() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFrame, IsInlined); - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1474,14 +1154,7 @@ 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; @@ -1536,7 +1209,6 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1571,14 +1243,7 @@ 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; @@ -1587,7 +1252,6 @@ 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 lock; @@ -1623,15 +1287,7 @@ 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; Index: source/API/SBFunction.cpp =================================================================== --- source/API/SBFunction.cpp +++ source/API/SBFunction.cpp @@ -18,7 +18,6 @@ #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; @@ -58,15 +57,6 @@ 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(m_opaque_ptr), cstr); - else - log->Printf("SBFunction(%p)::GetName () => NULL", - static_cast(m_opaque_ptr)); - } return cstr; } @@ -79,15 +69,6 @@ .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(m_opaque_ptr), cstr); - else - log->Printf("SBFunction(%p)::GetDisplayName () => NULL", - static_cast(m_opaque_ptr)); - } return cstr; } @@ -97,15 +78,6 @@ 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(m_opaque_ptr), cstr); - else - log->Printf("SBFunction(%p)::GetMangledName () => NULL", - static_cast(m_opaque_ptr)); - } return cstr; } Index: source/API/SBHostOS.cpp =================================================================== --- source/API/SBHostOS.cpp +++ source/API/SBHostOS.cpp @@ -20,7 +20,6 @@ #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 @@ -109,18 +108,6 @@ 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(reinterpret_cast(thread_function)), - static_cast(thread_arg), static_cast(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(); Index: source/API/SBLineEntry.cpp =================================================================== --- source/API/SBLineEntry.cpp +++ source/API/SBLineEntry.cpp @@ -12,7 +12,6 @@ #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 @@ -59,18 +58,6 @@ 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(m_opaque_up.get()), - static_cast(sb_address.get()), sstr.GetData()); - } - return LLDB_RECORD_RESULT(sb_address); } @@ -82,17 +69,6 @@ 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(m_opaque_up.get()), - static_cast(sb_address.get()), sstr.GetData()); - } return LLDB_RECORD_RESULT(sb_address); } @@ -105,36 +81,20 @@ 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(m_opaque_up.get()), - static_cast(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(m_opaque_up.get()), line); - return line; } Index: source/API/SBListener.cpp =================================================================== --- source/API/SBListener.cpp +++ source/API/SBListener.cpp @@ -15,7 +15,6 @@ #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; @@ -28,12 +27,6 @@ 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(m_opaque_sp.get())); } SBListener::SBListener(const SBListener &rhs) @@ -127,36 +120,6 @@ 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(m_opaque_sp.get()), - static_cast(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(m_opaque_sp.get()), - static_cast(lldb_broadcaster), event_mask, - acquired_event_mask); - } - } - return acquired_event_mask; } @@ -176,20 +139,6 @@ 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(m_opaque_sp.get()), - static_cast(event.get())); - } else { - log->Printf( - "SBListener(%p)::WaitForEvent (timeout_secs=%d, SBEvent(%p))...", - static_cast(m_opaque_sp.get()), timeout_secs, - static_cast(event.get())); - } - } bool success = false; if (m_opaque_sp) { @@ -206,19 +155,6 @@ } } - if (log) { - if (timeout_secs == UINT32_MAX) { - log->Printf("SBListener(%p)::WaitForEvent (timeout_secs=INFINITE, " - "SBEvent(%p)) => %i", - static_cast(m_opaque_sp.get()), - static_cast(event.get()), success); - } else { - log->Printf( - "SBListener(%p)::WaitForEvent (timeout_secs=%d, SBEvent(%p)) => %i", - static_cast(m_opaque_sp.get()), timeout_secs, - static_cast(event.get()), success); - } - } if (!success) event.reset(NULL); return success; Index: source/API/SBMemoryRegionInfoList.cpp =================================================================== --- source/API/SBMemoryRegionInfoList.cpp +++ source/API/SBMemoryRegionInfoList.cpp @@ -11,7 +11,6 @@ #include "lldb/API/SBMemoryRegionInfo.h" #include "lldb/API/SBStream.h" #include "lldb/Target/MemoryRegionInfo.h" -#include "lldb/Utility/Log.h" #include @@ -109,21 +108,7 @@ 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(m_opaque_up.get()), idx, - static_cast(region_info.m_opaque_up.get()), - sstr.GetData()); - } - - return result; + return m_opaque_up->GetMemoryRegionInfoAtIndex(idx, region_info.ref()); } void SBMemoryRegionInfoList::Clear() { Index: source/API/SBModule.cpp =================================================================== --- source/API/SBModule.cpp +++ source/API/SBModule.cpp @@ -25,7 +25,6 @@ #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; @@ -94,18 +93,11 @@ 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(module_sp.get()), - static_cast(file_spec.get())); - return LLDB_RECORD_RESULT(file_spec); } @@ -113,18 +105,12 @@ 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(module_sp.get()), - static_cast(file_spec.get())); - return LLDB_RECORD_RESULT(file_spec); } @@ -133,7 +119,6 @@ (const lldb::SBFileSpec &), platform_file); bool result = false; - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); ModuleSP module_sp(GetSP()); if (module_sp) { @@ -141,11 +126,6 @@ result = true; } - if (log) - log->Printf("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s)) => %i", - static_cast(module_sp.get()), - static_cast(platform_file.get()), - platform_file->GetPath().c_str(), result); return result; } @@ -175,30 +155,17 @@ 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(module_sp.get()), s.GetData()); - } else - log->Printf("SBModule(%p)::GetUUIDBytes () => NULL", - static_cast(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()); @@ -211,15 +178,9 @@ } if (uuid_cstr && uuid_cstr[0]) { - if (log) - log->Printf("SBModule(%p)::GetUUIDString () => %s", - static_cast(module_sp.get()), uuid_cstr); return uuid_cstr; } - if (log) - log->Printf("SBModule(%p)::GetUUIDString () => NULL", - static_cast(module_sp.get())); return NULL; } Index: source/API/SBProcess.cpp =================================================================== --- source/API/SBProcess.cpp +++ source/API/SBProcess.cpp @@ -25,7 +25,6 @@ #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" @@ -138,19 +137,6 @@ 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(m_opaque_wp.lock().get()), - static_cast(argv), static_cast(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(error.get())); - ProcessSP process_sp(GetSP()); if (process_sp) { std::lock_guard guard( @@ -176,14 +162,6 @@ error.SetErrorString("unable to attach pid"); } - if (log) { - SBStream sstr; - error.GetDescription(sstr); - log->Printf("SBProcess(%p)::RemoteLaunch (...) => SBError (%p): %s", - static_cast(process_sp.get()), - static_cast(error.get()), sstr.GetData()); - } - return error.Success(); } @@ -208,24 +186,12 @@ 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(process_sp.get()), pid, - static_cast(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) { @@ -237,10 +203,6 @@ num_threads = process_sp->GetThreadList().GetSize(can_update); } - if (log) - log->Printf("SBProcess(%p)::GetNumThreads () => %d", - static_cast(process_sp.get()), num_threads); - return num_threads; } @@ -248,8 +210,6 @@ 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()); @@ -260,11 +220,6 @@ sb_thread.SetThread(thread_sp); } - if (log) - log->Printf("SBProcess(%p)::GetSelectedThread () => SBThread(%p)", - static_cast(process_sp.get()), - static_cast(thread_sp.get())); - return LLDB_RECORD_RESULT(sb_thread); } @@ -273,8 +228,6 @@ 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()); @@ -285,20 +238,12 @@ sb_thread.SetThread(thread_sp); } - if (log) - log->Printf("SBProcess(%p)::CreateOSPluginThread (tid=0x%" PRIx64 - ", context=0x%" PRIx64 ") => SBThread(%p)", - static_cast(process_sp.get()), tid, context, - static_cast(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()); @@ -307,11 +252,6 @@ sb_target.SetSP(target_sp); } - if (log) - log->Printf("SBProcess(%p)::GetTarget () => SBTarget(%p)", - static_cast(process_sp.get()), - static_cast(target_sp.get())); - return LLDB_RECORD_RESULT(sb_target); } @@ -319,8 +259,6 @@ 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) { @@ -328,12 +266,6 @@ ret_val = process_sp->PutSTDIN(src, src_len, error); } - if (log) - log->Printf("SBProcess(%p)::PutSTDIN (src=\"%s\", src_len=%" PRIu64 - ") => %" PRIu64, - static_cast(process_sp.get()), src, - static_cast(src_len), static_cast(ret_val)); - return ret_val; } @@ -348,14 +280,6 @@ 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(process_sp.get()), static_cast(bytes_read), - dst, static_cast(dst_len), static_cast(bytes_read)); - return bytes_read; } @@ -370,14 +294,6 @@ 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(process_sp.get()), static_cast(bytes_read), - dst, static_cast(dst_len), static_cast(bytes_read)); - return bytes_read; } @@ -392,14 +308,6 @@ 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(process_sp.get()), static_cast(bytes_read), - dst, static_cast(dst_len), static_cast(bytes_read)); - return bytes_read; } @@ -408,7 +316,6 @@ 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; @@ -420,7 +327,6 @@ } 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); } @@ -480,7 +386,6 @@ 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()); @@ -490,12 +395,6 @@ ret_val = process_sp->GetThreadList().SetSelectedThreadByID(tid); } - if (log) - log->Printf("SBProcess(%p)::SetSelectedThreadByID (tid=0x%4.4" PRIx64 - ") => %s", - static_cast(process_sp.get()), tid, - (ret_val ? "true" : "false")); - return ret_val; } @@ -503,8 +402,6 @@ 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) { @@ -513,10 +410,6 @@ ret_val = process_sp->GetThreadList().SetSelectedThreadByIndexID(index_id); } - if (log) - log->Printf("SBProcess(%p)::SetSelectedThreadByID (tid=0x%x) => %s", - static_cast(process_sp.get()), index_id, - (ret_val ? "true" : "false")); return ret_val; } @@ -525,8 +418,6 @@ 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()); @@ -539,20 +430,12 @@ sb_thread.SetThread(thread_sp); } - if (log) - log->Printf("SBProcess(%p)::GetThreadAtIndex (index=%d) => SBThread(%p)", - static_cast(process_sp.get()), - static_cast(index), - static_cast(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) { @@ -564,10 +447,6 @@ } } - if (log) - log->Printf("SBProcess(%p)::GetNumQueues () => %d", - static_cast(process_sp.get()), num_queues); - return num_queues; } @@ -575,8 +454,6 @@ 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()); @@ -590,12 +467,6 @@ } } - if (log) - log->Printf("SBProcess(%p)::GetQueueAtIndex (index=%d) => SBQueue(%p)", - static_cast(process_sp.get()), - static_cast(index), - static_cast(queue_sp.get())); - return LLDB_RECORD_RESULT(sb_queue); } @@ -619,8 +490,6 @@ 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()); @@ -631,12 +500,6 @@ sb_event.reset(event_sp); } - if (log) - log->Printf("SBProcess(%p)::GetStopEventForStopID (stop_id=%" PRIu32 - ") => SBEvent(%p)", - static_cast(process_sp.get()), stop_id, - static_cast(event_sp.get())); - return LLDB_RECORD_RESULT(sb_event); } @@ -651,12 +514,6 @@ ret_val = process_sp->GetState(); } - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) - log->Printf("SBProcess(%p)::GetState () => %s", - static_cast(process_sp.get()), - lldb_private::StateAsCString(ret_val)); - return ret_val; } @@ -670,11 +527,6 @@ 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(process_sp.get()), exit_status, - exit_status); return exit_status; } @@ -689,10 +541,6 @@ 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(process_sp.get()), exit_desc); return exit_desc; } @@ -704,11 +552,6 @@ 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(process_sp.get()), ret_val); - return ret_val; } @@ -719,10 +562,6 @@ 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(process_sp.get()), ret_val); return ret_val; } @@ -734,10 +573,6 @@ 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(process_sp.get()), byteOrder); return byteOrder; } @@ -750,10 +585,6 @@ 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(process_sp.get()), size); return size; } @@ -761,15 +592,9 @@ 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(process_sp.get())); - if (process_sp) { std::lock_guard guard( process_sp->GetTarget().GetAPIMutex()); @@ -781,14 +606,6 @@ } 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(process_sp.get()), - static_cast(sb_error.get()), sstr.GetData()); - } - return LLDB_RECORD_RESULT(sb_error); } @@ -804,15 +621,6 @@ } 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(process_sp.get()), - static_cast(sb_error.get()), sstr.GetData()); - } - return LLDB_RECORD_RESULT(sb_error); } @@ -828,15 +636,6 @@ } 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(process_sp.get()), - static_cast(sb_error.get()), sstr.GetData()); - } - return LLDB_RECORD_RESULT(sb_error); } @@ -852,15 +651,6 @@ } 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(process_sp.get()), - static_cast(sb_error.get()), sstr.GetData()); - } - return LLDB_RECORD_RESULT(sb_error); } @@ -898,14 +688,7 @@ 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(process_sp.get()), signo, - static_cast(sb_error.get()), sstr.GetData()); - } + return LLDB_RECORD_RESULT(sb_error); } @@ -943,13 +726,6 @@ 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(process_sp.get()), tid, - static_cast(thread_sp.get())); - return LLDB_RECORD_RESULT(sb_thread); } @@ -970,12 +746,6 @@ 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(process_sp.get()), index_id, - static_cast(thread_sp.get())); - return LLDB_RECORD_RESULT(sb_thread); } @@ -983,15 +753,8 @@ 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(event.get()), - lldb_private::StateAsCString(ret_val)); - return ret_val; } @@ -999,14 +762,8 @@ 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(event.get()), ret_val); - return ret_val; } @@ -1079,16 +836,11 @@ 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(process_sp.get()), - static_cast(broadcaster.get())); return LLDB_RECORD_RESULT(broadcaster); } @@ -1102,18 +854,11 @@ 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(process_sp.get()), addr, - static_cast(dst), static_cast(dst_len), - static_cast(sb_error.get())); if (process_sp) { Process::StopLocker stop_locker; @@ -1122,26 +867,12 @@ 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(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(process_sp.get()), addr, - static_cast(dst), static_cast(dst_len), - static_cast(sb_error.get()), sstr.GetData(), - static_cast(bytes_read)); - } - return bytes_read; } @@ -1157,11 +888,6 @@ 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(process_sp.get())); sb_error.SetErrorString("process is running"); } } else { @@ -1186,11 +912,6 @@ 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(process_sp.get())); sb_error.SetErrorString("process is running"); } } else { @@ -1213,11 +934,6 @@ 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(process_sp.get())); sb_error.SetErrorString("process is running"); } } else { @@ -1230,17 +946,8 @@ 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(process_sp.get()), addr, - static_cast(src), static_cast(src_len), - static_cast(sb_error.get())); - if (process_sp) { Process::StopLocker stop_locker; if (stop_locker.TryLock(&process_sp->GetRunLock())) { @@ -1249,24 +956,10 @@ 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(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(process_sp.get()), addr, - static_cast(src), static_cast(src_len), - static_cast(sb_error.get()), sstr.GetData(), - static_cast(bytes_written)); - } - return bytes_written; } @@ -1301,17 +994,12 @@ 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 guard( process_sp->GetTarget().GetAPIMutex()); sb_error.SetError(process_sp->GetWatchpointSupportInfo(num)); - if (log) - log->Printf("SBProcess(%p)::GetNumSupportedHardwareWatchpoints () => %u", - static_cast(process_sp.get()), num); } else { sb_error.SetErrorString("SBProcess is invalid"); } @@ -1335,33 +1023,19 @@ (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(process_sp.get()), - sb_local_image_spec.GetFilename()); - std::lock_guard 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(process_sp.get())); sb_error.SetErrorString("process is running"); } - } else { - if (log) - log->Printf("SBProcess(%p)::LoadImage() => error: called with invalid" - " process", - static_cast(process_sp.get())); + } else { sb_error.SetErrorString("process is invalid"); } return LLDB_INVALID_IMAGE_TOKEN; @@ -1376,17 +1050,10 @@ 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(process_sp.get()), - image_spec.GetFilename()); - std::lock_guard guard( process_sp->GetTarget().GetAPIMutex()); PlatformSP platform_sp = process_sp->GetTarget().GetPlatform(); @@ -1396,30 +1063,19 @@ 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(process_sp.get())); error.SetErrorString("process is running"); } - } else { - if (log) - log->Printf("SBProcess(%p)::LoadImageUsingPaths() => error: " - "called with invalid process", - static_cast(process_sp.get())); + } else { error.SetErrorString("process is invalid"); } - + return LLDB_INVALID_IMAGE_TOKEN; } @@ -1438,10 +1094,6 @@ 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(process_sp.get())); sb_error.SetErrorString("process is running"); } } else @@ -1462,11 +1114,6 @@ 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(process_sp.get())); sb_error.SetErrorString("process is running"); } } else @@ -1496,12 +1143,6 @@ 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(process_sp.get())); } } return NULL; @@ -1579,11 +1220,6 @@ 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(process_sp.get())); sb_error.SetErrorString("process is running"); } } else { @@ -1605,12 +1241,6 @@ 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(process_sp.get())); } return LLDB_RECORD_RESULT(sb_region_list); Index: source/API/SBQueue.cpp =================================================================== --- source/API/SBQueue.cpp +++ source/API/SBQueue.cpp @@ -19,7 +19,6 @@ #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; @@ -71,10 +70,6 @@ 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(this), result); return result; } @@ -84,10 +79,6 @@ 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(this), result); return result; } @@ -97,12 +88,6 @@ 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(this), name ? name : "NULL"); - return name; } @@ -263,20 +248,12 @@ 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(); } @@ -287,45 +264,26 @@ 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) { @@ -333,44 +291,26 @@ 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() { Index: source/API/SBQueueItem.cpp =================================================================== --- source/API/SBQueueItem.cpp +++ source/API/SBQueueItem.cpp @@ -16,7 +16,6 @@ #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; @@ -42,22 +41,12 @@ 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(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(m_queue_item_sp.get())); m_queue_item_sp.reset(); } @@ -72,14 +61,9 @@ 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(m_queue_item_sp.get()), - static_cast(result)); return result; } @@ -95,20 +79,9 @@ 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(m_queue_item_sp.get()), - static_cast(result.get()), sstr.GetData()); - } return LLDB_RECORD_RESULT(result); } @@ -125,7 +98,6 @@ (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; @@ -138,17 +110,6 @@ // 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(m_queue_item_sp.get()), - static_cast(thread_sp.get()), - static_cast(thread_sp->GetQueueID()), queue_name); - } } } } Index: source/API/SBSection.cpp =================================================================== --- source/API/SBSection.cpp +++ source/API/SBSection.cpp @@ -15,7 +15,6 @@ #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; Index: source/API/SBSymbol.cpp =================================================================== --- source/API/SBSymbol.cpp +++ source/API/SBSymbol.cpp @@ -14,7 +14,6 @@ #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; @@ -57,10 +56,6 @@ 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(m_opaque_ptr), name ? name : ""); return name; } @@ -73,10 +68,6 @@ .GetDisplayDemangledName(m_opaque_ptr->GetLanguage()) .AsCString(); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) - log->Printf("SBSymbol(%p)::GetDisplayName () => \"%s\"", - static_cast(m_opaque_ptr), name ? name : ""); return name; } @@ -86,11 +77,6 @@ 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(m_opaque_ptr), name ? name : ""); - return name; } Index: source/API/SBSymbolContext.cpp =================================================================== --- source/API/SBSymbolContext.cpp +++ source/API/SBSymbolContext.cpp @@ -14,7 +14,6 @@ #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; @@ -66,8 +65,6 @@ 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) { @@ -75,14 +72,6 @@ sb_module.SetSP(module_sp); } - if (log) { - SBStream sstr; - sb_module.GetDescription(sstr); - log->Printf("SBSymbolContext(%p)::GetModule () => SBModule(%p): %s", - static_cast(m_opaque_up.get()), - static_cast(module_sp.get()), sstr.GetData()); - } - return LLDB_RECORD_RESULT(sb_module); } @@ -97,8 +86,6 @@ 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) @@ -106,11 +93,6 @@ SBFunction sb_function(function); - if (log) - log->Printf("SBSymbolContext(%p)::GetFunction () => SBFunction(%p)", - static_cast(m_opaque_up.get()), - static_cast(function)); - return LLDB_RECORD_RESULT(sb_function); } @@ -123,26 +105,16 @@ 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(m_opaque_up.get()), - static_cast(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) @@ -150,11 +122,6 @@ SBSymbol sb_symbol(symbol); - if (log) - log->Printf("SBSymbolContext(%p)::GetSymbol () => SBSymbol(%p)", - static_cast(m_opaque_up.get()), - static_cast(symbol)); - return LLDB_RECORD_RESULT(sb_symbol); } Index: source/API/SBTarget.cpp =================================================================== --- source/API/SBTarget.cpp +++ source/API/SBTarget.cpp @@ -61,7 +61,6 @@ #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" @@ -186,12 +185,6 @@ sb_process.SetSP(process_sp); } - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) - log->Printf("SBTarget(%p)::GetProcess () => SBProcess(%p)", - static_cast(target_sp.get()), - static_cast(process_sp.get())); - return LLDB_RECORD_RESULT(sb_process); } @@ -332,23 +325,10 @@ 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(target_sp.get()), static_cast(argv), - static_cast(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(error.get())); - if (target_sp) { std::lock_guard guard(target_sp->GetAPIMutex()); @@ -408,13 +388,6 @@ 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(target_sp.get()), - static_cast(sb_process.GetSP().get()), - error.GetCString()); - return LLDB_RECORD_RESULT(sb_process); } @@ -423,15 +396,10 @@ (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(target_sp.get())); - if (target_sp) { std::lock_guard guard(target_sp->GetAPIMutex()); StateType state = eStateInvalid; @@ -469,12 +437,6 @@ error.SetErrorString("SBTarget is invalid"); } - log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API); - if (log) - log->Printf("SBTarget(%p)::Launch (...) => SBProcess(%p)", - static_cast(target_sp.get()), - static_cast(sb_process.GetSP().get())); - return LLDB_RECORD_RESULT(sb_process); } @@ -483,15 +445,9 @@ (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(target_sp.get())); - if (target_sp) { ProcessAttachInfo &attach_info = sb_attach_info.ref(); if (attach_info.ProcessIDIsValid() && !attach_info.UserIDIsValid()) { @@ -505,11 +461,6 @@ } else { error.ref().SetErrorStringWithFormat( "no process found with process ID %" PRIu64, attach_pid); - if (log) { - log->Printf("SBTarget(%p)::Attach (...) => error %s", - static_cast(target_sp.get()), - error.GetCString()); - } return LLDB_RECORD_RESULT(sb_process); } } @@ -521,11 +472,6 @@ error.SetErrorString("SBTarget is invalid"); } - if (log) - log->Printf("SBTarget(%p)::Attach (...) => SBProcess(%p)", - static_cast(target_sp.get()), - static_cast(sb_process.GetSP().get())); - return LLDB_RECORD_RESULT(sb_process); } @@ -538,15 +484,9 @@ (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(target_sp.get()), __FUNCTION__, pid); - if (target_sp) { ProcessAttachInfo attach_info; attach_info.SetProcessID(pid); @@ -563,10 +503,6 @@ } else error.SetErrorString("SBTarget is invalid"); - if (log) - log->Printf("SBTarget(%p)::%s (...) => SBProcess(%p)", - static_cast(target_sp.get()), __FUNCTION__, - static_cast(sb_process.GetSP().get())); return LLDB_RECORD_RESULT(sb_process); } @@ -580,16 +516,9 @@ (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(target_sp.get()), __FUNCTION__, name, - wait_for ? "true" : "false"); - if (name && target_sp) { ProcessAttachInfo attach_info; attach_info.GetExecutableFile().SetFile(name, FileSpec::Style::native); @@ -603,10 +532,6 @@ } else error.SetErrorString("SBTarget is invalid"); - if (log) - log->Printf("SBTarget(%p)::%s (...) => SBProcess(%p)", - static_cast(target_sp.get()), __FUNCTION__, - static_cast(sb_process.GetSP().get())); return LLDB_RECORD_RESULT(sb_process); } @@ -618,17 +543,10 @@ (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(target_sp.get()), url, plugin_name); - if (target_sp) { std::lock_guard guard(target_sp->GetAPIMutex()); if (listener.IsValid()) @@ -648,10 +566,6 @@ error.SetErrorString("SBTarget is invalid"); } - if (log) - log->Printf("SBTarget(%p)::ConnectRemote (...) => SBProcess(%p)", - static_cast(target_sp.get()), - static_cast(process_sp.get())); return LLDB_RECORD_RESULT(sb_process); } @@ -666,13 +580,6 @@ 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(target_sp.get()), - static_cast(exe_file_spec.get())); - } - return LLDB_RECORD_RESULT(exe_file_spec); } @@ -837,8 +744,6 @@ 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) { @@ -858,17 +763,6 @@ 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(target_sp.get()), path, line, - static_cast(sb_bp.GetSP().get()), sstr.GetData()); - } - return LLDB_RECORD_RESULT(sb_bp); } @@ -877,8 +771,6 @@ 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()) { @@ -901,12 +793,6 @@ } } - if (log) - log->Printf("SBTarget(%p)::BreakpointCreateByName (symbol=\"%s\", " - "module=\"%s\") => SBBreakpoint(%p)", - static_cast(target_sp.get()), symbol_name, module_name, - static_cast(sb_bp.GetSP().get())); - return LLDB_RECORD_RESULT(sb_bp); } @@ -949,8 +835,6 @@ 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]) { @@ -964,12 +848,6 @@ skip_prologue, internal, hardware); } - if (log) - log->Printf("SBTarget(%p)::BreakpointCreateByName (symbol=\"%s\", " - "name_type: %d) => SBBreakpoint(%p)", - static_cast(target_sp.get()), symbol_name, - name_type_mask, static_cast(sb_bp.GetSP().get())); - return LLDB_RECORD_RESULT(sb_bp); } @@ -1014,8 +892,6 @@ 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) { @@ -1029,24 +905,6 @@ symbol_language, offset, skip_prologue, internal, hardware); } - if (log) { - log->Printf("SBTarget(%p)::BreakpointCreateByName (symbols={", - static_cast(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("\"\"%c ", sep); - } - log->Printf("name_type: %d) => SBBreakpoint(%p)", name_type_mask, - static_cast(sb_bp.GetSP().get())); - } - return LLDB_RECORD_RESULT(sb_bp); } @@ -1088,7 +946,6 @@ 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()); @@ -1104,12 +961,6 @@ skip_prologue, internal, hardware); } - if (log) - log->Printf("SBTarget(%p)::BreakpointCreateByRegex (symbol_regex=\"%s\") " - "=> SBBreakpoint(%p)", - static_cast(target_sp.get()), symbol_name_regex, - static_cast(sb_bp.GetSP().get())); - return LLDB_RECORD_RESULT(sb_bp); } @@ -1117,8 +968,6 @@ 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) { @@ -1127,13 +976,6 @@ sb_bp = target_sp->CreateBreakpoint(address, false, hardware); } - if (log) - log->Printf("SBTarget(%p)::BreakpointCreateByAddress (address=%" PRIu64 - ") => SBBreakpoint(%p)", - static_cast(target_sp.get()), - static_cast(address), - static_cast(sb_bp.GetSP().get())); - return LLDB_RECORD_RESULT(sb_bp); } @@ -1141,15 +983,9 @@ 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(target_sp.get())); return LLDB_RECORD_RESULT(sb_bp); } @@ -1159,15 +995,6 @@ 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(target_sp.get()), s.GetData(), - static_cast(sb_bp.GetSP().get())); - } - return LLDB_RECORD_RESULT(sb_bp); } @@ -1218,8 +1045,6 @@ 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]) { @@ -1237,12 +1062,6 @@ false, hardware, move_to_nearest_code); } - if (log) - log->Printf("SBTarget(%p)::BreakpointCreateByRegex (source_regex=\"%s\") " - "=> SBBreakpoint(%p)", - static_cast(target_sp.get()), source_regex, - static_cast(sb_bp.GetSP().get())); - return LLDB_RECORD_RESULT(sb_bp); } @@ -1253,8 +1072,6 @@ (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) { @@ -1264,14 +1081,6 @@ hardware); } - if (log) - log->Printf("SBTarget(%p)::BreakpointCreateForException (Language: %s, catch: " - "%s throw: %s) => SBBreakpoint(%p)", - static_cast(target_sp.get()), - Language::GetNameForLanguageType(language), - catch_bp ? "on" : "off", throw_bp ? "on" : "off", - static_cast(sb_bp.GetSP().get())); - return LLDB_RECORD_RESULT(sb_bp); } @@ -1285,14 +1094,12 @@ 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 guard(target_sp->GetAPIMutex()); Status error; - + StructuredData::ObjectSP obj_sp = extra_args.m_impl_up->GetObjectSP(); sb_bp = target_sp->CreateScriptedBreakpoint(class_name, @@ -1303,12 +1110,6 @@ obj_sp, &error); } - if (log) - log->Printf("SBTarget(%p)::BreakpointCreateFromScript (class name: %s) " - " => SBBreakpoint(%p)", - static_cast(target_sp.get()), - class_name, - static_cast(sb_bp.GetSP().get())); return LLDB_RECORD_RESULT(sb_bp); } @@ -1341,8 +1142,6 @@ 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) { @@ -1350,11 +1149,6 @@ result = target_sp->RemoveBreakpointByID(bp_id); } - if (log) - log->Printf("SBTarget(%p)::BreakpointDelete (bp_id=%d) => %i", - static_cast(target_sp.get()), - static_cast(bp_id), result); - return result; } @@ -1362,8 +1156,6 @@ 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) { @@ -1371,12 +1163,6 @@ sb_breakpoint = target_sp->GetBreakpointByID(bp_id); } - if (log) - log->Printf( - "SBTarget(%p)::FindBreakpointByID (bp_id=%d) => SBBreakpoint(%p)", - static_cast(target_sp.get()), static_cast(bp_id), - static_cast(sb_breakpoint.GetSP().get())); - return LLDB_RECORD_RESULT(sb_breakpoint); } @@ -1576,7 +1362,6 @@ 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()); @@ -1587,11 +1372,6 @@ result = target_sp->RemoveWatchpointByID(wp_id); } - if (log) - log->Printf("SBTarget(%p)::WatchpointDelete (wp_id=%d) => %i", - static_cast(target_sp.get()), - static_cast(wp_id), result); - return result; } @@ -1599,7 +1379,6 @@ 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; @@ -1612,12 +1391,6 @@ sb_watchpoint.SetSP(watchpoint_sp); } - if (log) - log->Printf( - "SBTarget(%p)::FindWatchpointByID (bp_id=%d) => SBWatchpoint(%p)", - static_cast(target_sp.get()), static_cast(wp_id), - static_cast(watchpoint_sp.get())); - return LLDB_RECORD_RESULT(sb_watchpoint); } @@ -1628,8 +1401,6 @@ (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()); @@ -1657,13 +1428,6 @@ sb_watchpoint.SetSP(watchpoint_sp); } - if (log) - log->Printf("SBTarget(%p)::WatchAddress (addr=0x%" PRIx64 - ", 0x%u) => SBWatchpoint(%p)", - static_cast(target_sp.get()), addr, - static_cast(size), - static_cast(watchpoint_sp.get())); - return LLDB_RECORD_RESULT(sb_watchpoint); } @@ -1712,16 +1476,6 @@ 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(m_opaque_sp.get()), - new_value_sp->GetName().AsCString()); - else - log->Printf("SBTarget(%p)::CreateValueFromAddress => NULL", - static_cast(m_opaque_sp.get())); - } return LLDB_RECORD_RESULT(sb_value); } @@ -1742,16 +1496,6 @@ 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(m_opaque_sp.get()), - new_value_sp->GetName().AsCString()); - else - log->Printf("SBTarget(%p)::CreateValueFromData => NULL", - static_cast(m_opaque_sp.get())); - } return LLDB_RECORD_RESULT(sb_value); } @@ -1769,16 +1513,6 @@ 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(m_opaque_sp.get()), - new_value_sp->GetName().AsCString()); - else - log->Printf("SBTarget(%p)::CreateValueFromExpression => NULL", - static_cast(m_opaque_sp.get())); - } return LLDB_RECORD_RESULT(sb_value); } @@ -1812,11 +1546,6 @@ if (!csTo) return error.SetErrorString(" path can't be empty"); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) - log->Printf("SBTarget(%p)::%s: '%s' -> '%s'", - static_cast(target_sp.get()), __FUNCTION__, - from, to); target_sp->GetImageSearchPathList().Append(csFrom, csTo, true); } @@ -1884,8 +1613,6 @@ 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) { @@ -1893,22 +1620,12 @@ num = target_sp->GetImages().GetSize(); } - if (log) - log->Printf("SBTarget(%p)::GetNumModules () => %d", - static_cast(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(m_opaque_sp.get())); - m_opaque_sp.reset(); } @@ -1997,8 +1714,6 @@ 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()); @@ -2008,11 +1723,6 @@ sb_module.SetSP(module_sp); } - if (log) - log->Printf("SBTarget(%p)::GetModuleAtIndex (idx=%d) => SBModule(%p)", - static_cast(target_sp.get()), idx, - static_cast(module_sp.get())); - return LLDB_RECORD_RESULT(sb_module); } @@ -2029,15 +1739,10 @@ 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(target_sp.get()), - static_cast(broadcaster.get())); return LLDB_RECORD_RESULT(broadcaster); } @@ -2622,7 +2327,6 @@ (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 @@ -2633,17 +2337,12 @@ 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 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(); @@ -2663,10 +2362,6 @@ 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 @@ -2674,12 +2369,6 @@ 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(frame), expr, - static_cast(expr_value_sp.get()), exe_results); #endif return LLDB_RECORD_RESULT(expr_result); Index: source/API/SBThread.cpp =================================================================== --- source/API/SBThread.cpp +++ source/API/SBThread.cpp @@ -100,7 +100,6 @@ std::unique_lock 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())) { @@ -108,18 +107,9 @@ if (queue_sp) { sb_queue.SetQueue(queue_sp); } - } else { - if (log) - log->Printf("SBThread(%p)::GetQueue() => error: process is running", - static_cast(exe_ctx.GetThreadPtr())); } } - if (log) - log->Printf("SBThread(%p)::GetQueue () => SBQueue(%p)", - static_cast(exe_ctx.GetThreadPtr()), - static_cast(queue_sp.get())); - return LLDB_RECORD_RESULT(sb_queue); } @@ -149,8 +139,6 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -159,19 +147,9 @@ 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(exe_ctx.GetThreadPtr())); } } - if (log) - log->Printf("SBThread(%p)::GetStopReason () => %s", - static_cast(exe_ctx.GetThreadPtr()), - Thread::StopReasonAsCString(reason)); - return reason; } @@ -219,12 +197,6 @@ return 1; } } - } else { - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) - log->Printf("SBThread(%p)::GetStopReasonDataCount() => error: process " - "is running", - static_cast(exe_ctx.GetThreadPtr())); } } return 0; @@ -287,12 +259,6 @@ 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(exe_ctx.GetThreadPtr())); } } return 0; @@ -350,8 +316,6 @@ LLDB_RECORD_METHOD(size_t, SBThread, GetStopDescription, (char *, size_t), dst, dst_len); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - std::unique_lock lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -363,10 +327,6 @@ 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(exe_ctx.GetThreadPtr()), stop_desc); if (dst) return ::snprintf(dst, dst_len, "%s", stop_desc); else { @@ -431,11 +391,6 @@ } if (stop_desc && stop_desc[0]) { - if (log) - log->Printf( - "SBThread(%p)::GetStopDescription (dst, dst_len) => '%s'", - static_cast(exe_ctx.GetThreadPtr()), stop_desc); - if (dst) return ::snprintf(dst, dst_len, "%s", stop_desc) + 1; // Include the NULL byte @@ -447,12 +402,6 @@ } } } - } else { - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) - log->Printf( - "SBThread(%p)::GetStopDescription() => error: process is running", - static_cast(exe_ctx.GetThreadPtr())); } } if (dst) @@ -463,7 +412,6 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -475,20 +423,9 @@ 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(exe_ctx.GetThreadPtr())); } } - if (log) - log->Printf("SBThread(%p)::GetStopReturnValue () => %s", - static_cast(exe_ctx.GetThreadPtr()), - return_valobj_sp.get() ? return_valobj_sp->GetValueAsCString() - : ""); - return LLDB_RECORD_RESULT(SBValue(return_valobj_sp)); } @@ -517,7 +454,6 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -526,18 +462,9 @@ 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(exe_ctx.GetThreadPtr())); } } - if (log) - log->Printf("SBThread(%p)::GetName () => %s", - static_cast(exe_ctx.GetThreadPtr()), - name ? name : "NULL"); - return name; } @@ -548,23 +475,13 @@ std::unique_lock 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(exe_ctx.GetThreadPtr())); } } - if (log) - log->Printf("SBThread(%p)::GetQueueName () => %s", - static_cast(exe_ctx.GetThreadPtr()), - name ? name : "NULL"); - return name; } @@ -575,22 +492,13 @@ std::unique_lock 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(exe_ctx.GetThreadPtr())); } } - if (log) - log->Printf("SBThread(%p)::GetQueueID () => 0x%" PRIx64, - static_cast(exe_ctx.GetThreadPtr()), id); - return id; } @@ -598,7 +506,6 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -637,18 +544,9 @@ } } } - } else { - if (log) - log->Printf("SBThread(%p)::GetInfoItemByPathAsString() => error: " - "process is running", - static_cast(exe_ctx.GetThreadPtr())); } } - if (log) - log->Printf("SBThread(%p)::GetInfoItemByPathAsString (\"%s\") => \"%s\"", - static_cast(exe_ctx.GetThreadPtr()), path, strm.GetData()); - return success; } @@ -698,16 +596,9 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); - if (log) - log->Printf("SBThread(%p)::StepOver (stop_other_threads='%s')", - static_cast(exe_ctx.GetThreadPtr()), - Thread::RunModeAsCString(stop_other_threads)); - if (!exe_ctx.HasThreadScope()) { error.SetErrorString("this SBThread object is invalid"); return; @@ -756,18 +647,10 @@ (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 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(exe_ctx.GetThreadPtr()), - target_name ? target_name : "", - Thread::RunModeAsCString(stop_other_threads)); - if (!exe_ctx.HasThreadScope()) { error.SetErrorString("this SBThread object is invalid"); return; @@ -819,15 +702,9 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); - if (log) - log->Printf("SBThread(%p)::StepOut ()", - static_cast(exe_ctx.GetThreadPtr())); - if (!exe_ctx.HasThreadScope()) { error.SetErrorString("this SBThread object is invalid"); return; @@ -862,28 +739,16 @@ LLDB_RECORD_METHOD(void, SBThread, StepOutOfFrame, (lldb::SBFrame &, lldb::SBError &), sb_frame, error); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock 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(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(exe_ctx.GetThreadPtr()), - static_cast(frame_sp.get()), frame_desc_strm.GetData()); - } if (!exe_ctx.HasThreadScope()) { error.SetErrorString("this SBThread object is invalid"); @@ -894,10 +759,6 @@ 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(exe_ctx.GetThreadPtr()), - sb_frame.GetThread().GetThreadID(), thread->GetID()); error.SetErrorString("passed a frame from another thread"); return; } @@ -924,15 +785,9 @@ LLDB_RECORD_METHOD(void, SBThread, StepInstruction, (bool, lldb::SBError &), step_over, error); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - std::unique_lock lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); - if (log) - log->Printf("SBThread(%p)::StepInstruction (step_over=%i)", - static_cast(exe_ctx.GetThreadPtr()), step_over); - if (!exe_ctx.HasThreadScope()) { error.SetErrorString("this SBThread object is invalid"); return; @@ -960,15 +815,9 @@ LLDB_RECORD_METHOD(void, SBThread, RunToAddress, (lldb::addr_t, lldb::SBError &), addr, error); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - std::unique_lock lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); - if (log) - log->Printf("SBThread(%p)::RunToAddress (addr=0x%" PRIx64 ")", - static_cast(exe_ctx.GetThreadPtr()), addr); - if (!exe_ctx.HasThreadScope()) { error.SetErrorString("this SBThread object is invalid"); return; @@ -998,7 +847,6 @@ sb_file_spec, line); SBError sb_error; - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); char path[PATH_MAX]; std::unique_lock lock; @@ -1006,17 +854,6 @@ 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(exe_ctx.GetThreadPtr()), - static_cast(frame_sp.get()), frame_desc_strm.GetData(), - path, line); - } - if (exe_ctx.HasThreadScope()) { Target *target = exe_ctx.GetTargetPtr(); Thread *thread = exe_ctx.GetThreadPtr(); @@ -1135,17 +972,11 @@ (const char *, bool), script_class_name, resume_immediately); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); SBError error; std::unique_lock lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); - if (log) { - log->Printf("SBThread(%p)::StepUsingScriptedThreadPlan: class name: %s", - static_cast(exe_ctx.GetThreadPtr()), script_class_name); - } - if (!exe_ctx.HasThreadScope()) { error.SetErrorString("this SBThread object is invalid"); return LLDB_RECORD_RESULT(error); @@ -1176,17 +1007,11 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); - if (log) - log->Printf("SBThread(%p)::JumpToLine (file+line = %s:%u)", - static_cast(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); @@ -1205,16 +1030,9 @@ SBError sb_error; - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - std::unique_lock lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); - if (log) - log->Printf("SBThread(%p)::ReturnFromFrame (frame=%d)", - static_cast(exe_ctx.GetThreadPtr()), - frame.GetFrameID()); - if (exe_ctx.HasThreadScope()) { Thread *thread = exe_ctx.GetThreadPtr(); sb_error.SetError( @@ -1230,15 +1048,9 @@ SBError sb_error; - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - std::unique_lock lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); - if (log) - log->Printf("SBThread(%p)::UnwindExpressionEvaluation", - static_cast(exe_ctx.GetThreadPtr())); - if (exe_ctx.HasThreadScope()) { Thread *thread = exe_ctx.GetThreadPtr(); sb_error.SetError(thread->UnwindInnermostExpression()); @@ -1259,7 +1071,6 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1271,15 +1082,9 @@ result = true; } else { error.SetErrorString("process is running"); - if (log) - log->Printf("SBThread(%p)::Suspend() => error: process is running", - static_cast(exe_ctx.GetThreadPtr())); } } else error.SetErrorString("this SBThread object is invalid"); - if (log) - log->Printf("SBThread(%p)::Suspend() => %i", - static_cast(exe_ctx.GetThreadPtr()), result); return result; } @@ -1293,7 +1098,6 @@ 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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1306,15 +1110,9 @@ result = true; } else { error.SetErrorString("process is running"); - if (log) - log->Printf("SBThread(%p)::Resume() => error: process is running", - static_cast(exe_ctx.GetThreadPtr())); } } else error.SetErrorString("this SBThread object is invalid"); - if (log) - log->Printf("SBThread(%p)::Resume() => %i", - static_cast(exe_ctx.GetThreadPtr()), result); return result; } @@ -1353,24 +1151,12 @@ 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(exe_ctx.GetThreadPtr()), - static_cast(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 lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1379,25 +1165,15 @@ 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(exe_ctx.GetThreadPtr())); } } - if (log) - log->Printf("SBThread(%p)::GetNumFrames () => %u", - static_cast(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 lock; @@ -1408,30 +1184,15 @@ 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(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(exe_ctx.GetThreadPtr()), idx, - static_cast(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 lock; @@ -1442,22 +1203,9 @@ 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(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(exe_ctx.GetThreadPtr()), - static_cast(frame_sp.get()), frame_desc_strm.GetData()); - } - return LLDB_RECORD_RESULT(sb_frame); } @@ -1465,8 +1213,6 @@ 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 lock; @@ -1481,21 +1227,9 @@ thread->SetSelectedFrame(frame_sp.get()); sb_frame.SetFrameSP(frame_sp); } - } else { - if (log) - log->Printf( - "SBThread(%p)::SetSelectedFrame() => error: process is running", - static_cast(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(exe_ctx.GetThreadPtr()), idx, - static_cast(frame_sp.get()), frame_desc_strm.GetData()); - } return LLDB_RECORD_RESULT(sb_frame); } @@ -1587,7 +1321,6 @@ LLDB_RECORD_METHOD(lldb::SBThread, SBThread, GetExtendedBacktraceThread, (const char *), type); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); SBThread sb_origin_thread; @@ -1609,34 +1342,13 @@ // 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(exe_ctx.GetThreadPtr()), - static_cast(new_thread_sp.get()), - new_thread_sp->GetQueueID(), queue_name); - } } } } } - } else { - if (log) - log->Printf("SBThread(%p)::GetExtendedBacktraceThread() => error: " - "process is running", - static_cast(exe_ctx.GetThreadPtr())); } } - if (log && !sb_origin_thread.IsValid()) - log->Printf("SBThread(%p)::GetExtendedBacktraceThread() is not returning a " - "Valid thread", - static_cast(exe_ctx.GetThreadPtr())); return LLDB_RECORD_RESULT(sb_origin_thread); } Index: source/API/SBTrace.cpp =================================================================== --- source/API/SBTrace.cpp +++ source/API/SBTrace.cpp @@ -8,7 +8,6 @@ #include "SBReproducerPrivate.h" #include "lldb/Target/Process.h" -#include "lldb/Utility/Log.h" #include "lldb/API/SBTrace.h" #include "lldb/API/SBTraceOptions.h" @@ -28,7 +27,6 @@ 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 buffer(static_cast(buf), size); error.Clear(); @@ -37,7 +35,6 @@ } else { error.SetError( process_sp->GetData(GetTraceUID(), thread_id, buffer, offset)); - LLDB_LOG(log, "SBTrace::bytes_read - {0}", buffer.size()); } return buffer.size(); } @@ -45,17 +42,14 @@ 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 buffer(static_cast(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(); } Index: source/API/SBType.cpp =================================================================== --- source/API/SBType.cpp +++ source/API/SBType.cpp @@ -16,7 +16,6 @@ #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" Index: source/API/SBUnixSignals.cpp =================================================================== --- source/API/SBUnixSignals.cpp +++ source/API/SBUnixSignals.cpp @@ -11,7 +11,6 @@ #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" @@ -98,14 +97,8 @@ 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(signals_sp.get()), signo, value); - } - if (signals_sp) return signals_sp->SetShouldSuppress(signo, value); @@ -126,14 +119,8 @@ 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(signals_sp.get()), signo, value); - } - if (signals_sp) return signals_sp->SetShouldStop(signo, value); @@ -154,14 +141,8 @@ 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(signals_sp.get()), signo, value); - } - if (signals_sp) return signals_sp->SetShouldNotify(signo, value); Index: source/API/SBValue.cpp =================================================================== --- source/API/SBValue.cpp +++ source/API/SBValue.cpp @@ -36,7 +36,6 @@ #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" @@ -109,7 +108,6 @@ lldb::ValueObjectSP GetSP(Process::StopLocker &stop_locker, std::unique_lock &lock, Status &error) { - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); if (!m_valobj_sp) { error.SetErrorString("invalid value object"); return m_valobj_sp; @@ -128,9 +126,6 @@ // 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(value_sp.get())); error.SetErrorString("process must be stopped."); return ValueObjectSP(); } @@ -297,23 +292,12 @@ 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(value_sp.get()), name); - else - log->Printf("SBValue(%p)::GetName () => NULL", - static_cast(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)); @@ -321,22 +305,12 @@ name = value_sp->GetQualifiedTypeName().GetCString(); } - if (log) { - if (name) - log->Printf("SBValue(%p)::GetTypeName () => \"%s\"", - static_cast(value_sp.get()), name); - else - log->Printf("SBValue(%p)::GetTypeName () => NULL", - static_cast(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)); @@ -344,22 +318,12 @@ name = value_sp->GetDisplayTypeName().GetCString(); } - if (log) { - if (name) - log->Printf("SBValue(%p)::GetTypeName () => \"%s\"", - static_cast(value_sp.get()), name); - else - log->Printf("SBValue(%p)::GetTypeName () => NULL", - static_cast(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; @@ -368,11 +332,6 @@ result = value_sp->GetByteSize(); } - if (log) - log->Printf("SBValue(%p)::GetByteSize () => %" PRIu64, - static_cast(value_sp.get()), - static_cast(result)); - return result; } @@ -387,33 +346,18 @@ result = value_sp->IsInScope(); } - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) - log->Printf("SBValue(%p)::IsInScope () => %i", - static_cast(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(value_sp.get()), cstr); - else - log->Printf("SBValue(%p)::GetValue() => NULL", - static_cast(value_sp.get())); - } return cstr; } @@ -427,76 +371,25 @@ 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(value_sp.get())); - break; - case eValueTypeVariableGlobal: - log->Printf("SBValue(%p)::GetValueType () => eValueTypeVariableGlobal", - static_cast(value_sp.get())); - break; - case eValueTypeVariableStatic: - log->Printf("SBValue(%p)::GetValueType () => eValueTypeVariableStatic", - static_cast(value_sp.get())); - break; - case eValueTypeVariableArgument: - log->Printf("SBValue(%p)::GetValueType () => eValueTypeVariableArgument", - static_cast(value_sp.get())); - break; - case eValueTypeVariableLocal: - log->Printf("SBValue(%p)::GetValueType () => eValueTypeVariableLocal", - static_cast(value_sp.get())); - break; - case eValueTypeRegister: - log->Printf("SBValue(%p)::GetValueType () => eValueTypeRegister", - static_cast(value_sp.get())); - break; - case eValueTypeRegisterSet: - log->Printf("SBValue(%p)::GetValueType () => eValueTypeRegisterSet", - static_cast(value_sp.get())); - break; - case eValueTypeConstResult: - log->Printf("SBValue(%p)::GetValueType () => eValueTypeConstResult", - static_cast(value_sp.get())); - break; - case eValueTypeVariableThreadLocal: - log->Printf( - "SBValue(%p)::GetValueType () => eValueTypeVariableThreadLocal", - static_cast(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(value_sp.get()), cstr); - else - log->Printf("SBValue(%p)::GetObjectDescription() => NULL", - static_cast(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)); @@ -509,21 +402,13 @@ cstr = validation.second.c_str(); } } - if (log) { - if (cstr) - log->Printf("SBValue(%p)::GetTypeValidatorResult() => \"%s\"", - static_cast(value_sp.get()), cstr); - else - log->Printf("SBValue(%p)::GetTypeValidatorResult() => NULL", - static_cast(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)); @@ -532,22 +417,13 @@ type_sp = std::make_shared(value_sp->GetTypeImpl()); sb_type.SetSP(type_sp); } - if (log) { - if (type_sp) - log->Printf("SBValue(%p)::GetType => SBType(%p)", - static_cast(value_sp.get()), - static_cast(type_sp.get())); - else - log->Printf("SBValue(%p)::GetType => NULL", - static_cast(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)); @@ -555,9 +431,6 @@ if (value_sp->UpdateValueIfNeeded(false)) result = value_sp->GetValueDidChange(); } - if (log) - log->Printf("SBValue(%p)::GetValueDidChange() => %i", - static_cast(value_sp.get()), result); return result; } @@ -565,21 +438,13 @@ 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(value_sp.get()), cstr); - else - log->Printf("SBValue(%p)::GetSummary() => NULL", - static_cast(value_sp.get())); - } + return cstr; } @@ -589,7 +454,6 @@ (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) { @@ -598,35 +462,18 @@ stream.Printf("%s", buffer.c_str()); } const char *cstr = stream.GetData(); - if (log) { - if (cstr) - log->Printf("SBValue(%p)::GetSummary() => \"%s\"", - static_cast(value_sp.get()), cstr); - else - log->Printf("SBValue(%p)::GetSummary() => NULL", - static_cast(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(value_sp.get()), cstr); - else - log->Printf("SBValue(%p)::GetLocation() => NULL", - static_cast(value_sp.get())); - } return cstr; } @@ -646,17 +493,12 @@ 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(value_sp.get()), value_str, success); - return success; } @@ -752,16 +594,6 @@ 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(value_sp.get()), - new_value_sp->GetName().AsCString()); - else - log->Printf("SBValue(%p)::CreateChildAtOffset => NULL", - static_cast(value_sp.get())); - } return LLDB_RECORD_RESULT(sb_value); } @@ -796,7 +628,6 @@ (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)); @@ -809,17 +640,6 @@ 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(value_sp.get()), name, expression, - static_cast(new_value_sp.get())); - else - log->Printf("SBValue(%p)::CreateValueFromExpression(name=\"%s\", " - "expression=\"%s\") => NULL", - static_cast(value_sp.get()), name, expression); - } return LLDB_RECORD_RESULT(sb_value); } @@ -842,16 +662,6 @@ 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(value_sp.get()), - new_value_sp->GetName().AsCString()); - else - log->Printf("SBValue(%p)::CreateValueFromAddress => NULL", - static_cast(value_sp.get())); - } return LLDB_RECORD_RESULT(sb_value); } @@ -873,16 +683,6 @@ 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(value_sp.get()), - new_value_sp->GetName().AsCString()); - else - log->Printf("SBValue(%p)::CreateValueFromData => NULL", - static_cast(value_sp.get())); - } return LLDB_RECORD_RESULT(sb_value); } @@ -910,7 +710,6 @@ can_create_synthetic); lldb::ValueObjectSP child_sp; - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); @@ -924,10 +723,6 @@ SBValue sb_value; sb_value.SetSP(child_sp, use_dynamic, GetPreferSyntheticValue()); - if (log) - log->Printf("SBValue(%p)::GetChildAtIndex (%u) => SBValue(%p)", - static_cast(value_sp.get()), idx, - static_cast(value_sp.get())); return LLDB_RECORD_RESULT(sb_value); } @@ -942,16 +737,6 @@ 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(value_sp.get()), name); - else - log->Printf("SBValue(%p)::GetIndexOfChildWithName (name=\"%s\") => %u", - static_cast(value_sp.get()), name, idx); - } return idx; } @@ -979,8 +764,6 @@ 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) { @@ -990,12 +773,6 @@ 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(value_sp.get()), name, - static_cast(value_sp.get())); - return LLDB_RECORD_RESULT(sb_value); } @@ -1113,7 +890,6 @@ 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)); @@ -1125,12 +901,6 @@ SBValue sb_value; sb_value.SetSP(child_sp, GetPreferDynamicValue(), GetPreferSyntheticValue()); - if (log) - log->Printf("SBValue(%p)::GetValueForExpressionPath (expr_path=\"%s\") => " - "SBValue(%p)", - static_cast(value_sp.get()), expr_path, - static_cast(value_sp.get())); - return LLDB_RECORD_RESULT(sb_value); } @@ -1202,32 +972,24 @@ 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(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(value_sp.get()), is_support); return is_support; } @@ -1242,16 +1004,11 @@ 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(value_sp.get()), max, num_children); - return num_children; } @@ -1265,11 +1022,6 @@ 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(value_sp.get()), - static_cast(value_sp.get())); return LLDB_RECORD_RESULT(sb_value); } @@ -1300,16 +1052,7 @@ 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(m_opaque_sp.get())); - else - log->Printf("SBValue(%p)::GetTarget () => %p", - static_cast(m_opaque_sp.get()), - static_cast(target_sp.get())); - } + return LLDB_RECORD_RESULT(sb_target); } @@ -1322,16 +1065,7 @@ 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(m_opaque_sp.get())); - else - log->Printf("SBValue(%p)::GetProcess () => %p", - static_cast(m_opaque_sp.get()), - static_cast(process_sp.get())); - } + return LLDB_RECORD_RESULT(sb_process); } @@ -1344,16 +1078,7 @@ 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(m_opaque_sp.get())); - else - log->Printf("SBValue(%p)::GetThread () => %p", - static_cast(m_opaque_sp.get()), - static_cast(thread_sp.get())); - } + return LLDB_RECORD_RESULT(sb_thread); } @@ -1366,16 +1091,7 @@ 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(m_opaque_sp.get())); - else - log->Printf("SBValue(%p)::GetFrame () => %p", - static_cast(m_opaque_sp.get()), - static_cast(frame_sp.get())); - } + return LLDB_RECORD_RESULT(sb_frame); } @@ -1514,29 +1230,20 @@ (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()); } @@ -1545,24 +1252,16 @@ 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); @@ -1614,11 +1313,6 @@ 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(value_sp.get()), - static_cast(value_sp.get())); return LLDB_RECORD_RESULT(sb_value); } @@ -1649,10 +1343,6 @@ value = LLDB_INVALID_ADDRESS; } } - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) - log->Printf("SBValue(%p)::GetLoadAddress () => (%" PRIu64 ")", - static_cast(value_sp.get()), value); return value; } @@ -1682,13 +1372,7 @@ } } } - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) - log->Printf("SBValue(%p)::GetAddress () => (%s,%" PRIu64 ")", - static_cast(value_sp.get()), - (addr.GetSection() ? addr.GetSection()->GetName().GetCString() - : "NULL"), - addr.GetOffset()); + return LLDB_RECORD_RESULT(SBAddress(new Address(addr))); } @@ -1696,7 +1380,6 @@ 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)); @@ -1709,10 +1392,6 @@ *sb_data = data_sp; } } - if (log) - log->Printf("SBValue(%p)::GetPointeeData (%d, %d) => SBData(%p)", - static_cast(value_sp.get()), item_idx, item_count, - static_cast(sb_data.get())); return LLDB_RECORD_RESULT(sb_data); } @@ -1720,7 +1399,6 @@ 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)); @@ -1731,10 +1409,6 @@ if (error.Success()) *sb_data = data_sp; } - if (log) - log->Printf("SBValue(%p)::GetData () => SBData(%p)", - static_cast(value_sp.get()), - static_cast(sb_data.get())); return LLDB_RECORD_RESULT(sb_data); } @@ -1743,7 +1417,6 @@ 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; @@ -1752,10 +1425,6 @@ DataExtractor *data_extractor = data.get(); if (!data_extractor) { - if (log) - log->Printf("SBValue(%p)::SetData() => error: no data to set", - static_cast(value_sp.get())); - error.SetErrorString("No data to set"); ret = false; } else { @@ -1776,10 +1445,6 @@ ret = false; } - if (log) - log->Printf("SBValue(%p)::SetData (%p) => %s", - static_cast(value_sp.get()), - static_cast(data.get()), ret ? "true" : "false"); return ret; } @@ -1850,19 +1515,9 @@ } } } 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(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(value_sp.get())); error.SetErrorString("could not set watchpoint, a target is required"); } Index: source/API/SBValueList.cpp =================================================================== --- source/API/SBValueList.cpp +++ source/API/SBValueList.cpp @@ -11,7 +11,6 @@ #include "lldb/API/SBStream.h" #include "lldb/API/SBValue.h" #include "lldb/Core/ValueObjectList.h" -#include "lldb/Utility/Log.h" #include @@ -75,30 +74,13 @@ 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(rhs.IsValid() ? rhs.m_opaque_up.get() : NULL), - static_cast(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(lldb_object_ptr), - static_cast(m_opaque_up.get())); - } } SBValueList::~SBValueList() {} @@ -167,44 +149,21 @@ 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(m_opaque_up.get()), idx, - static_cast(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(m_opaque_up.get()), size); - return size; } Index: source/API/SBWatchpoint.cpp =================================================================== --- source/API/SBWatchpoint.cpp +++ source/API/SBWatchpoint.cpp @@ -19,7 +19,6 @@ #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" @@ -32,14 +31,6 @@ 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) @@ -60,22 +51,12 @@ 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(watchpoint_sp.get())); - else - log->Printf("SBWatchpoint(%p)::GetID () => %u", - static_cast(watchpoint_sp.get()), watch_id); - } - return watch_id; } @@ -184,11 +165,6 @@ count = watchpoint_sp->GetHitCount(); } - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); - if (log) - log->Printf("SBWatchpoint(%p)::GetHitCount () => %u", - static_cast(watchpoint_sp.get()), count); - return count; }