[lldb] Convert "LLDB" log channel to the new API
This commit is contained in:
parent
574ad2a846
commit
a007a6d844
@ -34,8 +34,8 @@ public:
|
||||
static Ret ErrorWithMessage(llvm::StringRef caller_name,
|
||||
llvm::StringRef error_msg, Status &error,
|
||||
LLDBLog log_caterogy = LLDBLog::Process) {
|
||||
LLDB_LOGF(GetLogIfAllCategoriesSet(log_caterogy), "%s ERROR = %s",
|
||||
caller_name.data(), error_msg.data());
|
||||
LLDB_LOGF(GetLog(log_caterogy), "%s ERROR = %s", caller_name.data(),
|
||||
error_msg.data());
|
||||
error.SetErrorString(llvm::Twine(caller_name + llvm::Twine(" ERROR = ") +
|
||||
llvm::Twine(error_msg))
|
||||
.str());
|
||||
|
@ -52,43 +52,6 @@ enum class LLDBLog : Log::MaskType {
|
||||
|
||||
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
|
||||
|
||||
// Log Bits specific to logging in lldb
|
||||
#define LIBLLDB_LOG_PROCESS ::lldb_private::LLDBLog::Process
|
||||
#define LIBLLDB_LOG_THREAD ::lldb_private::LLDBLog::Thread
|
||||
#define LIBLLDB_LOG_DYNAMIC_LOADER ::lldb_private::LLDBLog::DynamicLoader
|
||||
#define LIBLLDB_LOG_EVENTS ::lldb_private::LLDBLog::Events
|
||||
#define LIBLLDB_LOG_BREAKPOINTS ::lldb_private::LLDBLog::Breakpoints
|
||||
#define LIBLLDB_LOG_WATCHPOINTS ::lldb_private::LLDBLog::Watchpoints
|
||||
#define LIBLLDB_LOG_STEP ::lldb_private::LLDBLog::Step
|
||||
#define LIBLLDB_LOG_EXPRESSIONS ::lldb_private::LLDBLog::Expressions
|
||||
#define LIBLLDB_LOG_TEMPORARY ::lldb_private::LLDBLog::Temporary
|
||||
#define LIBLLDB_LOG_STATE ::lldb_private::LLDBLog::State
|
||||
#define LIBLLDB_LOG_OBJECT ::lldb_private::LLDBLog::Object
|
||||
#define LIBLLDB_LOG_COMMUNICATION ::lldb_private::LLDBLog::Communication
|
||||
#define LIBLLDB_LOG_CONNECTION ::lldb_private::LLDBLog::Connection
|
||||
#define LIBLLDB_LOG_HOST ::lldb_private::LLDBLog::Host
|
||||
#define LIBLLDB_LOG_UNWIND ::lldb_private::LLDBLog::Unwind
|
||||
#define LIBLLDB_LOG_API ::lldb_private::LLDBLog::API
|
||||
#define LIBLLDB_LOG_SCRIPT ::lldb_private::LLDBLog::Script
|
||||
#define LIBLLDB_LOG_COMMANDS ::lldb_private::LLDBLog::Commands
|
||||
#define LIBLLDB_LOG_TYPES ::lldb_private::LLDBLog::Types
|
||||
#define LIBLLDB_LOG_SYMBOLS ::lldb_private::LLDBLog::Symbols
|
||||
#define LIBLLDB_LOG_MODULES ::lldb_private::LLDBLog::Modules
|
||||
#define LIBLLDB_LOG_TARGET ::lldb_private::LLDBLog::Target
|
||||
#define LIBLLDB_LOG_MMAP ::lldb_private::LLDBLog::MMap
|
||||
#define LIBLLDB_LOG_OS ::lldb_private::LLDBLog::OS
|
||||
#define LIBLLDB_LOG_PLATFORM ::lldb_private::LLDBLog::Platform
|
||||
#define LIBLLDB_LOG_SYSTEM_RUNTIME ::lldb_private::LLDBLog::SystemRuntime
|
||||
#define LIBLLDB_LOG_JIT_LOADER ::lldb_private::LLDBLog::JITLoader
|
||||
#define LIBLLDB_LOG_LANGUAGE ::lldb_private::LLDBLog::Language
|
||||
#define LIBLLDB_LOG_DATAFORMATTERS ::lldb_private::LLDBLog::DataFormatters
|
||||
#define LIBLLDB_LOG_DEMANGLE ::lldb_private::LLDBLog::Demangle
|
||||
#define LIBLLDB_LOG_AST ::lldb_private::LLDBLog::AST
|
||||
|
||||
Log *GetLogIfAllCategoriesSet(LLDBLog mask);
|
||||
|
||||
Log *GetLogIfAnyCategoriesSet(LLDBLog mask);
|
||||
|
||||
void InitializeLldbChannel();
|
||||
|
||||
template <> Log::Channel &LogChannelFor<LLDBLog>();
|
||||
|
@ -760,7 +760,7 @@ lldb::SBTarget SBDebugger::CreateTarget(const char *filename,
|
||||
sb_error.SetErrorString("invalid debugger");
|
||||
}
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
Log *log = GetLog(LLDBLog::API);
|
||||
LLDB_LOGF(log,
|
||||
"SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, "
|
||||
"platform_name=%s, add_dependent_modules=%u, error=%s) => "
|
||||
@ -788,7 +788,7 @@ SBDebugger::CreateTargetWithFileAndTargetTriple(const char *filename,
|
||||
sb_target.SetSP(target_sp);
|
||||
}
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
Log *log = GetLog(LLDBLog::API);
|
||||
LLDB_LOGF(log,
|
||||
"SBDebugger(%p)::CreateTargetWithFileAndTargetTriple "
|
||||
"(filename=\"%s\", triple=%s) => SBTarget(%p)",
|
||||
@ -802,7 +802,7 @@ SBTarget SBDebugger::CreateTargetWithFileAndArch(const char *filename,
|
||||
const char *arch_cstr) {
|
||||
LLDB_INSTRUMENT_VA(this, filename, arch_cstr);
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
Log *log = GetLog(LLDBLog::API);
|
||||
|
||||
SBTarget sb_target;
|
||||
TargetSP target_sp;
|
||||
@ -858,7 +858,7 @@ SBTarget SBDebugger::CreateTarget(const char *filename) {
|
||||
if (error.Success())
|
||||
sb_target.SetSP(target_sp);
|
||||
}
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
Log *log = GetLog(LLDBLog::API);
|
||||
LLDB_LOGF(log,
|
||||
"SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)",
|
||||
static_cast<void *>(m_opaque_sp.get()), filename,
|
||||
@ -873,7 +873,7 @@ SBTarget SBDebugger::GetDummyTarget() {
|
||||
if (m_opaque_sp) {
|
||||
sb_target.SetSP(m_opaque_sp->GetDummyTarget().shared_from_this());
|
||||
}
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
Log *log = GetLog(LLDBLog::API);
|
||||
LLDB_LOGF(log, "SBDebugger(%p)::GetDummyTarget() => SBTarget(%p)",
|
||||
static_cast<void *>(m_opaque_sp.get()),
|
||||
static_cast<void *>(sb_target.GetSP().get()));
|
||||
@ -894,7 +894,7 @@ bool SBDebugger::DeleteTarget(lldb::SBTarget &target) {
|
||||
}
|
||||
}
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
Log *log = GetLog(LLDBLog::API);
|
||||
LLDB_LOGF(log, "SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i",
|
||||
static_cast<void *>(m_opaque_sp.get()),
|
||||
static_cast<void *>(target.m_opaque_sp.get()), result);
|
||||
@ -977,7 +977,7 @@ uint32_t SBDebugger::GetNumTargets() {
|
||||
SBTarget SBDebugger::GetSelectedTarget() {
|
||||
LLDB_INSTRUMENT_VA(this);
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
Log *log = GetLog(LLDBLog::API);
|
||||
|
||||
SBTarget sb_target;
|
||||
TargetSP target_sp;
|
||||
@ -1001,7 +1001,7 @@ SBTarget SBDebugger::GetSelectedTarget() {
|
||||
void SBDebugger::SetSelectedTarget(SBTarget &sb_target) {
|
||||
LLDB_INSTRUMENT_VA(this, sb_target);
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
Log *log = GetLog(LLDBLog::API);
|
||||
|
||||
TargetSP target_sp(sb_target.GetSP());
|
||||
if (m_opaque_sp) {
|
||||
@ -1019,7 +1019,7 @@ void SBDebugger::SetSelectedTarget(SBTarget &sb_target) {
|
||||
SBPlatform SBDebugger::GetSelectedPlatform() {
|
||||
LLDB_INSTRUMENT_VA(this);
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
Log *log = GetLog(LLDBLog::API);
|
||||
|
||||
SBPlatform sb_platform;
|
||||
DebuggerSP debugger_sp(m_opaque_sp);
|
||||
@ -1036,7 +1036,7 @@ SBPlatform SBDebugger::GetSelectedPlatform() {
|
||||
void SBDebugger::SetSelectedPlatform(SBPlatform &sb_platform) {
|
||||
LLDB_INSTRUMENT_VA(this, sb_platform);
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
Log *log = GetLog(LLDBLog::API);
|
||||
|
||||
DebuggerSP debugger_sp(m_opaque_sp);
|
||||
if (debugger_sp) {
|
||||
@ -1123,7 +1123,7 @@ void SBDebugger::DispatchInput(void *baton, const void *data, size_t data_len) {
|
||||
void SBDebugger::DispatchInput(const void *data, size_t data_len) {
|
||||
LLDB_INSTRUMENT_VA(this, data, data_len);
|
||||
|
||||
// Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
||||
// Log *log(GetLog (LLDBLog::API));
|
||||
//
|
||||
// if (log)
|
||||
// LLDB_LOGF(log, "SBDebugger(%p)::DispatchInput (data=\"%.*s\",
|
||||
@ -1312,7 +1312,7 @@ void SBDebugger::SetTerminalWidth(uint32_t term_width) {
|
||||
const char *SBDebugger::GetPrompt() const {
|
||||
LLDB_INSTRUMENT_VA(this);
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
|
||||
Log *log = GetLog(LLDBLog::API);
|
||||
|
||||
LLDB_LOGF(log, "SBDebugger(%p)::GetPrompt () => \"%s\"",
|
||||
static_cast<void *>(m_opaque_sp.get()),
|
||||
|
@ -1033,7 +1033,7 @@ lldb::SBValue SBFrame::EvaluateExpression(const char *expr,
|
||||
const SBExpressionOptions &options) {
|
||||
LLDB_INSTRUMENT_VA(this, expr, options);
|
||||
|
||||
Log *expr_log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *expr_log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
SBValue expr_result;
|
||||
|
||||
|
@ -98,7 +98,7 @@ void SBStream::RedirectToFile(const char *path, bool append) {
|
||||
llvm::Expected<FileUP> file =
|
||||
FileSystem::Instance().Open(FileSpec(path), open_options);
|
||||
if (!file) {
|
||||
LLDB_LOG_ERROR(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API), file.takeError(),
|
||||
LLDB_LOG_ERROR(GetLog(LLDBLog::API), file.takeError(),
|
||||
"Cannot open {1}: {0}", path);
|
||||
return;
|
||||
}
|
||||
|
@ -1116,8 +1116,7 @@ bool SBTarget::FindBreakpointsByName(const char *name,
|
||||
llvm::Expected<std::vector<BreakpointSP>> expected_vector =
|
||||
target_sp->GetBreakpointList().FindBreakpointsByName(name);
|
||||
if (!expected_vector) {
|
||||
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS),
|
||||
"invalid breakpoint name: {}",
|
||||
LLDB_LOG(GetLog(LLDBLog::Breakpoints), "invalid breakpoint name: {}",
|
||||
llvm::toString(expected_vector.takeError()));
|
||||
return false;
|
||||
}
|
||||
@ -2195,7 +2194,7 @@ lldb::SBValue SBTarget::EvaluateExpression(const char *expr,
|
||||
const SBExpressionOptions &options) {
|
||||
LLDB_INSTRUMENT_VA(this, expr, options);
|
||||
|
||||
Log *expr_log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *expr_log = GetLog(LLDBLog::Expressions);
|
||||
SBValue expr_result;
|
||||
ValueObjectSP expr_value_sp;
|
||||
TargetSP target_sp(GetSP());
|
||||
|
@ -487,7 +487,7 @@ void Breakpoint::ClearAllBreakpointSites() {
|
||||
|
||||
void Breakpoint::ModulesChanged(ModuleList &module_list, bool load,
|
||||
bool delete_locations) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
LLDB_LOGF(log,
|
||||
"Breakpoint::ModulesChanged: num_modules: %zu load: %i "
|
||||
"delete_locations: %i\n",
|
||||
@ -646,7 +646,7 @@ static bool SymbolContextsMightBeEquivalent(SymbolContext &old_sc,
|
||||
|
||||
void Breakpoint::ModuleReplaced(ModuleSP old_module_sp,
|
||||
ModuleSP new_module_sp) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
LLDB_LOGF(log, "Breakpoint::ModulesReplaced for %s\n",
|
||||
old_module_sp->GetSpecificationDescription().c_str());
|
||||
// First find all the locations that are in the old module
|
||||
|
@ -233,7 +233,7 @@ const char *BreakpointLocation::GetConditionText(size_t *hash) const {
|
||||
|
||||
bool BreakpointLocation::ConditionSaysStop(ExecutionContext &exe_ctx,
|
||||
Status &error) {
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS);
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
|
||||
std::lock_guard<std::mutex> guard(m_condition_mutex);
|
||||
|
||||
@ -393,7 +393,7 @@ bool BreakpointLocation::ValidForThisThread(Thread &thread) {
|
||||
|
||||
bool BreakpointLocation::ShouldStop(StoppointCallbackContext *context) {
|
||||
bool should_stop = true;
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS);
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
|
||||
// Do this first, if a location is disabled, it shouldn't increment its hit
|
||||
// count.
|
||||
@ -450,7 +450,7 @@ bool BreakpointLocation::ResolveBreakpointSite() {
|
||||
process->CreateBreakpointSite(shared_from_this(), m_owner.IsHardware());
|
||||
|
||||
if (new_id == LLDB_INVALID_BREAK_ID) {
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS);
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
if (log)
|
||||
log->Warning("Failed to add breakpoint site at 0x%" PRIx64,
|
||||
m_address.GetOpcodeLoadAddress(&m_owner.GetTarget()));
|
||||
|
@ -292,7 +292,7 @@ void BreakpointResolver::AddLocation(SearchFilter &filter,
|
||||
const SymbolContext &sc,
|
||||
bool skip_prologue,
|
||||
llvm::StringRef log_ident) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
Address line_start = sc.line_entry.range.GetBaseAddress();
|
||||
if (!line_start.IsValid()) {
|
||||
LLDB_LOGF(log,
|
||||
|
@ -143,8 +143,7 @@ Searcher::CallbackReturn BreakpointResolverAddress::SearchCallback(
|
||||
if (bp_loc_sp && !breakpoint.IsInternal()) {
|
||||
StreamString s;
|
||||
bp_loc_sp->GetDescription(&s, lldb::eDescriptionLevelVerbose);
|
||||
Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
LLDB_LOGF(log, "Added location: %s\n", s.GetData());
|
||||
}
|
||||
} else {
|
||||
|
@ -127,7 +127,7 @@ void BreakpointResolverFileLine::FilterContexts(SymbolContextList &sc_list,
|
||||
if (is_relative)
|
||||
relative_path = m_location_spec.GetFileSpec().GetDirectory().GetStringRef();
|
||||
|
||||
Log * log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS);
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
for(uint32_t i = 0; i < sc_list.GetSize(); ++i) {
|
||||
SymbolContext sc;
|
||||
sc_list.GetContextAtIndex(i, sc);
|
||||
|
@ -33,7 +33,7 @@ BreakpointResolverName::BreakpointResolverName(const BreakpointSP &bkpt,
|
||||
if (m_match_type == Breakpoint::Regexp) {
|
||||
m_regex = RegularExpression(name_cstr);
|
||||
if (!m_regex.IsValid()) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
|
||||
if (log)
|
||||
log->Warning("function name regexp: \"%s\" did not compile.",
|
||||
@ -252,7 +252,7 @@ void BreakpointResolverName::AddNameLookup(ConstString name,
|
||||
Searcher::CallbackReturn
|
||||
BreakpointResolverName::SearchCallback(SearchFilter &filter,
|
||||
SymbolContext &context, Address *addr) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
|
||||
if (m_class_name) {
|
||||
if (log)
|
||||
|
@ -40,9 +40,8 @@ Watchpoint::Watchpoint(Target &target, lldb::addr_t addr, uint32_t size,
|
||||
auto type_system_or_err =
|
||||
target.GetScratchTypeSystemForLanguage(eLanguageTypeC);
|
||||
if (auto err = type_system_or_err.takeError()) {
|
||||
LLDB_LOG_ERROR(
|
||||
lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_WATCHPOINTS),
|
||||
std::move(err), "Failed to set type.");
|
||||
LLDB_LOG_ERROR(GetLog(LLDBLog::Watchpoints), std::move(err),
|
||||
"Failed to set type.");
|
||||
} else {
|
||||
m_type = type_system_or_err->GetBuiltinTypeForEncodingAndBitSize(
|
||||
eEncodingUint, 8 * size);
|
||||
|
@ -1034,7 +1034,7 @@ protected:
|
||||
const char *to = command.GetArgumentAtIndex(i + 1);
|
||||
|
||||
if (from[0] && to[0]) {
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
if (log) {
|
||||
LLDB_LOGF(log,
|
||||
"target modules search path adding ImageSearchPath "
|
||||
|
@ -40,7 +40,7 @@ AddressResolverFileLine::SearchCallback(SearchFilter &filter,
|
||||
SymbolContextList sc_list;
|
||||
CompileUnit *cu = context.comp_unit;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
|
||||
// TODO: Handle SourceLocationSpec column information
|
||||
cu->ResolveSymbolContext(m_src_location_spec, eSymbolContextEverything,
|
||||
|
@ -47,8 +47,7 @@ Communication::Communication(const char *name)
|
||||
|
||||
{
|
||||
|
||||
LLDB_LOG(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_OBJECT |
|
||||
LIBLLDB_LOG_COMMUNICATION),
|
||||
LLDB_LOG(GetLog(LLDBLog::Object | LLDBLog::Communication),
|
||||
"{0} Communication::Communication (name = {1})", this, name);
|
||||
|
||||
SetEventName(eBroadcastBitDisconnected, "disconnected");
|
||||
@ -62,8 +61,7 @@ Communication::Communication(const char *name)
|
||||
}
|
||||
|
||||
Communication::~Communication() {
|
||||
LLDB_LOG(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_OBJECT |
|
||||
LIBLLDB_LOG_COMMUNICATION),
|
||||
LLDB_LOG(GetLog(LLDBLog::Object | LLDBLog::Communication),
|
||||
"{0} Communication::~Communication (name = {1})", this,
|
||||
GetBroadcasterName().AsCString());
|
||||
Clear();
|
||||
@ -78,7 +76,7 @@ void Communication::Clear() {
|
||||
ConnectionStatus Communication::Connect(const char *url, Status *error_ptr) {
|
||||
Clear();
|
||||
|
||||
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMUNICATION),
|
||||
LLDB_LOG(GetLog(LLDBLog::Communication),
|
||||
"{0} Communication::Connect (url = {1})", this, url);
|
||||
|
||||
lldb::ConnectionSP connection_sp(m_connection_sp);
|
||||
@ -90,8 +88,8 @@ ConnectionStatus Communication::Connect(const char *url, Status *error_ptr) {
|
||||
}
|
||||
|
||||
ConnectionStatus Communication::Disconnect(Status *error_ptr) {
|
||||
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMUNICATION),
|
||||
"{0} Communication::Disconnect ()", this);
|
||||
LLDB_LOG(GetLog(LLDBLog::Communication), "{0} Communication::Disconnect ()",
|
||||
this);
|
||||
|
||||
assert((!m_read_thread_enabled || m_read_thread_did_exit) &&
|
||||
"Disconnecting while the read thread is running is racy!");
|
||||
@ -125,7 +123,7 @@ bool Communication::HasConnection() const {
|
||||
size_t Communication::Read(void *dst, size_t dst_len,
|
||||
const Timeout<std::micro> &timeout,
|
||||
ConnectionStatus &status, Status *error_ptr) {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMUNICATION);
|
||||
Log *log = GetLog(LLDBLog::Communication);
|
||||
LLDB_LOG(
|
||||
log,
|
||||
"this = {0}, dst = {1}, dst_len = {2}, timeout = {3}, connection = {4}",
|
||||
@ -175,7 +173,7 @@ size_t Communication::Write(const void *src, size_t src_len,
|
||||
lldb::ConnectionSP connection_sp(m_connection_sp);
|
||||
|
||||
std::lock_guard<std::mutex> guard(m_write_mutex);
|
||||
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMUNICATION),
|
||||
LLDB_LOG(GetLog(LLDBLog::Communication),
|
||||
"{0} Communication::Write (src = {1}, src_len = {2}"
|
||||
") connection = {3}",
|
||||
this, src, (uint64_t)src_len, connection_sp.get());
|
||||
@ -206,7 +204,7 @@ bool Communication::StartReadThread(Status *error_ptr) {
|
||||
if (m_read_thread.IsJoinable())
|
||||
return true;
|
||||
|
||||
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMUNICATION),
|
||||
LLDB_LOG(GetLog(LLDBLog::Communication),
|
||||
"{0} Communication::StartReadThread ()", this);
|
||||
|
||||
const std::string thread_name =
|
||||
@ -222,8 +220,7 @@ bool Communication::StartReadThread(Status *error_ptr) {
|
||||
if (error_ptr)
|
||||
*error_ptr = Status(maybe_thread.takeError());
|
||||
else {
|
||||
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST),
|
||||
"failed to launch host thread: {}",
|
||||
LLDB_LOG(GetLog(LLDBLog::Host), "failed to launch host thread: {}",
|
||||
llvm::toString(maybe_thread.takeError()));
|
||||
}
|
||||
}
|
||||
@ -238,7 +235,7 @@ bool Communication::StopReadThread(Status *error_ptr) {
|
||||
if (!m_read_thread.IsJoinable())
|
||||
return true;
|
||||
|
||||
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMUNICATION),
|
||||
LLDB_LOG(GetLog(LLDBLog::Communication),
|
||||
"{0} Communication::StopReadThread ()", this);
|
||||
|
||||
m_read_thread_enabled = false;
|
||||
@ -280,7 +277,7 @@ size_t Communication::GetCachedBytes(void *dst, size_t dst_len) {
|
||||
void Communication::AppendBytesToCache(const uint8_t *bytes, size_t len,
|
||||
bool broadcast,
|
||||
ConnectionStatus status) {
|
||||
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMUNICATION),
|
||||
LLDB_LOG(GetLog(LLDBLog::Communication),
|
||||
"{0} Communication::AppendBytesToCache (src = {1}, src_len = {2}, "
|
||||
"broadcast = {3})",
|
||||
this, bytes, (uint64_t)len, broadcast);
|
||||
@ -317,7 +314,7 @@ bool Communication::ReadThreadIsRunning() { return m_read_thread_enabled; }
|
||||
lldb::thread_result_t Communication::ReadThread(lldb::thread_arg_t p) {
|
||||
Communication *comm = (Communication *)p;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMUNICATION));
|
||||
Log *log = GetLog(LLDBLog::Communication);
|
||||
|
||||
LLDB_LOGF(log, "%p Communication::ReadThread () thread starting...", p);
|
||||
|
||||
@ -369,7 +366,7 @@ lldb::thread_result_t Communication::ReadThread(lldb::thread_arg_t p) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMUNICATION);
|
||||
log = GetLog(LLDBLog::Communication);
|
||||
if (log)
|
||||
LLDB_LOGF(log, "%p Communication::ReadThread () thread exiting...", p);
|
||||
|
||||
|
@ -57,7 +57,7 @@ DataFileCache::DataFileCache(StringRef path) {
|
||||
if (cache_or_err)
|
||||
m_cache_callback = std::move(*cache_or_err);
|
||||
else {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_MODULES));
|
||||
Log *log = GetLog(LLDBLog::Modules);
|
||||
LLDB_LOG_ERROR(log, cache_or_err.takeError(),
|
||||
"failed to create lldb index cache directory: {0}");
|
||||
}
|
||||
@ -89,7 +89,7 @@ DataFileCache::GetCachedData(StringRef key) {
|
||||
if (!add_stream)
|
||||
return std::move(m_mem_buff_up);
|
||||
} else {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_MODULES));
|
||||
Log *log = GetLog(LLDBLog::Modules);
|
||||
LLDB_LOG_ERROR(log, add_stream_or_err.takeError(),
|
||||
"failed to get the cache add stream callback for key: {0}");
|
||||
}
|
||||
@ -124,13 +124,13 @@ bool DataFileCache::SetCachedData(StringRef key, llvm::ArrayRef<uint8_t> data) {
|
||||
cfs->OS->write((const char *)data.data(), data.size());
|
||||
return true;
|
||||
} else {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_MODULES));
|
||||
Log *log = GetLog(LLDBLog::Modules);
|
||||
LLDB_LOG_ERROR(log, file_or_err.takeError(),
|
||||
"failed to get the cache file stream for key: {0}");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_MODULES));
|
||||
Log *log = GetLog(LLDBLog::Modules);
|
||||
LLDB_LOG_ERROR(log, add_stream_or_err.takeError(),
|
||||
"failed to get the cache add stream callback for key: {0}");
|
||||
}
|
||||
|
@ -1692,8 +1692,7 @@ bool Debugger::StartEventHandlerThread() {
|
||||
if (event_handler_thread) {
|
||||
m_event_handler_thread = *event_handler_thread;
|
||||
} else {
|
||||
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST),
|
||||
"failed to launch host thread: {}",
|
||||
LLDB_LOG(GetLog(LLDBLog::Host), "failed to launch host thread: {}",
|
||||
llvm::toString(event_handler_thread.takeError()));
|
||||
}
|
||||
|
||||
@ -1733,8 +1732,7 @@ bool Debugger::StartIOHandlerThread() {
|
||||
if (io_handler_thread) {
|
||||
m_io_handler_thread = *io_handler_thread;
|
||||
} else {
|
||||
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST),
|
||||
"failed to launch host thread: {}",
|
||||
LLDB_LOG(GetLog(LLDBLog::Host), "failed to launch host thread: {}",
|
||||
llvm::toString(io_handler_thread.takeError()));
|
||||
}
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ static bool ScanBracketedRange(llvm::StringRef subpath,
|
||||
size_t &close_bracket_index,
|
||||
const char *&var_name_final_if_array_range,
|
||||
int64_t &index_lower, int64_t &index_higher) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS));
|
||||
Log *log = GetLog(LLDBLog::DataFormatters);
|
||||
close_bracket_index = llvm::StringRef::npos;
|
||||
const size_t open_bracket_index = subpath.find('[');
|
||||
if (open_bracket_index == llvm::StringRef::npos) {
|
||||
@ -618,7 +618,7 @@ static bool DumpRegister(Stream &s, StackFrame *frame, RegisterKind reg_kind,
|
||||
|
||||
static ValueObjectSP ExpandIndexedExpression(ValueObject *valobj, size_t index,
|
||||
bool deref_pointer) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS));
|
||||
Log *log = GetLog(LLDBLog::DataFormatters);
|
||||
const char *ptr_deref_format = "[%d]";
|
||||
std::string ptr_deref_buffer(10, 0);
|
||||
::sprintf(&ptr_deref_buffer[0], ptr_deref_format, index);
|
||||
@ -676,7 +676,7 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
|
||||
if (valobj == nullptr)
|
||||
return false;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS));
|
||||
Log *log = GetLog(LLDBLog::DataFormatters);
|
||||
Format custom_format = eFormatInvalid;
|
||||
ValueObject::ValueObjectRepresentationStyle val_obj_display =
|
||||
entry.string.empty()
|
||||
|
@ -130,7 +130,7 @@ static char *GetMSVCDemangledStr(const char *M) {
|
||||
llvm::MSDF_NoAccessSpecifier | llvm::MSDF_NoCallingConvention |
|
||||
llvm::MSDF_NoMemberType | llvm::MSDF_NoVariableType));
|
||||
|
||||
if (Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DEMANGLE)) {
|
||||
if (Log *log = GetLog(LLDBLog::Demangle)) {
|
||||
if (demangled_cstr && demangled_cstr[0])
|
||||
LLDB_LOGF(log, "demangled msvc: %s -> \"%s\"", M, demangled_cstr);
|
||||
else
|
||||
@ -157,7 +157,7 @@ static char *GetItaniumDemangledStr(const char *M) {
|
||||
"Expected demangled_size to return length including trailing null");
|
||||
}
|
||||
|
||||
if (Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DEMANGLE)) {
|
||||
if (Log *log = GetLog(LLDBLog::Demangle)) {
|
||||
if (demangled_cstr)
|
||||
LLDB_LOGF(log, "demangled itanium: %s -> \"%s\"", M, demangled_cstr);
|
||||
else
|
||||
@ -170,7 +170,7 @@ static char *GetItaniumDemangledStr(const char *M) {
|
||||
static char *GetRustV0DemangledStr(const char *M) {
|
||||
char *demangled_cstr = llvm::rustDemangle(M, nullptr, nullptr, nullptr);
|
||||
|
||||
if (Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DEMANGLE)) {
|
||||
if (Log *log = GetLog(LLDBLog::Demangle)) {
|
||||
if (demangled_cstr && demangled_cstr[0])
|
||||
LLDB_LOG(log, "demangled rustv0: {0} -> \"{1}\"", M, demangled_cstr);
|
||||
else
|
||||
@ -183,7 +183,7 @@ static char *GetRustV0DemangledStr(const char *M) {
|
||||
static char *GetDLangDemangledStr(const char *M) {
|
||||
char *demangled_cstr = llvm::dlangDemangle(M);
|
||||
|
||||
if (Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DEMANGLE)) {
|
||||
if (Log *log = GetLog(LLDBLog::Demangle)) {
|
||||
if (demangled_cstr && demangled_cstr[0])
|
||||
LLDB_LOG(log, "demangled dlang: {0} -> \"{1}\"", M, demangled_cstr);
|
||||
else
|
||||
|
@ -138,8 +138,7 @@ Module::Module(const ModuleSpec &module_spec)
|
||||
GetModuleCollection().push_back(this);
|
||||
}
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_OBJECT |
|
||||
LIBLLDB_LOG_MODULES));
|
||||
Log *log(GetLog(LLDBLog::Object | LLDBLog::Modules));
|
||||
if (log != nullptr)
|
||||
LLDB_LOGF(log, "%p Module::Module((%s) '%s%s%s%s')",
|
||||
static_cast<void *>(this),
|
||||
@ -251,8 +250,7 @@ Module::Module(const FileSpec &file_spec, const ArchSpec &arch,
|
||||
if (object_name)
|
||||
m_object_name = *object_name;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_OBJECT |
|
||||
LIBLLDB_LOG_MODULES));
|
||||
Log *log(GetLog(LLDBLog::Object | LLDBLog::Modules));
|
||||
if (log != nullptr)
|
||||
LLDB_LOGF(log, "%p Module::Module((%s) '%s%s%s%s')",
|
||||
static_cast<void *>(this), m_arch.GetArchitectureName(),
|
||||
@ -281,8 +279,7 @@ Module::~Module() {
|
||||
assert(pos != end);
|
||||
modules.erase(pos);
|
||||
}
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_OBJECT |
|
||||
LIBLLDB_LOG_MODULES));
|
||||
Log *log(GetLog(LLDBLog::Object | LLDBLog::Modules));
|
||||
if (log != nullptr)
|
||||
LLDB_LOGF(log, "%p Module::~Module((%s) '%s%s%s%s')",
|
||||
static_cast<void *>(this), m_arch.GetArchitectureName(),
|
||||
@ -1629,7 +1626,7 @@ void Module::RegisterXcodeSDK(llvm::StringRef sdk_name,
|
||||
bool Module::MergeArchitecture(const ArchSpec &arch_spec) {
|
||||
if (!arch_spec.IsValid())
|
||||
return false;
|
||||
LLDB_LOGF(GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT | LIBLLDB_LOG_MODULES),
|
||||
LLDB_LOGF(GetLog(LLDBLog::Object | LLDBLog::Modules),
|
||||
"module has arch %s, merging/replacing with arch %s",
|
||||
m_arch.GetTriple().getTriple().c_str(),
|
||||
arch_spec.GetTriple().getTriple().c_str());
|
||||
|
@ -807,7 +807,7 @@ ModuleList::GetSharedModule(const ModuleSpec &module_spec, ModuleSP &module_sp,
|
||||
if (old_modules)
|
||||
old_modules->push_back(module_sp);
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_MODULES));
|
||||
Log *log = GetLog(LLDBLog::Modules);
|
||||
if (log != nullptr)
|
||||
LLDB_LOGF(
|
||||
log, "%p '%s' module changed: removing from global module list",
|
||||
|
@ -47,7 +47,7 @@ bool RichManglingContext::FromItaniumName(ConstString mangled) {
|
||||
ResetProvider(ItaniumPartialDemangler);
|
||||
}
|
||||
|
||||
if (Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DEMANGLE)) {
|
||||
if (Log *log = GetLog(LLDBLog::Demangle)) {
|
||||
if (!err) {
|
||||
ParseFullName();
|
||||
LLDB_LOG(log, "demangled itanium: {0} -> \"{1}\"", mangled, m_ipd_buf);
|
||||
@ -103,7 +103,7 @@ void RichManglingContext::processIPDStrResult(char *ipd_res, size_t res_size) {
|
||||
m_ipd_buf = ipd_res; // std::realloc freed or reused the old buffer.
|
||||
m_ipd_buf_size = res_size; // May actually be bigger, but we can't know.
|
||||
|
||||
if (Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DEMANGLE))
|
||||
if (Log *log = GetLog(LLDBLog::Demangle))
|
||||
LLDB_LOG(log, "ItaniumPartialDemangler Realloc: new buffer size is {0}",
|
||||
m_ipd_buf_size);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ StreamFile::StreamFile(const char *path, File::OpenOptions options,
|
||||
m_file_sp = std::move(file.get());
|
||||
else {
|
||||
// TODO refactor this so the error gets popagated up instead of logged here.
|
||||
LLDB_LOG_ERROR(GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST), file.takeError(),
|
||||
LLDB_LOG_ERROR(GetLog(LLDBLog::Host), file.takeError(),
|
||||
"Cannot open {1}: {0}", path);
|
||||
m_file_sp = std::make_shared<File>();
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ bool ValueObject::UpdateValueIfNeeded(bool update_format) {
|
||||
}
|
||||
|
||||
bool ValueObject::UpdateFormatsIfNeeded() {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS));
|
||||
Log *log = GetLog(LLDBLog::DataFormatters);
|
||||
LLDB_LOGF(log,
|
||||
"[%s %p] checking for FormatManager revisions. ValueObject "
|
||||
"rev: %d - Global rev: %d",
|
||||
|
@ -201,7 +201,7 @@ bool ValueObjectDynamicValue::UpdateValue() {
|
||||
|
||||
Value old_value(m_value);
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES));
|
||||
Log *log = GetLog(LLDBLog::Commands);
|
||||
|
||||
bool has_changed_type = false;
|
||||
|
||||
|
@ -202,9 +202,8 @@ CompilerType ValueObjectRegister::GetCompilerTypeImpl() {
|
||||
auto type_system_or_err =
|
||||
exe_module->GetTypeSystemForLanguage(eLanguageTypeC);
|
||||
if (auto err = type_system_or_err.takeError()) {
|
||||
LLDB_LOG_ERROR(
|
||||
lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_TYPES),
|
||||
std::move(err), "Unable to get CompilerType from TypeSystem");
|
||||
LLDB_LOG_ERROR(GetLog(LLDBLog::Commands), std::move(err),
|
||||
"Unable to get CompilerType from TypeSystem");
|
||||
} else {
|
||||
m_compiler_type =
|
||||
type_system_or_err->GetBuiltinTypeForEncodingAndBitSize(
|
||||
|
@ -81,7 +81,7 @@ ConstString ValueObjectSynthetic::GetDisplayTypeName() {
|
||||
}
|
||||
|
||||
size_t ValueObjectSynthetic::CalculateNumChildren(uint32_t max) {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS);
|
||||
Log *log = GetLog(LLDBLog::DataFormatters);
|
||||
|
||||
UpdateValueIfNeeded();
|
||||
if (m_synthetic_children_count < UINT32_MAX)
|
||||
@ -148,7 +148,7 @@ void ValueObjectSynthetic::CreateSynthFilter() {
|
||||
}
|
||||
|
||||
bool ValueObjectSynthetic::UpdateValue() {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS);
|
||||
Log *log = GetLog(LLDBLog::DataFormatters);
|
||||
|
||||
SetValueIsValid(false);
|
||||
m_error.Clear();
|
||||
@ -234,7 +234,7 @@ bool ValueObjectSynthetic::UpdateValue() {
|
||||
|
||||
lldb::ValueObjectSP ValueObjectSynthetic::GetChildAtIndex(size_t idx,
|
||||
bool can_create) {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS);
|
||||
Log *log = GetLog(LLDBLog::DataFormatters);
|
||||
|
||||
LLDB_LOGF(log,
|
||||
"[ValueObjectSynthetic::GetChildAtIndex] name=%s, retrieving "
|
||||
|
@ -614,7 +614,7 @@ ImplSP FormatManager::Get(ValueObject &valobj,
|
||||
if (ImplSP retval_sp = GetCached<ImplSP>(match_data))
|
||||
return retval_sp;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS));
|
||||
Log *log = GetLog(LLDBLog::DataFormatters);
|
||||
|
||||
LLDB_LOGF(log, "[%s] Search failed. Giving language a chance.", __FUNCTION__);
|
||||
for (lldb::LanguageType lang_type : match_data.GetCandidateLanguages()) {
|
||||
@ -637,7 +637,7 @@ ImplSP FormatManager::Get(ValueObject &valobj,
|
||||
template <typename ImplSP>
|
||||
ImplSP FormatManager::GetCached(FormattersMatchData &match_data) {
|
||||
ImplSP retval_sp;
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS));
|
||||
Log *log = GetLog(LLDBLog::DataFormatters);
|
||||
if (match_data.GetTypeForCache()) {
|
||||
LLDB_LOGF(log, "\n\n[%s] Looking into cache for type %s", __FUNCTION__,
|
||||
match_data.GetTypeForCache().AsCString("<invalid>"));
|
||||
|
@ -174,7 +174,7 @@ void TypeCategoryMap::Get(FormattersMatchData &match_data, ImplSP &retval) {
|
||||
|
||||
ActiveCategoriesIterator begin, end = m_active_categories.end();
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS));
|
||||
Log *log = GetLog(LLDBLog::DataFormatters);
|
||||
|
||||
if (log) {
|
||||
for (auto match : match_data.GetMatchesVector()) {
|
||||
|
@ -977,7 +977,7 @@ bool DWARFExpression::Evaluate(
|
||||
uint64_t op_piece_offset = 0;
|
||||
Value pieces; // Used for DW_OP_piece
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
// A generic type is "an integral type that has the size of an address and an
|
||||
// unspecified signedness". For now, just use the signedness of the operand.
|
||||
// TODO: Implement a real typed stack, and store the genericness of the value
|
||||
@ -2673,7 +2673,7 @@ static DataExtractor ToDataExtractor(const llvm::DWARFLocationExpression &loc,
|
||||
llvm::Optional<DataExtractor>
|
||||
DWARFExpression::GetLocationExpression(addr_t load_function_start,
|
||||
addr_t addr) const {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
std::unique_ptr<llvm::DWARFLocationTable> loctable_up =
|
||||
m_dwarf_cu->GetLocationTable(m_data);
|
||||
|
@ -41,7 +41,7 @@ lldb::addr_t PersistentExpressionState::LookupSymbol(ConstString name) {
|
||||
|
||||
void PersistentExpressionState::RegisterExecutionUnit(
|
||||
lldb::IRExecutionUnitSP &execution_unit_sp) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
m_execution_units.insert(execution_unit_sp);
|
||||
|
||||
|
@ -218,7 +218,7 @@ bool FunctionCaller::InsertFunction(ExecutionContext &exe_ctx,
|
||||
if (!WriteFunctionArguments(exe_ctx, args_addr_ref, diagnostic_manager))
|
||||
return false;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
|
||||
Log *log = GetLog(LLDBLog::Step);
|
||||
LLDB_LOGF(log, "Call Address: 0x%" PRIx64 " Struct Address: 0x%" PRIx64 ".\n",
|
||||
m_jit_start_addr, args_addr_ref);
|
||||
|
||||
@ -229,8 +229,7 @@ lldb::ThreadPlanSP FunctionCaller::GetThreadPlanToCallFunction(
|
||||
ExecutionContext &exe_ctx, lldb::addr_t args_addr,
|
||||
const EvaluateExpressionOptions &options,
|
||||
DiagnosticManager &diagnostic_manager) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_EXPRESSIONS |
|
||||
LIBLLDB_LOG_STEP));
|
||||
Log *log(GetLog(LLDBLog::Expressions | LLDBLog::Step));
|
||||
|
||||
LLDB_LOGF(log,
|
||||
"-- [FunctionCaller::GetThreadPlanToCallFunction] Creating "
|
||||
@ -269,8 +268,7 @@ bool FunctionCaller::FetchFunctionResults(ExecutionContext &exe_ctx,
|
||||
// then use GetReturnValueObject
|
||||
// to fetch the value. That way we can fetch any values we need.
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_EXPRESSIONS |
|
||||
LIBLLDB_LOG_STEP));
|
||||
Log *log(GetLog(LLDBLog::Expressions | LLDBLog::Step));
|
||||
|
||||
LLDB_LOGF(log,
|
||||
"-- [FunctionCaller::FetchFunctionResults] Fetching function "
|
||||
@ -343,8 +341,7 @@ lldb::ExpressionResults FunctionCaller::ExecuteFunction(
|
||||
return lldb::eExpressionSetupError;
|
||||
}
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_EXPRESSIONS |
|
||||
LIBLLDB_LOG_STEP));
|
||||
Log *log(GetLog(LLDBLog::Expressions | LLDBLog::Step));
|
||||
|
||||
LLDB_LOGF(log,
|
||||
"== [FunctionCaller::ExecuteFunction] Executing function \"%s\" ==",
|
||||
|
@ -70,8 +70,7 @@ lldb::addr_t IRExecutionUnit::WriteNow(const uint8_t *bytes, size_t size,
|
||||
return LLDB_INVALID_ADDRESS;
|
||||
}
|
||||
|
||||
if (Log *log =
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)) {
|
||||
if (Log *log = GetLog(LLDBLog::Expressions)) {
|
||||
DataBufferHeap my_buffer(size, 0);
|
||||
Status err;
|
||||
ReadMemory(my_buffer.GetBytes(), allocation_process_addr, size, err);
|
||||
@ -99,7 +98,7 @@ void IRExecutionUnit::FreeNow(lldb::addr_t allocation) {
|
||||
|
||||
Status IRExecutionUnit::DisassembleFunction(Stream &stream,
|
||||
lldb::ProcessSP &process_wp) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
ExecutionContext exe_ctx(process_wp);
|
||||
|
||||
@ -254,7 +253,7 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
|
||||
|
||||
m_did_jit = true;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
std::string error_string;
|
||||
|
||||
@ -592,7 +591,7 @@ lldb::SectionType IRExecutionUnit::GetSectionTypeFromSectionName(
|
||||
uint8_t *IRExecutionUnit::MemoryManager::allocateCodeSection(
|
||||
uintptr_t Size, unsigned Alignment, unsigned SectionID,
|
||||
llvm::StringRef SectionName) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
uint8_t *return_value = m_default_mm_up->allocateCodeSection(
|
||||
Size, Alignment, SectionID, SectionName);
|
||||
@ -622,7 +621,7 @@ uint8_t *IRExecutionUnit::MemoryManager::allocateCodeSection(
|
||||
uint8_t *IRExecutionUnit::MemoryManager::allocateDataSection(
|
||||
uintptr_t Size, unsigned Alignment, unsigned SectionID,
|
||||
llvm::StringRef SectionName, bool IsReadOnly) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
uint8_t *return_value = m_default_mm_up->allocateDataSection(
|
||||
Size, Alignment, SectionID, SectionName, IsReadOnly);
|
||||
@ -882,7 +881,7 @@ lldb::addr_t IRExecutionUnit::FindSymbol(lldb_private::ConstString name,
|
||||
|
||||
void IRExecutionUnit::GetStaticInitializers(
|
||||
std::vector<lldb::addr_t> &static_initializers) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
llvm::GlobalVariable *global_ctors =
|
||||
m_module->getNamedGlobal("llvm.global_ctors");
|
||||
@ -950,7 +949,7 @@ IRExecutionUnit::MemoryManager::getSymbolAddress(const std::string &Name) {
|
||||
uint64_t
|
||||
IRExecutionUnit::MemoryManager::GetSymbolAddressAndPresence(
|
||||
const std::string &Name, bool &missing_weak) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
ConstString name_cs(Name.c_str());
|
||||
|
||||
@ -977,7 +976,7 @@ void *IRExecutionUnit::MemoryManager::getPointerToNamedFunction(
|
||||
|
||||
lldb::addr_t
|
||||
IRExecutionUnit::GetRemoteAddressForLocal(lldb::addr_t local_address) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
for (AllocationRecord &record : m_records) {
|
||||
if (local_address >= record.m_host_address &&
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <map>
|
||||
|
||||
using namespace llvm;
|
||||
using lldb_private::LLDBLog;
|
||||
|
||||
static std::string PrintValue(const Value *value, bool truncate = false) {
|
||||
std::string s;
|
||||
@ -325,8 +326,7 @@ public:
|
||||
|
||||
m_values[value] = data_address;
|
||||
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
if (log) {
|
||||
LLDB_LOGF(log, "Made an allocation for argument %s",
|
||||
@ -484,8 +484,7 @@ static bool CanResolveConstant(llvm::Constant *constant) {
|
||||
bool IRInterpreter::CanInterpret(llvm::Module &module, llvm::Function &function,
|
||||
lldb_private::Status &error,
|
||||
const bool support_function_calls) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
bool saw_function_with_body = false;
|
||||
for (Function &f : module) {
|
||||
@ -637,8 +636,7 @@ bool IRInterpreter::Interpret(llvm::Module &module, llvm::Function &function,
|
||||
lldb::addr_t stack_frame_bottom,
|
||||
lldb::addr_t stack_frame_top,
|
||||
lldb_private::ExecutionContext &exe_ctx) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
if (log) {
|
||||
std::string s;
|
||||
|
@ -288,8 +288,7 @@ IRMemoryMap::Allocation::Allocation(lldb::addr_t process_alloc,
|
||||
lldb::addr_t IRMemoryMap::Malloc(size_t size, uint8_t alignment,
|
||||
uint32_t permissions, AllocationPolicy policy,
|
||||
bool zero_memory, Status &error) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
error.Clear();
|
||||
|
||||
lldb::ProcessSP process_sp;
|
||||
@ -476,8 +475,7 @@ void IRMemoryMap::Free(lldb::addr_t process_address, Status &error) {
|
||||
}
|
||||
}
|
||||
|
||||
if (lldb_private::Log *log =
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)) {
|
||||
if (lldb_private::Log *log = GetLog(LLDBLog::Expressions)) {
|
||||
LLDB_LOGF(log,
|
||||
"IRMemoryMap::Free (0x%" PRIx64 ") freed [0x%" PRIx64
|
||||
"..0x%" PRIx64 ")",
|
||||
@ -574,8 +572,7 @@ void IRMemoryMap::WriteMemory(lldb::addr_t process_address,
|
||||
break;
|
||||
}
|
||||
|
||||
if (lldb_private::Log *log =
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)) {
|
||||
if (lldb_private::Log *log = GetLog(LLDBLog::Expressions)) {
|
||||
LLDB_LOGF(log,
|
||||
"IRMemoryMap::WriteMemory (0x%" PRIx64 ", 0x%" PRIxPTR
|
||||
", 0x%" PRId64 ") went to [0x%" PRIx64 "..0x%" PRIx64 ")",
|
||||
@ -704,8 +701,7 @@ void IRMemoryMap::ReadMemory(uint8_t *bytes, lldb::addr_t process_address,
|
||||
break;
|
||||
}
|
||||
|
||||
if (lldb_private::Log *log =
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)) {
|
||||
if (lldb_private::Log *log = GetLog(LLDBLog::Expressions)) {
|
||||
LLDB_LOGF(log,
|
||||
"IRMemoryMap::ReadMemory (0x%" PRIx64 ", 0x%" PRIxPTR
|
||||
", 0x%" PRId64 ") came from [0x%" PRIx64 "..0x%" PRIx64 ")",
|
||||
|
@ -67,8 +67,7 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
|
||||
// The expression log is quite verbose, and if you're just tracking the
|
||||
// execution of the expression, it's quite convenient to have these logs come
|
||||
// out with the STEP log as well.
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_EXPRESSIONS |
|
||||
LIBLLDB_LOG_STEP));
|
||||
Log *log(GetLog(LLDBLog::Expressions | LLDBLog::Step));
|
||||
|
||||
if (m_jit_start_addr == LLDB_INVALID_ADDRESS && !m_can_interpret) {
|
||||
diagnostic_manager.PutString(
|
||||
@ -254,7 +253,7 @@ bool LLVMUserExpression::FinalizeJITExecution(
|
||||
DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx,
|
||||
lldb::ExpressionVariableSP &result, lldb::addr_t function_stack_bottom,
|
||||
lldb::addr_t function_stack_top) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
LLDB_LOGF(log, "-- [UserExpression::FinalizeJITExecution] Dematerializing "
|
||||
"after execution --");
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
}
|
||||
|
||||
void MakeAllocation(IRMemoryMap &map, Status &err) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
// Allocate a spare memory area to store the persistent variable's
|
||||
// contents.
|
||||
@ -138,7 +138,7 @@ public:
|
||||
|
||||
void Materialize(lldb::StackFrameSP &frame_sp, IRMemoryMap &map,
|
||||
lldb::addr_t process_address, Status &err) override {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
const lldb::addr_t load_addr = process_address + m_offset;
|
||||
|
||||
@ -190,7 +190,7 @@ public:
|
||||
void Dematerialize(lldb::StackFrameSP &frame_sp, IRMemoryMap &map,
|
||||
lldb::addr_t process_address, lldb::addr_t frame_top,
|
||||
lldb::addr_t frame_bottom, Status &err) override {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
const lldb::addr_t load_addr = process_address + m_offset;
|
||||
|
||||
@ -425,7 +425,7 @@ public:
|
||||
|
||||
void Materialize(lldb::StackFrameSP &frame_sp, IRMemoryMap &map,
|
||||
lldb::addr_t process_address, Status &err) override {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
const lldb::addr_t load_addr = process_address + m_offset;
|
||||
if (log) {
|
||||
@ -594,7 +594,7 @@ public:
|
||||
void Dematerialize(lldb::StackFrameSP &frame_sp, IRMemoryMap &map,
|
||||
lldb::addr_t process_address, lldb::addr_t frame_top,
|
||||
lldb::addr_t frame_bottom, Status &err) override {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
const lldb::addr_t load_addr = process_address + m_offset;
|
||||
if (log) {
|
||||
@ -1057,7 +1057,7 @@ public:
|
||||
|
||||
void Materialize(lldb::StackFrameSP &frame_sp, IRMemoryMap &map,
|
||||
lldb::addr_t process_address, Status &err) override {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
const lldb::addr_t load_addr = process_address + m_offset;
|
||||
|
||||
@ -1106,7 +1106,7 @@ public:
|
||||
void Dematerialize(lldb::StackFrameSP &frame_sp, IRMemoryMap &map,
|
||||
lldb::addr_t process_address, lldb::addr_t frame_top,
|
||||
lldb::addr_t frame_bottom, Status &err) override {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
const lldb::addr_t load_addr = process_address + m_offset;
|
||||
|
||||
@ -1176,7 +1176,7 @@ public:
|
||||
|
||||
void Materialize(lldb::StackFrameSP &frame_sp, IRMemoryMap &map,
|
||||
lldb::addr_t process_address, Status &err) override {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
const lldb::addr_t load_addr = process_address + m_offset;
|
||||
|
||||
@ -1239,7 +1239,7 @@ public:
|
||||
void Dematerialize(lldb::StackFrameSP &frame_sp, IRMemoryMap &map,
|
||||
lldb::addr_t process_address, lldb::addr_t frame_top,
|
||||
lldb::addr_t frame_bottom, Status &err) override {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
const lldb::addr_t load_addr = process_address + m_offset;
|
||||
|
||||
@ -1377,8 +1377,7 @@ Materializer::Materialize(lldb::StackFrameSP &frame_sp, IRMemoryMap &map,
|
||||
return DematerializerSP();
|
||||
}
|
||||
|
||||
if (Log *log =
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)) {
|
||||
if (Log *log = GetLog(LLDBLog::Expressions)) {
|
||||
LLDB_LOGF(
|
||||
log,
|
||||
"Materializer::Materialize (frame_sp = %p, process_address = 0x%" PRIx64
|
||||
@ -1415,8 +1414,7 @@ void Materializer::Dematerializer::Dematerialize(Status &error,
|
||||
error.SetErrorToGenericError();
|
||||
error.SetErrorString("Couldn't dematerialize: target is gone");
|
||||
} else {
|
||||
if (Log *log =
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)) {
|
||||
if (Log *log = GetLog(LLDBLog::Expressions)) {
|
||||
LLDB_LOGF(log,
|
||||
"Materializer::Dematerialize (frame_sp = %p, process_address "
|
||||
"= 0x%" PRIx64 ") about to dematerialize:",
|
||||
|
@ -141,8 +141,7 @@ UserExpression::Evaluate(ExecutionContext &exe_ctx,
|
||||
llvm::StringRef expr, llvm::StringRef prefix,
|
||||
lldb::ValueObjectSP &result_valobj_sp, Status &error,
|
||||
std::string *fixed_expression, ValueObject *ctx_obj) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_EXPRESSIONS |
|
||||
LIBLLDB_LOG_STEP));
|
||||
Log *log(GetLog(LLDBLog::Expressions | LLDBLog::Step));
|
||||
|
||||
if (ctx_obj) {
|
||||
static unsigned const ctx_type_mask =
|
||||
|
@ -163,7 +163,7 @@ static bool CheckForMonitorCancellation() {
|
||||
}
|
||||
|
||||
static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
|
||||
Log *log = GetLog(LLDBLog::Process);
|
||||
const char *function = __FUNCTION__;
|
||||
LLDB_LOGF(log, "%s (arg = %p) thread starting...", function, arg);
|
||||
|
||||
@ -192,7 +192,7 @@ static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
|
||||
#endif // __linux__
|
||||
|
||||
while (true) {
|
||||
log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS);
|
||||
log = GetLog(LLDBLog::Process);
|
||||
LLDB_LOGF(log, "%s ::waitpid (pid = %" PRIi32 ", &status, options = %i)...",
|
||||
function, pid, options);
|
||||
|
||||
@ -243,7 +243,7 @@ static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
|
||||
ScopedPThreadCancelDisabler pthread_cancel_disabler;
|
||||
#endif
|
||||
|
||||
log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS);
|
||||
log = GetLog(LLDBLog::Process);
|
||||
LLDB_LOGF(log,
|
||||
"%s ::waitpid (pid = %" PRIi32
|
||||
", &status, options = %i) => pid = %" PRIi32
|
||||
@ -277,7 +277,7 @@ static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS);
|
||||
log = GetLog(LLDBLog::Process);
|
||||
LLDB_LOGF(log, "%s (arg = %p) thread exiting...", __FUNCTION__, arg);
|
||||
|
||||
return nullptr;
|
||||
@ -301,7 +301,7 @@ void Host::SystemLog(SystemLogType type, const char *format, ...) {
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST));
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
if (log && log->GetVerbose()) {
|
||||
// Log to log channel. This allows testcases to grep for log output.
|
||||
va_list args;
|
||||
|
@ -119,7 +119,7 @@ FileSpec HostInfoBase::GetShlibDir() {
|
||||
llvm::call_once(g_fields->m_lldb_so_dir_once, []() {
|
||||
if (!HostInfo::ComputeSharedLibraryDirectory(g_fields->m_lldb_so_dir))
|
||||
g_fields->m_lldb_so_dir = FileSpec();
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
LLDB_LOG(log, "shlib dir -> `{0}`", g_fields->m_lldb_so_dir);
|
||||
});
|
||||
return g_fields->m_lldb_so_dir;
|
||||
@ -129,7 +129,7 @@ FileSpec HostInfoBase::GetSupportExeDir() {
|
||||
llvm::call_once(g_fields->m_lldb_support_exe_dir_once, []() {
|
||||
if (!HostInfo::ComputeSupportExeDirectory(g_fields->m_lldb_support_exe_dir))
|
||||
g_fields->m_lldb_support_exe_dir = FileSpec();
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
LLDB_LOG(log, "support exe dir -> `{0}`", g_fields->m_lldb_support_exe_dir);
|
||||
});
|
||||
return g_fields->m_lldb_support_exe_dir;
|
||||
@ -139,7 +139,7 @@ FileSpec HostInfoBase::GetHeaderDir() {
|
||||
llvm::call_once(g_fields->m_lldb_headers_dir_once, []() {
|
||||
if (!HostInfo::ComputeHeaderDirectory(g_fields->m_lldb_headers_dir))
|
||||
g_fields->m_lldb_headers_dir = FileSpec();
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
LLDB_LOG(log, "header dir -> `{0}`", g_fields->m_lldb_headers_dir);
|
||||
});
|
||||
return g_fields->m_lldb_headers_dir;
|
||||
@ -149,7 +149,7 @@ FileSpec HostInfoBase::GetSystemPluginDir() {
|
||||
llvm::call_once(g_fields->m_lldb_system_plugin_dir_once, []() {
|
||||
if (!HostInfo::ComputeSystemPluginsDirectory(g_fields->m_lldb_system_plugin_dir))
|
||||
g_fields->m_lldb_system_plugin_dir = FileSpec();
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
LLDB_LOG(log, "system plugin dir -> `{0}`",
|
||||
g_fields->m_lldb_system_plugin_dir);
|
||||
});
|
||||
@ -160,7 +160,7 @@ FileSpec HostInfoBase::GetUserPluginDir() {
|
||||
llvm::call_once(g_fields->m_lldb_user_plugin_dir_once, []() {
|
||||
if (!HostInfo::ComputeUserPluginsDirectory(g_fields->m_lldb_user_plugin_dir))
|
||||
g_fields->m_lldb_user_plugin_dir = FileSpec();
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
LLDB_LOG(log, "user plugin dir -> `{0}`", g_fields->m_lldb_user_plugin_dir);
|
||||
});
|
||||
return g_fields->m_lldb_user_plugin_dir;
|
||||
@ -170,7 +170,7 @@ FileSpec HostInfoBase::GetProcessTempDir() {
|
||||
llvm::call_once(g_fields->m_lldb_process_tmp_dir_once, []() {
|
||||
if (!HostInfo::ComputeProcessTempFileDirectory( g_fields->m_lldb_process_tmp_dir))
|
||||
g_fields->m_lldb_process_tmp_dir = FileSpec();
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
LLDB_LOG(log, "process temp dir -> `{0}`",
|
||||
g_fields->m_lldb_process_tmp_dir);
|
||||
});
|
||||
@ -182,7 +182,7 @@ FileSpec HostInfoBase::GetGlobalTempDir() {
|
||||
if (!HostInfo::ComputeGlobalTempFileDirectory( g_fields->m_lldb_global_tmp_dir))
|
||||
g_fields->m_lldb_global_tmp_dir = FileSpec();
|
||||
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
LLDB_LOG(log, "global temp dir -> `{0}`", g_fields->m_lldb_global_tmp_dir);
|
||||
});
|
||||
return g_fields->m_lldb_global_tmp_dir;
|
||||
@ -211,7 +211,7 @@ ArchSpec HostInfoBase::GetAugmentedArchSpec(llvm::StringRef triple) {
|
||||
|
||||
bool HostInfoBase::ComputePathRelativeToLibrary(FileSpec &file_spec,
|
||||
llvm::StringRef dir) {
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
|
||||
FileSpec lldb_file_spec = GetShlibDir();
|
||||
if (!lldb_file_spec)
|
||||
|
@ -58,7 +58,7 @@ HostNativeThreadBase::ThreadCreateTrampoline(lldb::thread_arg_t arg) {
|
||||
thread_func_t thread_fptr = info->thread_fptr;
|
||||
thread_arg_t thread_arg = info->thread_arg;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
|
||||
Log *log = GetLog(LLDBLog::Thread);
|
||||
LLDB_LOGF(log, "thread created");
|
||||
|
||||
delete info;
|
||||
|
@ -50,7 +50,7 @@ MonitoringProcessLauncher::LaunchProcess(const ProcessLaunchInfo &launch_info,
|
||||
m_delegate_launcher->LaunchProcess(resolved_info, error);
|
||||
|
||||
if (process.GetProcessId() != LLDB_INVALID_PROCESS_ID) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
|
||||
Log *log = GetLog(LLDBLog::Process);
|
||||
|
||||
assert(launch_info.GetMonitorProcessCallback());
|
||||
llvm::Expected<HostThread> maybe_thread =
|
||||
|
@ -74,7 +74,7 @@ llvm::Optional<WaitStatus> NativeProcessProtocol::GetExitStatus() {
|
||||
|
||||
bool NativeProcessProtocol::SetExitStatus(WaitStatus status,
|
||||
bool bNotifyStateChange) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
|
||||
Log *log = GetLog(LLDBLog::Process);
|
||||
LLDB_LOG(log, "status = {0}, notify = {1}", status, bNotifyStateChange);
|
||||
|
||||
// Exit status already set
|
||||
@ -128,7 +128,7 @@ NativeProcessProtocol::GetWatchpointMap() const {
|
||||
|
||||
llvm::Optional<std::pair<uint32_t, uint32_t>>
|
||||
NativeProcessProtocol::GetHardwareDebugSupportInfo() const {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
|
||||
Log *log = GetLog(LLDBLog::Process);
|
||||
|
||||
// get any thread
|
||||
NativeThreadProtocol *thread(
|
||||
@ -152,7 +152,7 @@ Status NativeProcessProtocol::SetWatchpoint(lldb::addr_t addr, size_t size,
|
||||
// thread that is attached to via the (FIXME implement) OnThreadAttached ()
|
||||
// method.
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
|
||||
Log *log = GetLog(LLDBLog::Process);
|
||||
|
||||
// Update the thread list
|
||||
UpdateThreads();
|
||||
@ -236,7 +236,7 @@ Status NativeProcessProtocol::SetHardwareBreakpoint(lldb::addr_t addr,
|
||||
// This default implementation assumes setting a hardware breakpoint for this
|
||||
// process will require setting same hardware breakpoint for each of its
|
||||
// existing threads. New thread will do the same once created.
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
|
||||
Log *log = GetLog(LLDBLog::Process);
|
||||
|
||||
// Update the thread list
|
||||
UpdateThreads();
|
||||
@ -308,7 +308,7 @@ Status NativeProcessProtocol::RemoveHardwareBreakpoint(lldb::addr_t addr) {
|
||||
|
||||
void NativeProcessProtocol::SynchronouslyNotifyProcessStateChanged(
|
||||
lldb::StateType state) {
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
|
||||
Log *log = GetLog(LLDBLog::Process);
|
||||
|
||||
m_delegate.ProcessStateChanged(this, state);
|
||||
|
||||
@ -317,7 +317,7 @@ void NativeProcessProtocol::SynchronouslyNotifyProcessStateChanged(
|
||||
}
|
||||
|
||||
void NativeProcessProtocol::NotifyDidExec() {
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
|
||||
Log *log = GetLog(LLDBLog::Process);
|
||||
LLDB_LOG(log, "process {0} exec()ed", GetID());
|
||||
|
||||
m_delegate.DidExec(this);
|
||||
@ -325,7 +325,7 @@ void NativeProcessProtocol::NotifyDidExec() {
|
||||
|
||||
Status NativeProcessProtocol::SetSoftwareBreakpoint(lldb::addr_t addr,
|
||||
uint32_t size_hint) {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
LLDB_LOG(log, "addr = {0:x}, size_hint = {1}", addr, size_hint);
|
||||
|
||||
auto it = m_software_breakpoints.find(addr);
|
||||
@ -342,7 +342,7 @@ Status NativeProcessProtocol::SetSoftwareBreakpoint(lldb::addr_t addr,
|
||||
}
|
||||
|
||||
Status NativeProcessProtocol::RemoveSoftwareBreakpoint(lldb::addr_t addr) {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
LLDB_LOG(log, "addr = {0:x}", addr);
|
||||
auto it = m_software_breakpoints.find(addr);
|
||||
if (it == m_software_breakpoints.end())
|
||||
@ -408,7 +408,7 @@ Status NativeProcessProtocol::RemoveSoftwareBreakpoint(lldb::addr_t addr) {
|
||||
llvm::Expected<NativeProcessProtocol::SoftwareBreakpoint>
|
||||
NativeProcessProtocol::EnableSoftwareBreakpoint(lldb::addr_t addr,
|
||||
uint32_t size_hint) {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
|
||||
auto expected_trap = GetSoftwareBreakpointTrapOpcode(size_hint);
|
||||
if (!expected_trap)
|
||||
@ -554,7 +554,7 @@ size_t NativeProcessProtocol::GetSoftwareBreakpointPCOffset() {
|
||||
|
||||
void NativeProcessProtocol::FixupBreakpointPCAsNeeded(
|
||||
NativeThreadProtocol &thread) {
|
||||
Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_BREAKPOINTS);
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
|
||||
Status error;
|
||||
|
||||
|
@ -122,7 +122,7 @@ const char *NativeRegisterContext::GetRegisterSetNameForRegisterAtIndex(
|
||||
}
|
||||
|
||||
lldb::addr_t NativeRegisterContext::GetPC(lldb::addr_t fail_value) {
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
|
||||
Log *log = GetLog(LLDBLog::Thread);
|
||||
|
||||
uint32_t reg = ConvertRegisterKindToRegisterNumber(eRegisterKindGeneric,
|
||||
LLDB_REGNUM_GENERIC_PC);
|
||||
@ -197,7 +197,7 @@ NativeRegisterContext::ReadRegisterAsUnsigned(uint32_t reg,
|
||||
uint64_t
|
||||
NativeRegisterContext::ReadRegisterAsUnsigned(const RegisterInfo *reg_info,
|
||||
lldb::addr_t fail_value) {
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
|
||||
Log *log = GetLog(LLDBLog::Thread);
|
||||
|
||||
if (reg_info) {
|
||||
RegisterValue value;
|
||||
|
@ -183,7 +183,7 @@ void ProcessLaunchInfo::SetMonitorProcessCallback(
|
||||
}
|
||||
|
||||
bool ProcessLaunchInfo::NoOpMonitorCallback(lldb::pid_t pid, bool exited, int signal, int status) {
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS);
|
||||
Log *log = GetLog(LLDBLog::Process);
|
||||
LLDB_LOG(log, "pid = {0}, exited = {1}, signal = {2}, status = {3}", pid,
|
||||
exited, signal, status);
|
||||
return true;
|
||||
@ -195,8 +195,7 @@ bool ProcessLaunchInfo::MonitorProcess() const {
|
||||
Host::StartMonitoringChildProcess(m_monitor_callback, GetProcessID(),
|
||||
m_monitor_signals);
|
||||
if (!maybe_thread)
|
||||
LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST),
|
||||
"failed to launch host thread: {}",
|
||||
LLDB_LOG(GetLog(LLDBLog::Host), "failed to launch host thread: {}",
|
||||
llvm::toString(maybe_thread.takeError()));
|
||||
return true;
|
||||
}
|
||||
@ -211,7 +210,7 @@ void ProcessLaunchInfo::SetDetachOnError(bool enable) {
|
||||
}
|
||||
|
||||
llvm::Error ProcessLaunchInfo::SetUpPtyRedirection() {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS);
|
||||
Log *log = GetLog(LLDBLog::Process);
|
||||
|
||||
bool stdin_free = GetFileActionForFD(STDIN_FILENO) == nullptr;
|
||||
bool stdout_free = GetFileActionForFD(STDOUT_FILENO) == nullptr;
|
||||
|
@ -146,7 +146,7 @@ std::unique_ptr<Socket> Socket::Create(const SocketProtocol protocol,
|
||||
llvm::Expected<std::unique_ptr<Socket>>
|
||||
Socket::TcpConnect(llvm::StringRef host_and_port,
|
||||
bool child_processes_inherit) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOG(log, "host_and_port = {0}", host_and_port);
|
||||
|
||||
Status error;
|
||||
@ -165,7 +165,7 @@ Socket::TcpConnect(llvm::StringRef host_and_port,
|
||||
llvm::Expected<std::unique_ptr<TCPSocket>>
|
||||
Socket::TcpListen(llvm::StringRef host_and_port, bool child_processes_inherit,
|
||||
int backlog) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOG(log, "host_and_port = {0}", host_and_port);
|
||||
|
||||
std::unique_ptr<TCPSocket> listen_socket(
|
||||
@ -225,7 +225,7 @@ Status Socket::Read(void *buf, size_t &num_bytes) {
|
||||
} else
|
||||
num_bytes = bytes_received;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_COMMUNICATION));
|
||||
Log *log = GetLog(LLDBLog::Communication);
|
||||
if (log) {
|
||||
LLDB_LOGF(log,
|
||||
"%p Socket::Read() (socket = %" PRIu64
|
||||
@ -253,7 +253,7 @@ Status Socket::Write(const void *buf, size_t &num_bytes) {
|
||||
} else
|
||||
num_bytes = bytes_sent;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_COMMUNICATION));
|
||||
Log *log = GetLog(LLDBLog::Communication);
|
||||
if (log) {
|
||||
LLDB_LOGF(log,
|
||||
"%p Socket::Write() (socket = %" PRIu64
|
||||
@ -277,7 +277,7 @@ Status Socket::Close() {
|
||||
if (!IsValid() || !m_should_close_fd)
|
||||
return error;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOGF(log, "%p Socket::Close (fd = %" PRIu64 ")",
|
||||
static_cast<void *>(this), static_cast<uint64_t>(m_socket));
|
||||
|
||||
|
@ -148,7 +148,7 @@ Status TCPSocket::CreateSocket(int domain) {
|
||||
|
||||
Status TCPSocket::Connect(llvm::StringRef name) {
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_COMMUNICATION));
|
||||
Log *log = GetLog(LLDBLog::Communication);
|
||||
LLDB_LOGF(log, "TCPSocket::%s (host/port = %s)", __FUNCTION__, name.data());
|
||||
|
||||
Status error;
|
||||
@ -184,7 +184,7 @@ Status TCPSocket::Connect(llvm::StringRef name) {
|
||||
}
|
||||
|
||||
Status TCPSocket::Listen(llvm::StringRef name, int backlog) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOGF(log, "TCPSocket::%s (%s)", __FUNCTION__, name.data());
|
||||
|
||||
Status error;
|
||||
|
@ -54,7 +54,7 @@ llvm::Expected<std::unique_ptr<UDPSocket>>
|
||||
UDPSocket::Connect(llvm::StringRef name, bool child_processes_inherit) {
|
||||
std::unique_ptr<UDPSocket> socket;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOG(log, "host/port = {0}", name);
|
||||
|
||||
Status error;
|
||||
|
@ -56,7 +56,7 @@ class ProcessLaunchInfo;
|
||||
static bool GetStatusInfo(::pid_t Pid, ProcessInstanceInfo &ProcessInfo,
|
||||
ProcessState &State, ::pid_t &TracerPid,
|
||||
::pid_t &Tgid) {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
|
||||
auto BufferOrError = getProcFile(Pid, "status");
|
||||
if (!BufferOrError)
|
||||
@ -126,7 +126,7 @@ static bool IsDirNumeric(const char *dname) {
|
||||
}
|
||||
|
||||
static ArchSpec GetELFProcessCPUType(llvm::StringRef exe_path) {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
|
||||
auto buffer_sp = FileSystem::Instance().CreateDataBuffer(exe_path, 0x20, 0);
|
||||
if (!buffer_sp)
|
||||
@ -165,7 +165,7 @@ static void GetProcessArgs(::pid_t pid, ProcessInstanceInfo &process_info) {
|
||||
}
|
||||
|
||||
static void GetExePathAndArch(::pid_t pid, ProcessInstanceInfo &process_info) {
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
|
||||
Log *log = GetLog(LLDBLog::Process);
|
||||
std::string ExePath(PATH_MAX, '\0');
|
||||
|
||||
// We can't use getProcFile here because proc/[pid]/exe is a symbolic link.
|
||||
|
@ -80,8 +80,7 @@ llvm::StringRef HostInfoLinux::GetDistributionId() {
|
||||
// Try to run 'lbs_release -i', and use that response for the distribution
|
||||
// id.
|
||||
llvm::call_once(g_fields->m_distribution_once_flag, []() {
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST));
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
LLDB_LOGF(log, "attempting to determine Linux distribution...");
|
||||
|
||||
// check if the lsb_release command exists at one of the following paths
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
|
||||
lldb_private::getProcFile(::pid_t pid, ::pid_t tid, const llvm::Twine &file) {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
std::string File =
|
||||
("/proc/" + llvm::Twine(pid) + "/task/" + llvm::Twine(tid) + "/" + file)
|
||||
.str();
|
||||
@ -24,7 +24,7 @@ lldb_private::getProcFile(::pid_t pid, ::pid_t tid, const llvm::Twine &file) {
|
||||
|
||||
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
|
||||
lldb_private::getProcFile(::pid_t pid, const llvm::Twine &file) {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
std::string File = ("/proc/" + llvm::Twine(pid) + "/" + file).str();
|
||||
auto Ret = llvm::MemoryBuffer::getFileAsStream(File);
|
||||
if (!Ret)
|
||||
@ -34,7 +34,7 @@ lldb_private::getProcFile(::pid_t pid, const llvm::Twine &file) {
|
||||
|
||||
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
|
||||
lldb_private::getProcFile(const llvm::Twine &file) {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
std::string File = ("/proc/" + file).str();
|
||||
auto Ret = llvm::MemoryBuffer::getFileAsStream(File);
|
||||
if (!Ret)
|
||||
|
@ -322,7 +322,7 @@ bool Host::OpenFileInExternalEditor(const FileSpec &file_spec,
|
||||
uint32_t reserved2; // must be zero
|
||||
} BabelAESelInfo;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_HOST));
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
char file_path[PATH_MAX];
|
||||
file_spec.GetPath(file_path, PATH_MAX);
|
||||
CFCString file_cfstr(file_path, kCFStringEncodingUTF8);
|
||||
@ -721,8 +721,7 @@ static void PackageXPCEnvironment(xpc_object_t message, llvm::StringRef prefix,
|
||||
static AuthorizationRef authorizationRef = NULL;
|
||||
static Status getXPCAuthorization(ProcessLaunchInfo &launch_info) {
|
||||
Status error;
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST |
|
||||
LIBLLDB_LOG_PROCESS));
|
||||
Log *log(GetLog(LLDBLog::Host | LLDBLog::Process));
|
||||
|
||||
if ((launch_info.GetUserID() == 0) && !authorizationRef) {
|
||||
OSStatus createStatus =
|
||||
@ -843,8 +842,7 @@ static Status LaunchProcessXPC(const char *exe_path,
|
||||
if (error.Fail())
|
||||
return error;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST |
|
||||
LIBLLDB_LOG_PROCESS));
|
||||
Log *log(GetLog(LLDBLog::Host | LLDBLog::Process));
|
||||
|
||||
uid_t requested_uid = launch_info.GetUserID();
|
||||
const char *xpc_service = nil;
|
||||
@ -1053,8 +1051,7 @@ static Status LaunchProcessPosixSpawn(const char *exe_path,
|
||||
const ProcessLaunchInfo &launch_info,
|
||||
lldb::pid_t &pid) {
|
||||
Status error;
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST |
|
||||
LIBLLDB_LOG_PROCESS));
|
||||
Log *log(GetLog(LLDBLog::Host | LLDBLog::Process));
|
||||
|
||||
posix_spawnattr_t attr;
|
||||
error.SetError(::posix_spawnattr_init(&attr), eErrorTypePOSIX);
|
||||
@ -1436,8 +1433,7 @@ llvm::Expected<HostThread> Host::StartMonitoringChildProcess(
|
||||
if (monitor_signals)
|
||||
mask |= DISPATCH_PROC_SIGNAL;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_HOST |
|
||||
LIBLLDB_LOG_PROCESS));
|
||||
Log *log(GetLog(LLDBLog::Host | LLDBLog::Process));
|
||||
|
||||
dispatch_source_t source = ::dispatch_source_create(
|
||||
DISPATCH_SOURCE_TYPE_PROC, pid, mask,
|
||||
|
@ -144,7 +144,7 @@ bool HostInfoMacOSX::ComputeSupportExeDirectory(FileSpec &file_spec) {
|
||||
FileSpec support_dir_spec(raw_path);
|
||||
FileSystem::Instance().Resolve(support_dir_spec);
|
||||
if (!FileSystem::Instance().IsDirectory(support_dir_spec)) {
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
LLDB_LOGF(log, "HostInfoMacOSX::%s(): failed to find support directory",
|
||||
__FUNCTION__);
|
||||
return false;
|
||||
@ -443,7 +443,7 @@ static std::string GetXcodeSDK(XcodeSDK sdk) {
|
||||
if (!path.empty())
|
||||
break;
|
||||
}
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
LLDB_LOGF(log, "Couldn't find SDK %s on host", sdk_name.c_str());
|
||||
|
||||
// Try without the version.
|
||||
|
@ -101,7 +101,7 @@ static bool GetNetBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
|
||||
}
|
||||
|
||||
static bool GetNetBSDProcessCPUType(ProcessInstanceInfo &process_info) {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
|
||||
if (process_info.ProcessIDIsValid()) {
|
||||
auto buffer_sp = FileSystem::Instance().CreateDataBuffer(
|
||||
|
@ -54,8 +54,7 @@ ConnectionFileDescriptor::ConnectionFileDescriptor(bool child_processes_inherit)
|
||||
: Connection(), m_pipe(), m_mutex(), m_shutting_down(false),
|
||||
|
||||
m_child_processes_inherit(child_processes_inherit) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION |
|
||||
LIBLLDB_LOG_OBJECT));
|
||||
Log *log(GetLog(LLDBLog::Connection | LLDBLog::Object));
|
||||
LLDB_LOGF(log, "%p ConnectionFileDescriptor::ConnectionFileDescriptor ()",
|
||||
static_cast<void *>(this));
|
||||
}
|
||||
@ -66,8 +65,7 @@ ConnectionFileDescriptor::ConnectionFileDescriptor(int fd, bool owns_fd)
|
||||
m_io_sp =
|
||||
std::make_shared<NativeFile>(fd, File::eOpenOptionReadWrite, owns_fd);
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION |
|
||||
LIBLLDB_LOG_OBJECT));
|
||||
Log *log(GetLog(LLDBLog::Connection | LLDBLog::Object));
|
||||
LLDB_LOGF(log,
|
||||
"%p ConnectionFileDescriptor::ConnectionFileDescriptor (fd = "
|
||||
"%i, owns_fd = %i)",
|
||||
@ -82,8 +80,7 @@ ConnectionFileDescriptor::ConnectionFileDescriptor(Socket *socket)
|
||||
}
|
||||
|
||||
ConnectionFileDescriptor::~ConnectionFileDescriptor() {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION |
|
||||
LIBLLDB_LOG_OBJECT));
|
||||
Log *log(GetLog(LLDBLog::Connection | LLDBLog::Object));
|
||||
LLDB_LOGF(log, "%p ConnectionFileDescriptor::~ConnectionFileDescriptor ()",
|
||||
static_cast<void *>(this));
|
||||
Disconnect(nullptr);
|
||||
@ -93,7 +90,7 @@ ConnectionFileDescriptor::~ConnectionFileDescriptor() {
|
||||
void ConnectionFileDescriptor::OpenCommandPipe() {
|
||||
CloseCommandPipe();
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
// Make the command file descriptor here:
|
||||
Status result = m_pipe.CreateNew(m_child_processes_inherit);
|
||||
if (!result.Success()) {
|
||||
@ -111,7 +108,7 @@ void ConnectionFileDescriptor::OpenCommandPipe() {
|
||||
}
|
||||
|
||||
void ConnectionFileDescriptor::CloseCommandPipe() {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOGF(log, "%p ConnectionFileDescriptor::CloseCommandPipe()",
|
||||
static_cast<void *>(this));
|
||||
|
||||
@ -132,7 +129,7 @@ ConnectionFileDescriptor::Connect(llvm::StringRef path,
|
||||
socket_id_callback_type socket_id_callback,
|
||||
Status *error_ptr) {
|
||||
std::lock_guard<std::recursive_mutex> guard(m_mutex);
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOGF(log, "%p ConnectionFileDescriptor::Connect (url = '%s')",
|
||||
static_cast<void *>(this), path.str().c_str());
|
||||
|
||||
@ -189,7 +186,7 @@ bool ConnectionFileDescriptor::InterruptRead() {
|
||||
}
|
||||
|
||||
ConnectionStatus ConnectionFileDescriptor::Disconnect(Status *error_ptr) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOGF(log, "%p ConnectionFileDescriptor::Disconnect ()",
|
||||
static_cast<void *>(this));
|
||||
|
||||
@ -250,7 +247,7 @@ size_t ConnectionFileDescriptor::Read(void *dst, size_t dst_len,
|
||||
const Timeout<std::micro> &timeout,
|
||||
ConnectionStatus &status,
|
||||
Status *error_ptr) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
|
||||
std::unique_lock<std::recursive_mutex> locker(m_mutex, std::defer_lock);
|
||||
if (!locker.try_lock()) {
|
||||
@ -358,7 +355,7 @@ size_t ConnectionFileDescriptor::Read(void *dst, size_t dst_len,
|
||||
size_t ConnectionFileDescriptor::Write(const void *src, size_t src_len,
|
||||
ConnectionStatus &status,
|
||||
Status *error_ptr) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOGF(log,
|
||||
"%p ConnectionFileDescriptor::Write (src = %p, src_len = %" PRIu64
|
||||
")",
|
||||
@ -446,7 +443,7 @@ ConnectionFileDescriptor::BytesAvailable(const Timeout<std::micro> &timeout,
|
||||
// Read. If we ever get used more generally we will need to lock here as
|
||||
// well.
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOG(log, "this = {0}, timeout = {1}", this, timeout);
|
||||
|
||||
// Make a copy of the file descriptors to make sure we don't have another
|
||||
@ -656,8 +653,8 @@ ConnectionFileDescriptor::ConnectUDP(llvm::StringRef s,
|
||||
if (error_ptr)
|
||||
*error_ptr = socket.takeError();
|
||||
else
|
||||
LLDB_LOG_ERROR(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION),
|
||||
socket.takeError(), "tcp connect failed: {0}");
|
||||
LLDB_LOG_ERROR(GetLog(LLDBLog::Connection), socket.takeError(),
|
||||
"tcp connect failed: {0}");
|
||||
return eConnectionStatusError;
|
||||
}
|
||||
m_io_sp = std::move(*socket);
|
||||
|
@ -90,7 +90,7 @@ bool ConnectionGenericFile::IsConnected() const {
|
||||
|
||||
lldb::ConnectionStatus ConnectionGenericFile::Connect(llvm::StringRef path,
|
||||
Status *error_ptr) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOGF(log, "%p ConnectionGenericFile::Connect (url = '%s')",
|
||||
static_cast<void *>(this), path.str().c_str());
|
||||
|
||||
@ -132,7 +132,7 @@ lldb::ConnectionStatus ConnectionGenericFile::Connect(llvm::StringRef path,
|
||||
}
|
||||
|
||||
lldb::ConnectionStatus ConnectionGenericFile::Disconnect(Status *error_ptr) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOGF(log, "%p ConnectionGenericFile::Disconnect ()",
|
||||
static_cast<void *>(this));
|
||||
|
||||
@ -244,7 +244,7 @@ finish:
|
||||
ResetEvent(m_event_handles[kBytesAvailableEvent]);
|
||||
|
||||
IncrementFilePointer(return_info.GetBytes());
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOGF(log,
|
||||
"%p ConnectionGenericFile::Read() handle = %p, dst = %p, "
|
||||
"dst_len = %zu) => %zu, error = %s",
|
||||
@ -293,7 +293,7 @@ finish:
|
||||
*error_ptr = return_info.GetError();
|
||||
|
||||
IncrementFilePointer(return_info.GetBytes());
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
|
||||
Log *log = GetLog(LLDBLog::Connection);
|
||||
LLDB_LOGF(log,
|
||||
"%p ConnectionGenericFile::Write() handle = %p, src = %p, "
|
||||
"src_len = %zu) => %zu, error = %s",
|
||||
|
@ -1825,7 +1825,7 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
|
||||
std::string command_string(command_line);
|
||||
std::string original_command_string(command_line);
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMANDS));
|
||||
Log *log = GetLog(LLDBLog::Commands);
|
||||
llvm::PrettyStackTraceFormat stack_trace("HandleCommand(command = \"%s\")",
|
||||
command_line);
|
||||
|
||||
@ -3122,8 +3122,8 @@ bool CommandInterpreter::SaveTranscript(
|
||||
}
|
||||
|
||||
auto error_out = [&](llvm::StringRef error_message, std::string description) {
|
||||
LLDB_LOG(GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMANDS), "{0} ({1}:{2})",
|
||||
error_message, output_file, description);
|
||||
LLDB_LOG(GetLog(LLDBLog::Commands), "{0} ({1}:{2})", error_message,
|
||||
output_file, description);
|
||||
result.AppendErrorWithFormatv(
|
||||
"Failed to save session's transcripts to {0}!", *output_file);
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ bool ABIMacOSX_arm64::PrepareTrivialCall(
|
||||
if (!reg_ctx)
|
||||
return false;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
StreamString s;
|
||||
|
@ -65,7 +65,7 @@ bool ABISysV_arm64::PrepareTrivialCall(Thread &thread, addr_t sp,
|
||||
if (!reg_ctx)
|
||||
return false;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
StreamString s;
|
||||
|
@ -529,7 +529,7 @@ ABISysV_mips::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
bool ABISysV_mips::PrepareTrivialCall(Thread &thread, addr_t sp,
|
||||
addr_t func_addr, addr_t return_addr,
|
||||
llvm::ArrayRef<addr_t> args) const {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
StreamString s;
|
||||
|
@ -526,7 +526,7 @@ ABISysV_mips64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch)
|
||||
bool ABISysV_mips64::PrepareTrivialCall(Thread &thread, addr_t sp,
|
||||
addr_t func_addr, addr_t return_addr,
|
||||
llvm::ArrayRef<addr_t> args) const {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
StreamString s;
|
||||
|
@ -228,7 +228,7 @@ ABISysV_ppc::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
bool ABISysV_ppc::PrepareTrivialCall(Thread &thread, addr_t sp,
|
||||
addr_t func_addr, addr_t return_addr,
|
||||
llvm::ArrayRef<addr_t> args) const {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
StreamString s;
|
||||
|
@ -80,7 +80,7 @@ ABISysV_ppc64::CreateInstance(lldb::ProcessSP process_sp,
|
||||
bool ABISysV_ppc64::PrepareTrivialCall(Thread &thread, addr_t sp,
|
||||
addr_t func_addr, addr_t return_addr,
|
||||
llvm::ArrayRef<addr_t> args) const {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
StreamString s;
|
||||
@ -478,8 +478,7 @@ class ReturnValueExtractor {
|
||||
Type m_type;
|
||||
RegisterContext *m_reg_ctx;
|
||||
ByteOrder m_byte_order;
|
||||
Log *m_log =
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
|
||||
Log *m_log = GetLog(LLDBLog::Expressions);
|
||||
};
|
||||
|
||||
Register GetGPR(uint32_t index) const {
|
||||
@ -555,7 +554,7 @@ private:
|
||||
int32_t m_src_offs = 0;
|
||||
int32_t m_dst_offs = 0;
|
||||
bool m_packed = false;
|
||||
Log *m_log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
|
||||
Log *m_log = GetLog(LLDBLog::Expressions);
|
||||
RegisterContext *m_reg_ctx;
|
||||
ProcessSP m_process_sp;
|
||||
ByteOrder m_byte_order;
|
||||
@ -934,7 +933,7 @@ ABISysV_ppc64::GetReturnValueObjectSimple(Thread &thread,
|
||||
|
||||
auto exp_extractor = ReturnValueExtractor::Create(thread, type);
|
||||
if (!exp_extractor) {
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
LLDB_LOG_ERROR(log, exp_extractor.takeError(),
|
||||
"Extracting return value failed: {0}");
|
||||
return ValueObjectSP();
|
||||
|
@ -195,7 +195,7 @@ ABISysV_s390x::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch)
|
||||
bool ABISysV_s390x::PrepareTrivialCall(Thread &thread, addr_t sp,
|
||||
addr_t func_addr, addr_t return_addr,
|
||||
llvm::ArrayRef<addr_t> args) const {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
StreamString s;
|
||||
|
@ -107,7 +107,7 @@ ABISysV_x86_64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch)
|
||||
bool ABISysV_x86_64::PrepareTrivialCall(Thread &thread, addr_t sp,
|
||||
addr_t func_addr, addr_t return_addr,
|
||||
llvm::ArrayRef<addr_t> args) const {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
StreamString s;
|
||||
|
@ -123,7 +123,7 @@ ABIWindows_x86_64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &ar
|
||||
bool ABIWindows_x86_64::PrepareTrivialCall(Thread &thread, addr_t sp,
|
||||
addr_t func_addr, addr_t return_addr,
|
||||
llvm::ArrayRef<addr_t> args) const {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
StreamString s;
|
||||
|
@ -71,7 +71,7 @@ addr_t ArchitectureMips::GetOpcodeLoadAddress(addr_t opcode_addr,
|
||||
lldb::addr_t ArchitectureMips::GetBreakableLoadAddress(lldb::addr_t addr,
|
||||
Target &target) const {
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
|
||||
Log *log = GetLog(LLDBLog::Breakpoints);
|
||||
|
||||
Address resolved_addr;
|
||||
|
||||
|
@ -795,8 +795,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (Log *log =
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS)) {
|
||||
if (Log *log = GetLog(LLDBLog::Process)) {
|
||||
StreamString ss;
|
||||
|
||||
ss.Printf("[%s] expands to %zu operands:\n", operands_string,
|
||||
|
@ -434,7 +434,7 @@ lldb_private::UUID
|
||||
DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
|
||||
Process *process,
|
||||
bool *read_error) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
if (addr == LLDB_INVALID_ADDRESS) {
|
||||
if (read_error)
|
||||
*read_error = true;
|
||||
@ -645,7 +645,7 @@ UUID DynamicLoaderDarwinKernel::KextImageInfo::GetUUID() const {
|
||||
|
||||
bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
|
||||
Process *process) {
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
if (m_memory_module_sp.get() != nullptr)
|
||||
return true;
|
||||
if (m_load_address == LLDB_INVALID_ADDRESS)
|
||||
@ -756,7 +756,7 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(
|
||||
// for the kernel, we'll need to read the load commands out of memory to get it.
|
||||
if (m_uuid.IsValid() == false) {
|
||||
if (ReadMemoryModule(process) == false) {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(log,
|
||||
"Unable to read '%s' from memory at address 0x%" PRIx64
|
||||
" to get the segment load addresses.",
|
||||
@ -1062,7 +1062,7 @@ bool DynamicLoaderDarwinKernel::BreakpointHitCallback(
|
||||
bool DynamicLoaderDarwinKernel::BreakpointHit(StoppointCallbackContext *context,
|
||||
user_id_t break_id,
|
||||
user_id_t break_loc_id) {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(log, "DynamicLoaderDarwinKernel::BreakpointHit (...)\n");
|
||||
|
||||
ReadAllKextSummaries();
|
||||
@ -1158,7 +1158,7 @@ bool DynamicLoaderDarwinKernel::ReadKextSummaryHeader() {
|
||||
bool DynamicLoaderDarwinKernel::ParseKextSummaries(
|
||||
const Address &kext_summary_addr, uint32_t count) {
|
||||
KextImageInfo::collection kext_summaries;
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(log,
|
||||
"Kexts-changed breakpoint hit, there are %d kexts currently.\n",
|
||||
count);
|
||||
@ -1514,7 +1514,7 @@ ThreadPlanSP
|
||||
DynamicLoaderDarwinKernel::GetStepThroughTrampolinePlan(Thread &thread,
|
||||
bool stop_others) {
|
||||
ThreadPlanSP thread_plan_sp;
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
|
||||
Log *log = GetLog(LLDBLog::Step);
|
||||
LLDB_LOGF(log, "Could not find symbol for step through.");
|
||||
return thread_plan_sp;
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ void DynamicLoaderHexagonDYLD::UnloadSections(const ModuleSP module) {
|
||||
|
||||
// Place a breakpoint on <_rtld_debug_state>
|
||||
bool DynamicLoaderHexagonDYLD::SetRendezvousBreakpoint() {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
|
||||
// This is the original code, which want to look in the rendezvous structure
|
||||
// to find the breakpoint address. Its backwards for us, since we can easily
|
||||
@ -304,7 +304,7 @@ bool DynamicLoaderHexagonDYLD::SetRendezvousBreakpoint() {
|
||||
bool DynamicLoaderHexagonDYLD::RendezvousBreakpointHit(
|
||||
void *baton, StoppointCallbackContext *context, user_id_t break_id,
|
||||
user_id_t break_loc_id) {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
|
||||
LLDB_LOGF(log, "Rendezvous breakpoint hit!");
|
||||
|
||||
@ -337,7 +337,7 @@ bool DynamicLoaderHexagonDYLD::RendezvousBreakpointHit(
|
||||
/// Helper method for RendezvousBreakpointHit. Updates LLDB's current set
|
||||
/// of loaded modules.
|
||||
void DynamicLoaderHexagonDYLD::RefreshModules() {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
|
||||
if (!m_rendezvous.Resolve())
|
||||
return;
|
||||
@ -457,7 +457,7 @@ void DynamicLoaderHexagonDYLD::LoadAllCurrentModules() {
|
||||
ModuleList module_list;
|
||||
|
||||
if (!m_rendezvous.Resolve()) {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(
|
||||
log,
|
||||
"DynamicLoaderHexagonDYLD::%s unable to resolve rendezvous address",
|
||||
@ -478,7 +478,7 @@ void DynamicLoaderHexagonDYLD::LoadAllCurrentModules() {
|
||||
if (module_sp.get()) {
|
||||
module_list.Append(module_sp);
|
||||
} else {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(log,
|
||||
"DynamicLoaderHexagonDYLD::%s failed loading module %s at "
|
||||
"0x%" PRIx64,
|
||||
@ -589,7 +589,7 @@ DynamicLoaderHexagonDYLD::GetThreadLocalData(const lldb::ModuleSP module,
|
||||
addr_t tls_block = ReadPointer(dtv_slot + metadata.tls_offset);
|
||||
|
||||
Module *mod = module.get();
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(log,
|
||||
"DynamicLoaderHexagonDYLD::Performed TLS lookup: "
|
||||
"module=%s, link_map=0x%" PRIx64 ", tp=0x%" PRIx64
|
||||
|
@ -166,7 +166,7 @@ void DynamicLoaderDarwin::UnloadImages(
|
||||
if (m_process->GetStopID() == m_dyld_image_infos_stop_id)
|
||||
return;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
Target &target = m_process->GetTarget();
|
||||
LLDB_LOGF(log, "Removing %" PRId64 " modules.",
|
||||
(uint64_t)solib_addresses.size());
|
||||
@ -209,7 +209,7 @@ void DynamicLoaderDarwin::UnloadImages(
|
||||
}
|
||||
|
||||
void DynamicLoaderDarwin::UnloadAllImages() {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
ModuleList unloaded_modules_list;
|
||||
|
||||
Target &target = m_process->GetTarget();
|
||||
@ -533,7 +533,7 @@ void DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos(
|
||||
uint32_t exe_idx = UINT32_MAX;
|
||||
uint32_t dyld_idx = UINT32_MAX;
|
||||
Target &target = m_process->GetTarget();
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
ConstString g_dyld_sim_filename("dyld_sim");
|
||||
|
||||
ArchSpec target_arch = target.GetArchitecture();
|
||||
@ -615,7 +615,7 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos(
|
||||
std::lock_guard<std::recursive_mutex> guard(m_mutex);
|
||||
// Now add these images to the main list.
|
||||
ModuleList loaded_module_list;
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
Target &target = m_process->GetTarget();
|
||||
ModuleList &target_images = target.GetImages();
|
||||
|
||||
@ -850,7 +850,7 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
|
||||
const SymbolContext ¤t_context =
|
||||
current_frame->GetSymbolContext(eSymbolContextSymbol);
|
||||
Symbol *current_symbol = current_context.symbol;
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
|
||||
Log *log = GetLog(LLDBLog::Step);
|
||||
TargetSP target_sp(thread.CalculateTarget());
|
||||
|
||||
if (current_symbol != nullptr) {
|
||||
@ -1134,7 +1134,7 @@ DynamicLoaderDarwin::GetThreadLocalData(const lldb::ModuleSP module_sp,
|
||||
}
|
||||
|
||||
bool DynamicLoaderDarwin::UseDYLDSPI(Process *process) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
bool use_new_spi_interface = false;
|
||||
|
||||
llvm::VersionTuple version = process->GetHostOSVersion();
|
||||
|
@ -155,7 +155,7 @@ void DynamicLoaderMacOS::ClearNotificationBreakpoint() {
|
||||
// (available on SnowLeopard only). If that fails, then check in the default
|
||||
// addresses.
|
||||
void DynamicLoaderMacOS::DoInitialImageFetch() {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
|
||||
// Remove any binaries we pre-loaded in the Target before
|
||||
// launching/attaching. If the same binaries are present in the process,
|
||||
@ -310,7 +310,7 @@ bool DynamicLoaderMacOS::NotifyBreakpointHit(void *baton,
|
||||
|
||||
void DynamicLoaderMacOS::AddBinaries(
|
||||
const std::vector<lldb::addr_t> &load_addresses) {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
ImageInfo::collection image_infos;
|
||||
|
||||
LLDB_LOGF(log, "Adding %" PRId64 " modules.",
|
||||
|
@ -533,7 +533,7 @@ bool DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure() {
|
||||
bool DynamicLoaderMacOSXDYLD::AddModulesUsingImageInfosAddress(
|
||||
lldb::addr_t image_infos_addr, uint32_t image_infos_count) {
|
||||
ImageInfo::collection image_infos;
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(log, "Adding %d modules.\n", image_infos_count);
|
||||
|
||||
std::lock_guard<std::recursive_mutex> guard(m_mutex);
|
||||
@ -574,7 +574,7 @@ bool DynamicLoaderMacOSXDYLD::AddModulesUsingImageInfosAddress(
|
||||
bool DynamicLoaderMacOSXDYLD::RemoveModulesUsingImageInfosAddress(
|
||||
lldb::addr_t image_infos_addr, uint32_t image_infos_count) {
|
||||
ImageInfo::collection image_infos;
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
|
||||
std::lock_guard<std::recursive_mutex> guard(m_mutex);
|
||||
std::lock_guard<std::recursive_mutex> baseclass_guard(GetMutex());
|
||||
@ -698,7 +698,7 @@ bool DynamicLoaderMacOSXDYLD::ReadImageInfos(
|
||||
// thereof). Only do this if this is the first time we're reading the dyld
|
||||
// infos. Return true if we actually read anything, and false otherwise.
|
||||
bool DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos() {
|
||||
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
|
||||
std::lock_guard<std::recursive_mutex> guard(m_mutex);
|
||||
std::lock_guard<std::recursive_mutex> baseclass_guard(GetMutex());
|
||||
|
@ -34,7 +34,7 @@ DYLDRendezvous::DYLDRendezvous(Process *process)
|
||||
}
|
||||
|
||||
addr_t DYLDRendezvous::ResolveRendezvousAddress() {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
addr_t info_location;
|
||||
addr_t info_addr;
|
||||
Status error;
|
||||
@ -113,7 +113,7 @@ addr_t DYLDRendezvous::ResolveRendezvousAddress() {
|
||||
|
||||
void DYLDRendezvous::UpdateExecutablePath() {
|
||||
if (m_process) {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
Module *exe_mod = m_process->GetTarget().GetExecutableModulePointer();
|
||||
if (exe_mod) {
|
||||
m_exe_file_spec = exe_mod->GetPlatformFileSpec();
|
||||
@ -129,7 +129,7 @@ void DYLDRendezvous::UpdateExecutablePath() {
|
||||
}
|
||||
|
||||
bool DYLDRendezvous::Resolve() {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
|
||||
const size_t word_size = 4;
|
||||
Rendezvous info;
|
||||
|
@ -76,7 +76,7 @@ DynamicLoaderPOSIXDYLD::~DynamicLoaderPOSIXDYLD() {
|
||||
}
|
||||
|
||||
void DynamicLoaderPOSIXDYLD::DidAttach() {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(log, "DynamicLoaderPOSIXDYLD::%s() pid %" PRIu64, __FUNCTION__,
|
||||
m_process ? m_process->GetID() : LLDB_INVALID_PROCESS_ID);
|
||||
m_auxv = std::make_unique<AuxVector>(m_process->GetAuxvData());
|
||||
@ -166,7 +166,7 @@ void DynamicLoaderPOSIXDYLD::DidAttach() {
|
||||
}
|
||||
|
||||
void DynamicLoaderPOSIXDYLD::DidLaunch() {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(log, "DynamicLoaderPOSIXDYLD::%s()", __FUNCTION__);
|
||||
|
||||
ModuleSP executable;
|
||||
@ -214,7 +214,7 @@ void DynamicLoaderPOSIXDYLD::UnloadSections(const ModuleSP module) {
|
||||
}
|
||||
|
||||
void DynamicLoaderPOSIXDYLD::ProbeEntry() {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
|
||||
const addr_t entry = GetEntryPoint();
|
||||
if (entry == LLDB_INVALID_ADDRESS) {
|
||||
@ -257,7 +257,7 @@ bool DynamicLoaderPOSIXDYLD::EntryBreakpointHit(
|
||||
if (!baton)
|
||||
return false;
|
||||
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
DynamicLoaderPOSIXDYLD *const dyld_instance =
|
||||
static_cast<DynamicLoaderPOSIXDYLD *>(baton);
|
||||
LLDB_LOGF(log, "DynamicLoaderPOSIXDYLD::%s called for pid %" PRIu64,
|
||||
@ -299,7 +299,7 @@ bool DynamicLoaderPOSIXDYLD::EntryBreakpointHit(
|
||||
}
|
||||
|
||||
bool DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint() {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
if (m_dyld_bid != LLDB_INVALID_BREAK_ID) {
|
||||
LLDB_LOG(log,
|
||||
"Rendezvous breakpoint breakpoint id {0} for pid {1}"
|
||||
@ -387,7 +387,7 @@ bool DynamicLoaderPOSIXDYLD::RendezvousBreakpointHit(
|
||||
if (!baton)
|
||||
return false;
|
||||
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
DynamicLoaderPOSIXDYLD *const dyld_instance =
|
||||
static_cast<DynamicLoaderPOSIXDYLD *>(baton);
|
||||
LLDB_LOGF(log, "DynamicLoaderPOSIXDYLD::%s called for pid %" PRIu64,
|
||||
@ -539,7 +539,7 @@ void DynamicLoaderPOSIXDYLD::LoadVDSO() {
|
||||
MemoryRegionInfo info;
|
||||
Status status = m_process->GetMemoryRegionInfo(m_vdso_base, info);
|
||||
if (status.Fail()) {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOG(log, "Failed to get vdso region info: {0}", status);
|
||||
return;
|
||||
}
|
||||
@ -560,7 +560,7 @@ ModuleSP DynamicLoaderPOSIXDYLD::LoadInterpreterModule() {
|
||||
Status status = m_process->GetMemoryRegionInfo(m_interpreter_base, info);
|
||||
if (status.Fail() || info.GetMapped() != MemoryRegionInfo::eYes ||
|
||||
info.GetName().IsEmpty()) {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOG(log, "Failed to get interpreter region info: {0}", status);
|
||||
return nullptr;
|
||||
}
|
||||
@ -582,7 +582,7 @@ void DynamicLoaderPOSIXDYLD::LoadAllCurrentModules() {
|
||||
DYLDRendezvous::iterator I;
|
||||
DYLDRendezvous::iterator E;
|
||||
ModuleList module_list;
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
|
||||
LoadVDSO();
|
||||
|
||||
@ -613,7 +613,7 @@ void DynamicLoaderPOSIXDYLD::LoadAllCurrentModules() {
|
||||
I->file_spec.GetFilename());
|
||||
module_list.Append(module_sp);
|
||||
} else {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(
|
||||
log,
|
||||
"DynamicLoaderPOSIXDYLD::%s failed loading module %s at 0x%" PRIx64,
|
||||
@ -722,7 +722,7 @@ DynamicLoaderPOSIXDYLD::GetThreadLocalData(const lldb::ModuleSP module_sp,
|
||||
addr_t dtv_slot = dtv + metadata.dtv_slot_size * modid;
|
||||
addr_t tls_block = ReadPointer(dtv_slot + metadata.tls_offset);
|
||||
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(log,
|
||||
"DynamicLoaderPOSIXDYLD::Performed TLS lookup: "
|
||||
"module=%s, link_map=0x%" PRIx64 ", tp=0x%" PRIx64
|
||||
@ -738,7 +738,7 @@ DynamicLoaderPOSIXDYLD::GetThreadLocalData(const lldb::ModuleSP module_sp,
|
||||
|
||||
void DynamicLoaderPOSIXDYLD::ResolveExecutableModule(
|
||||
lldb::ModuleSP &module_sp) {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
|
||||
if (m_process == nullptr)
|
||||
return;
|
||||
|
@ -117,37 +117,37 @@ lldb::addr_t DynamicLoaderWindowsDYLD::GetLoadAddress(ModuleSP executable) {
|
||||
}
|
||||
|
||||
void DynamicLoaderWindowsDYLD::DidAttach() {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
LLDB_LOGF(log, "DynamicLoaderWindowsDYLD::%s()", __FUNCTION__);
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(log, "DynamicLoaderWindowsDYLD::%s()", __FUNCTION__);
|
||||
|
||||
ModuleSP executable = GetTargetExecutable();
|
||||
ModuleSP executable = GetTargetExecutable();
|
||||
|
||||
if (!executable.get())
|
||||
return;
|
||||
if (!executable.get())
|
||||
return;
|
||||
|
||||
// Try to fetch the load address of the file from the process, since there
|
||||
// could be randomization of the load address.
|
||||
lldb::addr_t load_addr = GetLoadAddress(executable);
|
||||
if (load_addr == LLDB_INVALID_ADDRESS)
|
||||
return;
|
||||
// Try to fetch the load address of the file from the process, since there
|
||||
// could be randomization of the load address.
|
||||
lldb::addr_t load_addr = GetLoadAddress(executable);
|
||||
if (load_addr == LLDB_INVALID_ADDRESS)
|
||||
return;
|
||||
|
||||
// Request the process base address.
|
||||
lldb::addr_t image_base = m_process->GetImageInfoAddress();
|
||||
if (image_base == load_addr)
|
||||
return;
|
||||
// Request the process base address.
|
||||
lldb::addr_t image_base = m_process->GetImageInfoAddress();
|
||||
if (image_base == load_addr)
|
||||
return;
|
||||
|
||||
// Rebase the process's modules if there is a mismatch.
|
||||
UpdateLoadedSections(executable, LLDB_INVALID_ADDRESS, load_addr, false);
|
||||
// Rebase the process's modules if there is a mismatch.
|
||||
UpdateLoadedSections(executable, LLDB_INVALID_ADDRESS, load_addr, false);
|
||||
|
||||
ModuleList module_list;
|
||||
module_list.Append(executable);
|
||||
m_process->GetTarget().ModulesDidLoad(module_list);
|
||||
auto error = m_process->LoadModules();
|
||||
LLDB_LOG_ERROR(log, std::move(error), "failed to load modules: {0}");
|
||||
ModuleList module_list;
|
||||
module_list.Append(executable);
|
||||
m_process->GetTarget().ModulesDidLoad(module_list);
|
||||
auto error = m_process->LoadModules();
|
||||
LLDB_LOG_ERROR(log, std::move(error), "failed to load modules: {0}");
|
||||
}
|
||||
|
||||
void DynamicLoaderWindowsDYLD::DidLaunch() {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(log, "DynamicLoaderWindowsDYLD::%s()", __FUNCTION__);
|
||||
|
||||
ModuleSP executable = GetTargetExecutable();
|
||||
|
@ -51,7 +51,7 @@ DynamicLoader *DynamicLoaderWasmDYLD::CreateInstance(Process *process,
|
||||
}
|
||||
|
||||
void DynamicLoaderWasmDYLD::DidAttach() {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
|
||||
Log *log = GetLog(LLDBLog::DynamicLoader);
|
||||
LLDB_LOGF(log, "DynamicLoaderWasmDYLD::%s()", __FUNCTION__);
|
||||
|
||||
// Ask the process for the list of loaded WebAssembly modules.
|
||||
|
@ -53,7 +53,7 @@ void ASTResultSynthesizer::Initialize(ASTContext &Context) {
|
||||
}
|
||||
|
||||
void ASTResultSynthesizer::TransformTopLevelDecl(Decl *D) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (NamedDecl *named_decl = dyn_cast<NamedDecl>(D)) {
|
||||
if (log && log->GetVerbose()) {
|
||||
@ -112,7 +112,7 @@ bool ASTResultSynthesizer::HandleTopLevelDecl(DeclGroupRef D) {
|
||||
}
|
||||
|
||||
bool ASTResultSynthesizer::SynthesizeFunctionResult(FunctionDecl *FunDecl) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (!m_sema)
|
||||
return false;
|
||||
@ -154,7 +154,7 @@ bool ASTResultSynthesizer::SynthesizeFunctionResult(FunctionDecl *FunDecl) {
|
||||
|
||||
bool ASTResultSynthesizer::SynthesizeObjCMethodResult(
|
||||
ObjCMethodDecl *MethodDecl) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (!m_sema)
|
||||
return false;
|
||||
@ -198,7 +198,7 @@ bool ASTResultSynthesizer::SynthesizeObjCMethodResult(
|
||||
|
||||
bool ASTResultSynthesizer::SynthesizeBodyResult(CompoundStmt *Body,
|
||||
DeclContext *DC) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
ASTContext &Ctx(*m_ast_context);
|
||||
|
||||
@ -407,7 +407,7 @@ void ASTResultSynthesizer::MaybeRecordPersistentType(TypeDecl *D) {
|
||||
if (name.size() == 0 || name[0] != '$')
|
||||
return;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
ConstString name_cs(name.str().c_str());
|
||||
|
||||
@ -427,7 +427,7 @@ void ASTResultSynthesizer::RecordPersistentDecl(NamedDecl *D) {
|
||||
if (name.size() == 0)
|
||||
return;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
ConstString name_cs(name.str().c_str());
|
||||
|
||||
@ -455,7 +455,7 @@ void ASTResultSynthesizer::CommitPersistentDecls() {
|
||||
&scratch_ctx->getASTContext(), decl);
|
||||
|
||||
if (!D_scratch) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
std::string s;
|
||||
|
@ -49,8 +49,7 @@ CompilerType ClangASTImporter::CopyType(TypeSystemClang &dst_ast,
|
||||
|
||||
llvm::Expected<QualType> ret_or_error = delegate_sp->Import(src_qual_type);
|
||||
if (!ret_or_error) {
|
||||
Log *log =
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
LLDB_LOG_ERROR(log, ret_or_error.takeError(),
|
||||
"Couldn't import type: {0}");
|
||||
return CompilerType();
|
||||
@ -77,7 +76,7 @@ clang::Decl *ClangASTImporter::CopyDecl(clang::ASTContext *dst_ast,
|
||||
|
||||
llvm::Expected<clang::Decl *> result = delegate_sp->Import(decl);
|
||||
if (!result) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
LLDB_LOG_ERROR(log, result.takeError(), "Couldn't import decl: {0}");
|
||||
if (log) {
|
||||
lldb::user_id_t user_id = LLDB_INVALID_UID;
|
||||
@ -170,7 +169,7 @@ private:
|
||||
|
||||
void Override(clang::Decl *decl) {
|
||||
if (clang::Decl *escaped_child = GetEscapedChild(decl)) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
LLDB_LOG(log,
|
||||
" [ClangASTImporter] DeclContextOverride couldn't "
|
||||
@ -303,7 +302,7 @@ public:
|
||||
|
||||
CompilerType ClangASTImporter::DeportType(TypeSystemClang &dst,
|
||||
const CompilerType &src_type) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
TypeSystemClang *src_ctxt =
|
||||
llvm::cast<TypeSystemClang>(src_type.GetTypeSystem());
|
||||
@ -326,7 +325,7 @@ CompilerType ClangASTImporter::DeportType(TypeSystemClang &dst,
|
||||
|
||||
clang::Decl *ClangASTImporter::DeportDecl(clang::ASTContext *dst_ctx,
|
||||
clang::Decl *decl) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
clang::ASTContext *src_ctx = &decl->getASTContext();
|
||||
LLDB_LOG(log,
|
||||
@ -615,7 +614,7 @@ bool ClangASTImporter::CompleteAndFetchChildren(clang::QualType type) {
|
||||
if (!RequireCompleteType(type))
|
||||
return false;
|
||||
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (const TagType *tag_type = type->getAs<TagType>()) {
|
||||
TagDecl *tag_decl = tag_type->getDecl();
|
||||
@ -779,7 +778,7 @@ void ClangASTImporter::BuildNamespaceMap(const clang::NamespaceDecl *decl) {
|
||||
}
|
||||
|
||||
void ClangASTImporter::ForgetDestination(clang::ASTContext *dst_ast) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
LLDB_LOG(log,
|
||||
" [ClangASTImporter] Forgetting destination (ASTContext*){0}",
|
||||
@ -792,7 +791,7 @@ void ClangASTImporter::ForgetSource(clang::ASTContext *dst_ast,
|
||||
clang::ASTContext *src_ast) {
|
||||
ASTContextMetadataSP md = MaybeGetContextMetadata(dst_ast);
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
LLDB_LOG(log,
|
||||
" [ClangASTImporter] Forgetting source->dest "
|
||||
@ -865,7 +864,7 @@ ClangASTImporter::ASTImporterDelegate::ImportImpl(Decl *From) {
|
||||
const ClangASTMetadata *md = m_main.GetDeclMetadata(From);
|
||||
auto *td = dyn_cast<TagDecl>(From);
|
||||
if (td && md && md->IsForcefullyCompleted()) {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
LLDB_LOG(log,
|
||||
"[ClangASTImporter] Searching for a complete definition of {0} in "
|
||||
"other modules",
|
||||
@ -903,7 +902,7 @@ void ClangASTImporter::ASTImporterDelegate::ImportDefinitionTo(
|
||||
MapImported(from, to);
|
||||
ASTImporter::Imported(from, to);
|
||||
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (llvm::Error err = ImportDefinition(from)) {
|
||||
LLDB_LOG_ERROR(log, std::move(err),
|
||||
@ -915,8 +914,7 @@ void ClangASTImporter::ASTImporterDelegate::ImportDefinitionTo(
|
||||
if (clang::TagDecl *from_tag = dyn_cast<clang::TagDecl>(from)) {
|
||||
to_tag->setCompleteDefinition(from_tag->isCompleteDefinition());
|
||||
|
||||
if (Log *log_ast =
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_AST)) {
|
||||
if (Log *log_ast = GetLog(LLDBLog::AST)) {
|
||||
std::string name_string;
|
||||
if (NamedDecl *from_named_decl = dyn_cast<clang::NamedDecl>(from)) {
|
||||
llvm::raw_string_ostream name_stream(name_string);
|
||||
@ -1023,7 +1021,7 @@ RemapModule(OptionalClangModuleID from_id,
|
||||
|
||||
void ClangASTImporter::ASTImporterDelegate::Imported(clang::Decl *from,
|
||||
clang::Decl *to) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
// Some decls shouldn't be tracked here because they were not created by
|
||||
// copying 'from' to 'to'. Just exit early for those.
|
||||
|
@ -183,7 +183,7 @@ bool ClangASTSource::FindExternalVisibleDeclsByName(
|
||||
}
|
||||
|
||||
TagDecl *ClangASTSource::FindCompleteType(const TagDecl *decl) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (const NamespaceDecl *namespace_context =
|
||||
dyn_cast<NamespaceDecl>(decl->getDeclContext())) {
|
||||
@ -278,7 +278,7 @@ TagDecl *ClangASTSource::FindCompleteType(const TagDecl *decl) {
|
||||
}
|
||||
|
||||
void ClangASTSource::CompleteType(TagDecl *tag_decl) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
LLDB_LOG(log,
|
||||
@ -307,7 +307,7 @@ void ClangASTSource::CompleteType(TagDecl *tag_decl) {
|
||||
}
|
||||
|
||||
void ClangASTSource::CompleteType(clang::ObjCInterfaceDecl *interface_decl) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
LLDB_LOG(log,
|
||||
" [CompleteObjCInterfaceDecl] on (ASTContext*){0} '{1}' "
|
||||
@ -387,7 +387,7 @@ void ClangASTSource::FindExternalLexicalDecls(
|
||||
llvm::function_ref<bool(Decl::Kind)> predicate,
|
||||
llvm::SmallVectorImpl<Decl *> &decls) {
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
const Decl *context_decl = dyn_cast<Decl>(decl_context);
|
||||
|
||||
@ -520,7 +520,7 @@ void ClangASTSource::FindExternalVisibleDecls(NameSearchContext &context) {
|
||||
|
||||
const ConstString name(context.m_decl_name.getAsString().c_str());
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
if (!context.m_decl_context)
|
||||
@ -597,7 +597,7 @@ void ClangASTSource::FindExternalVisibleDecls(
|
||||
CompilerDeclContext &namespace_decl) {
|
||||
assert(m_ast_context);
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
SymbolContextList sc_list;
|
||||
|
||||
@ -668,7 +668,7 @@ void ClangASTSource::FillNamespaceMap(
|
||||
if (IgnoreName(name, true))
|
||||
return;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (module_sp && namespace_decl) {
|
||||
CompilerDeclContext found_namespace_decl;
|
||||
@ -833,7 +833,7 @@ bool ClangASTSource::FindObjCMethodDeclsWithOrigin(
|
||||
if (!copied_method_decl)
|
||||
continue;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
LLDB_LOG(log, " CAS::FOMD found ({0}) {1}", log_info,
|
||||
ClangUtil::DumpDecl(copied_method_decl));
|
||||
@ -846,7 +846,7 @@ bool ClangASTSource::FindObjCMethodDeclsWithOrigin(
|
||||
|
||||
void ClangASTSource::FindDeclInModules(NameSearchContext &context,
|
||||
ConstString name) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
std::shared_ptr<ClangModulesDeclVendor> modules_decl_vendor =
|
||||
GetClangModulesDeclVendor();
|
||||
@ -886,7 +886,7 @@ void ClangASTSource::FindDeclInModules(NameSearchContext &context,
|
||||
|
||||
void ClangASTSource::FindDeclInObjCRuntime(NameSearchContext &context,
|
||||
ConstString name) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
lldb::ProcessSP process(m_target->GetProcessSP());
|
||||
|
||||
@ -928,7 +928,7 @@ void ClangASTSource::FindDeclInObjCRuntime(NameSearchContext &context,
|
||||
}
|
||||
|
||||
void ClangASTSource::FindObjCMethodDecls(NameSearchContext &context) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
const DeclarationName &decl_name(context.m_decl_name);
|
||||
const DeclContext *decl_ctx(context.m_decl_context);
|
||||
@ -1208,7 +1208,7 @@ void ClangASTSource::FindObjCMethodDecls(NameSearchContext &context) {
|
||||
static bool FindObjCPropertyAndIvarDeclsWithOrigin(
|
||||
NameSearchContext &context, ClangASTSource &source,
|
||||
DeclFromUser<const ObjCInterfaceDecl> &origin_iface_decl) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (origin_iface_decl.IsInvalid())
|
||||
return false;
|
||||
@ -1255,7 +1255,7 @@ static bool FindObjCPropertyAndIvarDeclsWithOrigin(
|
||||
}
|
||||
|
||||
void ClangASTSource::FindObjCPropertyAndIvarDecls(NameSearchContext &context) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
DeclFromParser<const ObjCInterfaceDecl> parser_iface_decl(
|
||||
cast<ObjCInterfaceDecl>(context.m_decl_context));
|
||||
@ -1391,7 +1391,7 @@ void ClangASTSource::LookupInNamespace(NameSearchContext &context) {
|
||||
const NamespaceDecl *namespace_context =
|
||||
dyn_cast<NamespaceDecl>(context.m_decl_context);
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
ClangASTImporter::NamespaceMapSP namespace_map =
|
||||
m_ast_importer_sp->GetNamespaceMap(namespace_context);
|
||||
@ -1498,7 +1498,7 @@ bool ClangASTSource::layoutRecordType(const RecordDecl *record, uint64_t &size,
|
||||
BaseOffsetMap &base_offsets,
|
||||
BaseOffsetMap &virtual_base_offsets) {
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
LLDB_LOG(log,
|
||||
"LayoutRecordType on (ASTContext*){0} '{1}' for (RecordDecl*)"
|
||||
@ -1620,7 +1620,7 @@ void ClangASTSource::CompleteNamespaceMap(
|
||||
ClangASTImporter::NamespaceMapSP &namespace_map, ConstString name,
|
||||
ClangASTImporter::NamespaceMapSP &parent_map) const {
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
if (parent_map && parent_map->size())
|
||||
|
@ -252,7 +252,7 @@ bool ClangExpressionDeclMap::AddPersistentVariable(const NamedDecl *decl,
|
||||
return true;
|
||||
}
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
ExecutionContext &exe_ctx = m_parser_vars->m_exe_ctx;
|
||||
Target *target = exe_ctx.GetTargetPtr();
|
||||
if (target == nullptr)
|
||||
@ -328,7 +328,7 @@ bool ClangExpressionDeclMap::AddValueToStruct(const NamedDecl *decl,
|
||||
|
||||
bool is_persistent_variable = false;
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
m_struct_vars->m_struct_laid_out = false;
|
||||
|
||||
@ -646,7 +646,7 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
|
||||
|
||||
const ConstString name(context.m_decl_name.getAsString().c_str());
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (log) {
|
||||
if (!context.m_decl_context)
|
||||
@ -728,7 +728,7 @@ clang::NamedDecl *ClangExpressionDeclMap::GetPersistentDecl(ConstString name) {
|
||||
|
||||
void ClangExpressionDeclMap::SearchPersistenDecls(NameSearchContext &context,
|
||||
const ConstString name) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
NamedDecl *persistent_decl = GetPersistentDecl(name);
|
||||
|
||||
@ -756,7 +756,7 @@ void ClangExpressionDeclMap::SearchPersistenDecls(NameSearchContext &context,
|
||||
}
|
||||
|
||||
void ClangExpressionDeclMap::LookUpLldbClass(NameSearchContext &context) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
StackFrame *frame = m_parser_vars->m_exe_ctx.GetFramePtr();
|
||||
SymbolContext sym_ctx;
|
||||
@ -857,7 +857,7 @@ void ClangExpressionDeclMap::LookUpLldbClass(NameSearchContext &context) {
|
||||
}
|
||||
|
||||
void ClangExpressionDeclMap::LookUpLldbObjCClass(NameSearchContext &context) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
StackFrame *frame = m_parser_vars->m_exe_ctx.GetFramePtr();
|
||||
|
||||
@ -1014,7 +1014,7 @@ void ClangExpressionDeclMap::LookupLocalVarNamespace(
|
||||
|
||||
void ClangExpressionDeclMap::LookupInModulesDeclVendor(
|
||||
NameSearchContext &context, ConstString name) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (!m_target)
|
||||
return;
|
||||
@ -1331,7 +1331,7 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
|
||||
const CompilerDeclContext &namespace_decl) {
|
||||
assert(m_ast_context);
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
const ConstString name(context.m_decl_name.getAsString().c_str());
|
||||
if (IgnoreName(name, false))
|
||||
@ -1460,7 +1460,7 @@ bool ClangExpressionDeclMap::GetVariableValue(VariableSP &var,
|
||||
lldb_private::Value &var_location,
|
||||
TypeFromUser *user_type,
|
||||
TypeFromParser *parser_type) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
Type *var_type = var->GetType();
|
||||
|
||||
@ -1546,7 +1546,7 @@ void ClangExpressionDeclMap::AddOneVariable(NameSearchContext &context,
|
||||
ValueObjectSP valobj) {
|
||||
assert(m_parser_vars.get());
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
TypeFromUser ut;
|
||||
TypeFromParser pt;
|
||||
@ -1600,7 +1600,7 @@ void ClangExpressionDeclMap::AddOneVariable(NameSearchContext &context,
|
||||
|
||||
void ClangExpressionDeclMap::AddOneVariable(NameSearchContext &context,
|
||||
ExpressionVariableSP &pvar_sp) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
TypeFromUser user_type(
|
||||
llvm::cast<ClangExpressionVariable>(pvar_sp.get())->GetTypeFromUser());
|
||||
@ -1633,7 +1633,7 @@ void ClangExpressionDeclMap::AddOneGenericVariable(NameSearchContext &context,
|
||||
const Symbol &symbol) {
|
||||
assert(m_parser_vars.get());
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
Target *target = m_parser_vars->m_exe_ctx.GetTargetPtr();
|
||||
|
||||
@ -1683,7 +1683,7 @@ void ClangExpressionDeclMap::AddOneGenericVariable(NameSearchContext &context,
|
||||
|
||||
void ClangExpressionDeclMap::AddOneRegister(NameSearchContext &context,
|
||||
const RegisterInfo *reg_info) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
CompilerType clang_type =
|
||||
m_clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(
|
||||
@ -1725,7 +1725,7 @@ void ClangExpressionDeclMap::AddOneFunction(NameSearchContext &context,
|
||||
Symbol *symbol) {
|
||||
assert(m_parser_vars.get());
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
NamedDecl *function_decl = nullptr;
|
||||
Address fun_address;
|
||||
@ -1895,7 +1895,7 @@ void ClangExpressionDeclMap::AddContextClassType(NameSearchContext &context,
|
||||
const TypeFromUser &ut) {
|
||||
CompilerType copied_clang_type = GuardedCopyType(ut);
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (!copied_clang_type) {
|
||||
LLDB_LOG(log,
|
||||
@ -1961,7 +1961,7 @@ void ClangExpressionDeclMap::AddOneType(NameSearchContext &context,
|
||||
CompilerType copied_clang_type = GuardedCopyType(ut);
|
||||
|
||||
if (!copied_clang_type) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
LLDB_LOG(log,
|
||||
"ClangExpressionDeclMap::AddOneType - Couldn't import the type");
|
||||
|
@ -189,7 +189,7 @@ public:
|
||||
// when we move the expression result ot the ScratchASTContext). Let's at
|
||||
// least log these diagnostics until we find a way to properly render
|
||||
// them and display them to the user.
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
if (log) {
|
||||
llvm::SmallVector<char, 32> diag_str;
|
||||
Info.FormatDiagnostic(diag_str);
|
||||
@ -282,7 +282,7 @@ private:
|
||||
static void SetupModuleHeaderPaths(CompilerInstance *compiler,
|
||||
std::vector<std::string> include_directories,
|
||||
lldb::TargetSP target_sp) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
HeaderSearchOptions &search_opts = compiler->getHeaderSearchOpts();
|
||||
|
||||
@ -364,7 +364,7 @@ ClangExpressionParser::ClangExpressionParser(
|
||||
m_pp_callbacks(nullptr),
|
||||
m_include_directories(std::move(include_directories)),
|
||||
m_filename(std::move(filename)) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
// We can't compile expressions without a target. So if the exe_scope is
|
||||
// null or doesn't have a target, then we just need to get out of here. I'll
|
||||
@ -1325,7 +1325,7 @@ lldb_private::Status ClangExpressionParser::PrepareForExecution(
|
||||
bool &can_interpret, ExecutionPolicy execution_policy) {
|
||||
func_addr = LLDB_INVALID_ADDRESS;
|
||||
func_end = LLDB_INVALID_ADDRESS;
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
lldb_private::Status err;
|
||||
|
||||
|
@ -180,7 +180,7 @@ ClangFunctionCaller::CompileFunction(lldb::ThreadSP thread_to_use_sp,
|
||||
m_wrapper_function_text.append(args_list_buffer);
|
||||
m_wrapper_function_text.append(");\n}\n");
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
LLDB_LOGF(log, "Expression: \n\n%s\n\n", m_wrapper_function_text.c_str());
|
||||
|
||||
// Okay, now compile this expression
|
||||
|
@ -29,7 +29,7 @@ using namespace lldb_private;
|
||||
static bool VerifyClangPath(const llvm::Twine &clang_path) {
|
||||
if (FileSystem::Instance().IsDirectory(clang_path))
|
||||
return true;
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
LLDB_LOGF(log,
|
||||
"VerifyClangPath(): "
|
||||
"failed to stat clang resource directory at \"%s\"",
|
||||
@ -47,7 +47,7 @@ static bool VerifyClangPath(const llvm::Twine &clang_path) {
|
||||
static bool DefaultComputeClangResourceDirectory(FileSpec &lldb_shlib_spec,
|
||||
FileSpec &file_spec,
|
||||
bool verify) {
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
std::string raw_path = lldb_shlib_spec.GetPath();
|
||||
llvm::StringRef parent_dir = llvm::sys::path::parent_path(raw_path);
|
||||
|
||||
@ -157,7 +157,7 @@ FileSpec lldb_private::GetClangResourceDir() {
|
||||
if (FileSpec lldb_file_spec = HostInfo::GetShlibDir())
|
||||
ComputeClangResourceDirectory(lldb_file_spec, g_cached_resource_dir,
|
||||
true);
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
|
||||
Log *log = GetLog(LLDBLog::Host);
|
||||
LLDB_LOGF(log, "GetClangResourceDir() => '%s'",
|
||||
g_cached_resource_dir.GetPath().c_str());
|
||||
});
|
||||
|
@ -130,7 +130,7 @@ private:
|
||||
} // anonymous namespace
|
||||
|
||||
StoringDiagnosticConsumer::StoringDiagnosticConsumer() {
|
||||
m_log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
|
||||
m_log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
clang::DiagnosticOptions *m_options = new clang::DiagnosticOptions();
|
||||
m_os = std::make_shared<llvm::raw_string_ostream>(m_output);
|
||||
@ -656,7 +656,7 @@ ClangModulesDeclVendor::Create(Target &target) {
|
||||
for (const std::string &arg : compiler_invocation_arguments)
|
||||
compiler_invocation_argument_cstrs.push_back(arg.c_str());
|
||||
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
LLDB_LOG(log, "ClangModulesDeclVendor's compiler flags {0:$[ ]}",
|
||||
llvm::make_range(compiler_invocation_arguments.begin(),
|
||||
compiler_invocation_arguments.end()));
|
||||
|
@ -89,7 +89,7 @@ ClangUserExpression::ClangUserExpression(
|
||||
ClangUserExpression::~ClangUserExpression() = default;
|
||||
|
||||
void ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Status &err) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
LLDB_LOGF(log, "ClangUserExpression::ScanContext()");
|
||||
|
||||
@ -456,14 +456,14 @@ static bool SupportsCxxModuleImport(lldb::LanguageType language) {
|
||||
/// Utility method that puts a message into the expression log and
|
||||
/// returns an invalid module configuration.
|
||||
static CppModuleConfiguration LogConfigError(const std::string &msg) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
LLDB_LOG(log, "[C++ module config] {0}", msg);
|
||||
return CppModuleConfiguration();
|
||||
}
|
||||
|
||||
CppModuleConfiguration GetModuleConfig(lldb::LanguageType language,
|
||||
ExecutionContext &exe_ctx) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
// Don't do anything if this is not a C++ module configuration.
|
||||
if (!SupportsCxxModuleImport(language))
|
||||
@ -621,7 +621,7 @@ bool ClangUserExpression::TryParse(
|
||||
}
|
||||
|
||||
void ClangUserExpression::SetupCppModuleImports(ExecutionContext &exe_ctx) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
CppModuleConfiguration module_config = GetModuleConfig(m_language, exe_ctx);
|
||||
m_imported_cpp_modules = module_config.GetImportedModules();
|
||||
@ -647,7 +647,7 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
|
||||
lldb_private::ExecutionPolicy execution_policy,
|
||||
bool keep_result_in_memory,
|
||||
bool generate_debug_info) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
if (!PrepareForParsing(diagnostic_manager, exe_ctx, /*for_completion*/ false))
|
||||
return false;
|
||||
@ -806,7 +806,7 @@ static void AbsPosToLineColumnPos(size_t abs_pos, llvm::StringRef code,
|
||||
bool ClangUserExpression::Complete(ExecutionContext &exe_ctx,
|
||||
CompletionRequest &request,
|
||||
unsigned complete_pos) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
// We don't want any visible feedback when completing an expression. Mostly
|
||||
// because the results we get from an incomplete invocation are probably not
|
||||
|
@ -180,7 +180,7 @@ T *createDecl(ASTImporter &importer, Decl *from_d, Args &&... args) {
|
||||
}
|
||||
|
||||
llvm::Optional<Decl *> CxxModuleHandler::tryInstantiateStdTemplate(Decl *d) {
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
// If we don't have a template to instiantiate, then there is nothing to do.
|
||||
auto td = dyn_cast<ClassTemplateSpecializationDecl>(d);
|
||||
|
@ -316,7 +316,7 @@ public:
|
||||
|
||||
protected:
|
||||
bool InstrumentInstruction(llvm::Instruction *inst) override {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
LLDB_LOGF(log, "Instrumenting load/store instruction: %s\n",
|
||||
PrintValue(inst).c_str());
|
||||
@ -467,7 +467,7 @@ protected:
|
||||
}
|
||||
|
||||
bool InspectInstruction(llvm::Instruction &i) override {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
CallInst *call_inst = dyn_cast<CallInst>(&i);
|
||||
|
||||
@ -538,7 +538,7 @@ IRDynamicChecks::IRDynamicChecks(
|
||||
IRDynamicChecks::~IRDynamicChecks() = default;
|
||||
|
||||
bool IRDynamicChecks::runOnModule(llvm::Module &M) {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
llvm::Function *function = M.getFunction(StringRef(m_func_name));
|
||||
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <map>
|
||||
|
||||
using namespace llvm;
|
||||
using lldb_private::LLDBLog;
|
||||
|
||||
typedef SmallVector<Instruction *, 2> InstrList;
|
||||
|
||||
@ -158,8 +159,7 @@ static bool isGuardVariableSymbol(llvm::StringRef mangled_symbol,
|
||||
}
|
||||
|
||||
bool IRForTarget::CreateResultVariable(llvm::Function &llvm_function) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
if (!m_resolve_vars)
|
||||
return true;
|
||||
@ -399,8 +399,7 @@ bool IRForTarget::CreateResultVariable(llvm::Function &llvm_function) {
|
||||
|
||||
bool IRForTarget::RewriteObjCConstString(llvm::GlobalVariable *ns_str,
|
||||
llvm::GlobalVariable *cstr) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
Type *ns_str_ty = ns_str->getType();
|
||||
|
||||
@ -537,8 +536,7 @@ bool IRForTarget::RewriteObjCConstString(llvm::GlobalVariable *ns_str,
|
||||
}
|
||||
|
||||
bool IRForTarget::RewriteObjCConstStrings() {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
ValueSymbolTable &value_symbol_table = m_module->getValueSymbolTable();
|
||||
|
||||
@ -750,8 +748,7 @@ static bool IsObjCSelectorRef(Value *value) {
|
||||
|
||||
// This function does not report errors; its callers are responsible.
|
||||
bool IRForTarget::RewriteObjCSelector(Instruction *selector_load) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
LoadInst *load = dyn_cast<LoadInst>(selector_load);
|
||||
|
||||
@ -877,8 +874,7 @@ bool IRForTarget::RewriteObjCSelector(Instruction *selector_load) {
|
||||
}
|
||||
|
||||
bool IRForTarget::RewriteObjCSelectors(BasicBlock &basic_block) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
InstrList selector_loads;
|
||||
|
||||
@ -912,8 +908,7 @@ static bool IsObjCClassReference(Value *value) {
|
||||
|
||||
// This function does not report errors; its callers are responsible.
|
||||
bool IRForTarget::RewriteObjCClassReference(Instruction *class_load) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
LoadInst *load = dyn_cast<LoadInst>(class_load);
|
||||
|
||||
@ -1029,8 +1024,7 @@ bool IRForTarget::RewriteObjCClassReference(Instruction *class_load) {
|
||||
}
|
||||
|
||||
bool IRForTarget::RewriteObjCClassReferences(BasicBlock &basic_block) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
InstrList class_loads;
|
||||
|
||||
@ -1057,8 +1051,7 @@ bool IRForTarget::RewriteObjCClassReferences(BasicBlock &basic_block) {
|
||||
|
||||
// This function does not report errors; its callers are responsible.
|
||||
bool IRForTarget::RewritePersistentAlloc(llvm::Instruction *persistent_alloc) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
AllocaInst *alloc = dyn_cast<AllocaInst>(persistent_alloc);
|
||||
|
||||
@ -1129,8 +1122,7 @@ bool IRForTarget::RewritePersistentAllocs(llvm::BasicBlock &basic_block) {
|
||||
if (!m_resolve_vars)
|
||||
return true;
|
||||
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
InstrList pvar_allocs;
|
||||
|
||||
@ -1171,8 +1163,7 @@ bool IRForTarget::RewritePersistentAllocs(llvm::BasicBlock &basic_block) {
|
||||
|
||||
// This function does not report errors; its callers are responsible.
|
||||
bool IRForTarget::MaybeHandleVariable(Value *llvm_value_ptr) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
LLDB_LOG(log, "MaybeHandleVariable ({0})", PrintValue(llvm_value_ptr));
|
||||
|
||||
@ -1266,8 +1257,7 @@ bool IRForTarget::MaybeHandleVariable(Value *llvm_value_ptr) {
|
||||
|
||||
// This function does not report errors; its callers are responsible.
|
||||
bool IRForTarget::HandleSymbol(Value *symbol) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
lldb_private::ConstString name(symbol->getName().str().c_str());
|
||||
|
||||
@ -1298,8 +1288,7 @@ bool IRForTarget::HandleSymbol(Value *symbol) {
|
||||
}
|
||||
|
||||
bool IRForTarget::MaybeHandleCallArguments(CallInst *Old) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
LLDB_LOG(log, "MaybeHandleCallArguments({0})", PrintValue(Old));
|
||||
|
||||
@ -1317,8 +1306,7 @@ bool IRForTarget::MaybeHandleCallArguments(CallInst *Old) {
|
||||
}
|
||||
|
||||
bool IRForTarget::HandleObjCClass(Value *classlist_reference) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
GlobalVariable *global_variable =
|
||||
dyn_cast<GlobalVariable>(classlist_reference);
|
||||
@ -1419,8 +1407,7 @@ bool IRForTarget::ResolveCalls(BasicBlock &basic_block) {
|
||||
}
|
||||
|
||||
bool IRForTarget::ResolveExternals(Function &llvm_function) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
for (GlobalVariable &global_var : m_module->globals()) {
|
||||
llvm::StringRef global_name = global_var.getName();
|
||||
@ -1638,8 +1625,7 @@ bool IRForTarget::ReplaceVariables(Function &llvm_function) {
|
||||
if (!m_resolve_vars)
|
||||
return true;
|
||||
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
m_decl_map->DoStructLayout();
|
||||
|
||||
@ -1827,8 +1813,7 @@ bool IRForTarget::ReplaceVariables(Function &llvm_function) {
|
||||
}
|
||||
|
||||
bool IRForTarget::runOnModule(Module &llvm_module) {
|
||||
lldb_private::Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
lldb_private::Log *log(GetLog(LLDBLog::Expressions));
|
||||
|
||||
m_module = &llvm_module;
|
||||
m_target_data = std::make_unique<DataLayout>(m_module);
|
||||
|
@ -106,7 +106,7 @@ clang::NamedDecl *NameSearchContext::AddFunDecl(const CompilerType &type,
|
||||
|
||||
func_decl->setParams(ArrayRef<ParmVarDecl *>(parm_var_decls));
|
||||
} else {
|
||||
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
|
||||
Log *log = GetLog(LLDBLog::Expressions);
|
||||
|
||||
LLDB_LOG(log, "Function type wasn't a FunctionProtoType");
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ bool EmulateInstructionPPC64::EmulateMFSPR(uint32_t opcode) {
|
||||
if (rt != gpr_r0_ppc64le || spr != SPR_LR)
|
||||
return false;
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
|
||||
Log *log = GetLog(LLDBLog::Unwind);
|
||||
LLDB_LOG(log, "EmulateMFSPR: {0:X+8}: mfspr r0, lr", m_addr);
|
||||
|
||||
bool success;
|
||||
@ -237,7 +237,7 @@ bool EmulateInstructionPPC64::EmulateLD(uint32_t opcode) {
|
||||
if (ra != gpr_r1_ppc64le || rt != gpr_r1_ppc64le || ids != 0)
|
||||
return false;
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
|
||||
Log *log = GetLog(LLDBLog::Unwind);
|
||||
LLDB_LOG(log, "EmulateLD: {0:X+8}: ld r{1}, {2}(r{3})", m_addr, rt, ids, ra);
|
||||
|
||||
RegisterInfo r1_info;
|
||||
@ -274,7 +274,7 @@ bool EmulateInstructionPPC64::EmulateSTD(uint32_t opcode) {
|
||||
return false;
|
||||
|
||||
int32_t ids = llvm::SignExtend32<16>(ds << 2);
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
|
||||
Log *log = GetLog(LLDBLog::Unwind);
|
||||
LLDB_LOG(log, "EmulateSTD: {0:X+8}: std{1} r{2}, {3}(r{4})", m_addr,
|
||||
u ? "u" : "", rs, ids, ra);
|
||||
|
||||
@ -331,7 +331,7 @@ bool EmulateInstructionPPC64::EmulateOR(uint32_t opcode) {
|
||||
(ra != gpr_r30_ppc64le && ra != gpr_r31_ppc64le) || rb != gpr_r1_ppc64le)
|
||||
return false;
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
|
||||
Log *log = GetLog(LLDBLog::Unwind);
|
||||
LLDB_LOG(log, "EmulateOR: {0:X+8}: mr r{1}, r{2}", m_addr, ra, rb);
|
||||
|
||||
// set context
|
||||
@ -366,7 +366,7 @@ bool EmulateInstructionPPC64::EmulateADDI(uint32_t opcode) {
|
||||
return false;
|
||||
|
||||
int32_t si_val = llvm::SignExtend32<16>(si);
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
|
||||
Log *log = GetLog(LLDBLog::Unwind);
|
||||
LLDB_LOG(log, "EmulateADDI: {0:X+8}: addi r1, r1, {1}", m_addr, si_val);
|
||||
|
||||
// set context
|
||||
|
@ -186,7 +186,7 @@ void JITLoaderGDB::SetJITBreakpoint(lldb_private::ModuleList &module_list) {
|
||||
if (DidSetJITBreakpoint())
|
||||
return;
|
||||
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_JIT_LOADER));
|
||||
Log *log = GetLog(LLDBLog::JITLoader);
|
||||
LLDB_LOGF(log, "JITLoaderGDB::%s looking for JIT register hook",
|
||||
__FUNCTION__);
|
||||
|
||||
@ -218,7 +218,7 @@ bool JITLoaderGDB::JITDebugBreakpointHit(void *baton,
|
||||
StoppointCallbackContext *context,
|
||||
user_id_t break_id,
|
||||
user_id_t break_loc_id) {
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_JIT_LOADER));
|
||||
Log *log = GetLog(LLDBLog::JITLoader);
|
||||
LLDB_LOGF(log, "JITLoaderGDB::%s hit JIT breakpoint", __FUNCTION__);
|
||||
JITLoaderGDB *instance = static_cast<JITLoaderGDB *>(baton);
|
||||
return instance->ReadJITDescriptor(false);
|
||||
@ -282,7 +282,7 @@ bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entries) {
|
||||
if (m_jit_descriptor_addr == LLDB_INVALID_ADDRESS)
|
||||
return false;
|
||||
|
||||
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_JIT_LOADER));
|
||||
Log *log = GetLog(LLDBLog::JITLoader);
|
||||
Target &target = m_process->GetTarget();
|
||||
ModuleList &module_list = target.GetImages();
|
||||
|
||||
|
@ -43,9 +43,8 @@ public:
|
||||
auto type_system_or_err = target_sp->GetScratchTypeSystemForLanguage(
|
||||
lldb::eLanguageTypeC_plus_plus);
|
||||
if (auto err = type_system_or_err.takeError()) {
|
||||
LLDB_LOG_ERROR(
|
||||
lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS),
|
||||
std::move(err), "Failed to get scratch TypeSystemClang");
|
||||
LLDB_LOG_ERROR(GetLog(LLDBLog::DataFormatters), std::move(err),
|
||||
"Failed to get scratch TypeSystemClang");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -337,7 +337,7 @@ protected:
|
||||
}
|
||||
|
||||
ConstString substituteImpl(llvm::StringRef Mangled) {
|
||||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
|
||||
Log *log = GetLog(LLDBLog::Language);
|
||||
if (this->parse() == nullptr) {
|
||||
LLDB_LOG(log, "Failed to substitute mangling in {0}", Mangled);
|
||||
return ConstString();
|
||||
|
@ -426,7 +426,7 @@ bool lldb_private::formatters::NSNumberSummaryProvider(
|
||||
if (!process_sp)
|
||||
return false;
|
||||
|
||||
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS);
|
||||
Log *log = GetLog(LLDBLog::DataFormatters);
|
||||
ObjCLanguageRuntime *runtime = ObjCLanguageRuntime::Get(*process_sp);
|
||||
|
||||
if (!runtime)
|
||||
|
@ -76,8 +76,7 @@ TypeAndOrName ItaniumABILanguageRuntime::GetTypeInfoFromVTableAddress(
|
||||
const char *name =
|
||||
symbol->GetMangled().GetDemangledName().AsCString();
|
||||
if (name && strstr(name, vtable_demangled_prefix) == name) {
|
||||
Log *log(
|
||||
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT));
|
||||
Log *log = GetLog(LLDBLog::Object);
|
||||
LLDB_LOGF(log,
|
||||
"0x%16.16" PRIx64
|
||||
": static-type = '%s' has vtable symbol '%s'\n",
|
||||
|
@ -542,7 +542,7 @@ void ClassDescriptorV2::iVarsStorage::fill(AppleObjCRuntimeV2 &runtime,
|
||||
if (m_filled)
|
||||
return;
|
||||
std::lock_guard<std::recursive_mutex> guard(m_mutex);
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES));
|
||||
Log *log = GetLog(LLDBLog::Commands);
|
||||
LLDB_LOGV(log, "class_name = {0}", descriptor.GetClassName());
|
||||
m_filled = true;
|
||||
ObjCLanguageRuntime::EncodingToTypeSP encoding_to_type_sp(
|
||||
|
@ -31,8 +31,8 @@ public:
|
||||
bool FindExternalVisibleDeclsByName(const clang::DeclContext *decl_ctx,
|
||||
clang::DeclarationName name) override {
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(
|
||||
LIBLLDB_LOG_EXPRESSIONS)); // FIXME - a more appropriate log channel?
|
||||
Log *log(GetLog(
|
||||
LLDBLog::Expressions)); // FIXME - a more appropriate log channel?
|
||||
|
||||
if (log) {
|
||||
LLDB_LOGF(log,
|
||||
@ -68,8 +68,8 @@ public:
|
||||
|
||||
void CompleteType(clang::TagDecl *tag_decl) override {
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(
|
||||
LIBLLDB_LOG_EXPRESSIONS)); // FIXME - a more appropriate log channel?
|
||||
Log *log(GetLog(
|
||||
LLDBLog::Expressions)); // FIXME - a more appropriate log channel?
|
||||
|
||||
LLDB_LOGF(log,
|
||||
"AppleObjCExternalASTSource::CompleteType on "
|
||||
@ -84,8 +84,8 @@ public:
|
||||
|
||||
void CompleteType(clang::ObjCInterfaceDecl *interface_decl) override {
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(
|
||||
LIBLLDB_LOG_EXPRESSIONS)); // FIXME - a more appropriate log channel?
|
||||
Log *log(GetLog(
|
||||
LLDBLog::Expressions)); // FIXME - a more appropriate log channel?
|
||||
|
||||
if (log) {
|
||||
LLDB_LOGF(log,
|
||||
@ -394,8 +394,8 @@ private:
|
||||
};
|
||||
|
||||
bool AppleObjCDeclVendor::FinishDecl(clang::ObjCInterfaceDecl *interface_decl) {
|
||||
Log *log(GetLogIfAllCategoriesSet(
|
||||
LIBLLDB_LOG_EXPRESSIONS)); // FIXME - a more appropriate log channel?
|
||||
Log *log(
|
||||
GetLog(LLDBLog::Expressions)); // FIXME - a more appropriate log channel?
|
||||
|
||||
ClangASTMetadata *metadata = m_ast_ctx.GetMetadata(interface_decl);
|
||||
ObjCLanguageRuntime::ObjCISA objc_isa = 0;
|
||||
@ -525,8 +525,8 @@ uint32_t AppleObjCDeclVendor::FindDecls(ConstString name, bool append,
|
||||
uint32_t max_matches,
|
||||
std::vector<CompilerDecl> &decls) {
|
||||
|
||||
Log *log(GetLogIfAllCategoriesSet(
|
||||
LIBLLDB_LOG_EXPRESSIONS)); // FIXME - a more appropriate log channel?
|
||||
Log *log(
|
||||
GetLog(LLDBLog::Expressions)); // FIXME - a more appropriate log channel?
|
||||
|
||||
LLDB_LOGF(log, "AppleObjCDeclVendor::FindDecls ('%s', %s, %u, )",
|
||||
(const char *)name.AsCString(), append ? "true" : "false",
|
||||
|
@ -504,7 +504,7 @@ ValueObjectSP AppleObjCRuntime::GetExceptionObjectForThread(
|
||||
/// GetBacktraceThreadFromException.
|
||||
LLVM_NODISCARD
|
||||
static ThreadSP FailExceptionParsing(llvm::StringRef msg) {
|
||||
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
|
||||
Log *log = GetLog(LLDBLog::Language);
|
||||
LLDB_LOG(log, "Failed getting backtrace from exception: {0}", msg);
|
||||
return ThreadSP();
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user