diff options
Diffstat (limited to 'lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp')
-rw-r--r-- | lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp | 59 |
1 files changed, 26 insertions, 33 deletions
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp index c97eb98557a..63600b31928 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp @@ -150,23 +150,21 @@ lldb::addr_t AppleGetItemInfoHandler::SetupGetItemInfoFunction( g_get_item_info_function_code, eLanguageTypeObjC, g_get_item_info_function_name, error)); if (error.Fail()) { - if (log) - log->Printf("Failed to get utility function: %s.", - error.AsCString()); + LLDB_LOGF(log, "Failed to get utility function: %s.", + error.AsCString()); return args_addr; } if (!m_get_item_info_impl_code->Install(diagnostics, exe_ctx)) { if (log) { - log->Printf("Failed to install get-item-info introspection."); + LLDB_LOGF(log, "Failed to install get-item-info introspection."); diagnostics.Dump(log); } m_get_item_info_impl_code.reset(); return args_addr; } } else { - if (log) - log->Printf("No get-item-info introspection code found."); + LLDB_LOGF(log, "No get-item-info introspection code found."); return LLDB_INVALID_ADDRESS; } @@ -183,17 +181,15 @@ lldb::addr_t AppleGetItemInfoHandler::SetupGetItemInfoFunction( get_item_info_return_type, get_item_info_arglist, thread.shared_from_this(), error); if (error.Fail() || get_item_info_caller == nullptr) { - if (log) - log->Printf("Error Inserting get-item-info function: \"%s\".", - error.AsCString()); + LLDB_LOGF(log, "Error Inserting get-item-info function: \"%s\".", + error.AsCString()); return args_addr; } } else { // If it's already made, then we can just retrieve the caller: get_item_info_caller = m_get_item_info_impl_code->GetFunctionCaller(); if (!get_item_info_caller) { - if (log) - log->Printf("Failed to get get-item-info introspection caller."); + LLDB_LOGF(log, "Failed to get get-item-info introspection caller."); m_get_item_info_impl_code.reset(); return args_addr; } @@ -210,7 +206,7 @@ lldb::addr_t AppleGetItemInfoHandler::SetupGetItemInfoFunction( if (!get_item_info_caller->WriteFunctionArguments( exe_ctx, args_addr, get_item_info_arglist, diagnostics)) { if (log) { - log->Printf("Error writing get-item-info function arguments."); + LLDB_LOGF(log, "Error writing get-item-info function arguments."); diagnostics.Dump(log); } @@ -238,9 +234,8 @@ AppleGetItemInfoHandler::GetItemInfo(Thread &thread, uint64_t item, error.Clear(); if (!thread.SafeToCallFunctions()) { - if (log) - log->Printf("Not safe to call functions on thread 0x%" PRIx64, - thread.GetID()); + LLDB_LOGF(log, "Not safe to call functions on thread 0x%" PRIx64, + thread.GetID()); error.SetErrorString("Not safe to call functions on this thread."); return return_value; } @@ -297,9 +292,8 @@ AppleGetItemInfoHandler::GetItemInfo(Thread &thread, uint64_t item, addr_t bufaddr = process_sp->AllocateMemory( 32, ePermissionsReadable | ePermissionsWritable, error); if (!error.Success() || bufaddr == LLDB_INVALID_ADDRESS) { - if (log) - log->Printf("Failed to allocate memory for return buffer for get " - "current queues func call"); + LLDB_LOGF(log, "Failed to allocate memory for return buffer for get " + "current queues func call"); return return_value; } m_get_item_info_return_buffer_addr = bufaddr; @@ -348,9 +342,8 @@ AppleGetItemInfoHandler::GetItemInfo(Thread &thread, uint64_t item, Value results; FunctionCaller *func_caller = m_get_item_info_impl_code->GetFunctionCaller(); if (!func_caller) { - if (log) - log->Printf("Could not retrieve function caller for " - "__introspection_dispatch_queue_item_get_info."); + LLDB_LOGF(log, "Could not retrieve function caller for " + "__introspection_dispatch_queue_item_get_info."); error.SetErrorString("Could not retrieve function caller for " "__introspection_dispatch_queue_item_get_info."); return return_value; @@ -359,11 +352,11 @@ AppleGetItemInfoHandler::GetItemInfo(Thread &thread, uint64_t item, func_call_ret = func_caller->ExecuteFunction(exe_ctx, &args_addr, options, diagnostics, results); if (func_call_ret != eExpressionCompleted || !error.Success()) { - if (log) - log->Printf("Unable to call " - "__introspection_dispatch_queue_item_get_info(), got " - "ExpressionResults %d, error contains %s", - func_call_ret, error.AsCString("")); + LLDB_LOGF(log, + "Unable to call " + "__introspection_dispatch_queue_item_get_info(), got " + "ExpressionResults %d, error contains %s", + func_call_ret, error.AsCString("")); error.SetErrorString("Unable to call " "__introspection_dispatch_queue_get_item_info() for " "list of queues"); @@ -385,13 +378,13 @@ AppleGetItemInfoHandler::GetItemInfo(Thread &thread, uint64_t item, return_value.item_buffer_ptr = LLDB_INVALID_ADDRESS; return return_value; } - if (log) - log->Printf("AppleGetItemInfoHandler called " - "__introspection_dispatch_queue_item_get_info (page_to_free == " - "0x%" PRIx64 ", size = %" PRId64 - "), returned page is at 0x%" PRIx64 ", size %" PRId64, - page_to_free, page_to_free_size, return_value.item_buffer_ptr, - return_value.item_buffer_size); + LLDB_LOGF(log, + "AppleGetItemInfoHandler called " + "__introspection_dispatch_queue_item_get_info (page_to_free == " + "0x%" PRIx64 ", size = %" PRId64 "), returned page is at 0x%" PRIx64 + ", size %" PRId64, + page_to_free, page_to_free_size, return_value.item_buffer_ptr, + return_value.item_buffer_size); return return_value; } |