diff options
Diffstat (limited to 'lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp')
-rw-r--r-- | lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp | 62 |
1 files changed, 29 insertions, 33 deletions
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp index 12fad7f561b..ef1ea9bd1e5 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp @@ -154,24 +154,23 @@ lldb::addr_t AppleGetPendingItemsHandler::SetupGetPendingItemsFunction( g_get_pending_items_function_code, eLanguageTypeObjC, g_get_pending_items_function_name, error)); if (error.Fail()) { - if (log) - log->Printf("Failed to get UtilityFunction for pending-items " - "introspection: %s.", - error.AsCString()); + LLDB_LOGF(log, + "Failed to get UtilityFunction for pending-items " + "introspection: %s.", + error.AsCString()); return args_addr; } if (!m_get_pending_items_impl_code->Install(diagnostics, exe_ctx)) { if (log) { - log->Printf("Failed to install pending-items introspection."); + LLDB_LOGF(log, "Failed to install pending-items introspection."); diagnostics.Dump(log); } m_get_pending_items_impl_code.reset(); return args_addr; } } else { - if (log) - log->Printf("No pending-items introspection code found."); + LLDB_LOGF(log, "No pending-items introspection code found."); return LLDB_INVALID_ADDRESS; } @@ -186,10 +185,10 @@ lldb::addr_t AppleGetPendingItemsHandler::SetupGetPendingItemsFunction( get_pending_items_return_type, get_pending_items_arglist, thread_sp, error); if (error.Fail() || get_pending_items_caller == nullptr) { - if (log) - log->Printf("Failed to install pending-items introspection function " - "caller: %s.", - error.AsCString()); + LLDB_LOGF(log, + "Failed to install pending-items introspection function " + "caller: %s.", + error.AsCString()); m_get_pending_items_impl_code.reset(); return args_addr; } @@ -199,8 +198,7 @@ lldb::addr_t AppleGetPendingItemsHandler::SetupGetPendingItemsFunction( diagnostics.Clear(); if (get_pending_items_caller == nullptr) { - if (log) - log->Printf("Failed to get get_pending_items_caller."); + LLDB_LOGF(log, "Failed to get get_pending_items_caller."); return LLDB_INVALID_ADDRESS; } @@ -212,7 +210,7 @@ lldb::addr_t AppleGetPendingItemsHandler::SetupGetPendingItemsFunction( if (!get_pending_items_caller->WriteFunctionArguments( exe_ctx, args_addr, get_pending_items_arglist, diagnostics)) { if (log) { - log->Printf("Error writing pending-items function arguments."); + LLDB_LOGF(log, "Error writing pending-items function arguments."); diagnostics.Dump(log); } @@ -241,9 +239,8 @@ AppleGetPendingItemsHandler::GetPendingItems(Thread &thread, addr_t queue, 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; } @@ -303,9 +300,8 @@ AppleGetPendingItemsHandler::GetPendingItems(Thread &thread, addr_t queue, 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_pending_items_return_buffer_addr = bufaddr; @@ -358,11 +354,11 @@ AppleGetPendingItemsHandler::GetPendingItems(Thread &thread, addr_t queue, func_call_ret = get_pending_items_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_get_pending_items(), got " - "ExpressionResults %d, error contains %s", - func_call_ret, error.AsCString("")); + LLDB_LOGF(log, + "Unable to call " + "__introspection_dispatch_queue_get_pending_items(), got " + "ExpressionResults %d, error contains %s", + func_call_ret, error.AsCString("")); error.SetErrorString("Unable to call " "__introspection_dispatch_queue_get_pending_items() " "for list of queues"); @@ -392,14 +388,14 @@ AppleGetPendingItemsHandler::GetPendingItems(Thread &thread, addr_t queue, return return_value; } - if (log) - log->Printf("AppleGetPendingItemsHandler called " - "__introspection_dispatch_queue_get_pending_items " - "(page_to_free == 0x%" PRIx64 ", size = %" PRId64 - "), returned page is at 0x%" PRIx64 ", size %" PRId64 - ", count = %" PRId64, - page_to_free, page_to_free_size, return_value.items_buffer_ptr, - return_value.items_buffer_size, return_value.count); + LLDB_LOGF(log, + "AppleGetPendingItemsHandler called " + "__introspection_dispatch_queue_get_pending_items " + "(page_to_free == 0x%" PRIx64 ", size = %" PRId64 + "), returned page is at 0x%" PRIx64 ", size %" PRId64 + ", count = %" PRId64, + page_to_free, page_to_free_size, return_value.items_buffer_ptr, + return_value.items_buffer_size, return_value.count); return return_value; } |