From 5034102b249f850109ccd7b2c8a02a246edcd95a Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Tue, 5 May 2020 15:48:46 -0700 Subject: [PATCH] Log the NSError str and object description on app launch fail Update CallBoardSystemServiceOpenApplication to unconditionally log the NSError's localizedDescription to Console on app launch failure (as it was already doing), and also to log the NSError object's full description to the console, which may contain additional nested error messages. I'm experimenting to find cases where we will get more detailed information from app launch failures and will start by logging both to the console. --- lldb/tools/debugserver/source/MacOSX/MachProcess.mm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm index c862de9738299..032f2a8779037 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm +++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm @@ -164,16 +164,18 @@ static bool CallBoardSystemServiceOpenApplication(NSString *bundleIDNSStr, [(NSString *)[bks_error localizedDescription] UTF8String]; if (error_str) { open_app_error_string = error_str; + DNBLogError("In app launch attempt, got error " + "localizedDescription '%s'.", error_str); + const char *obj_desc = + [NSString stringWithFormat:@"%@", bks_error].UTF8String; + DNBLogError("In app launch attempt, got error " + "NSError object description: '%s'.", + obj_desc); } DNBLogThreadedIf(LOG_PROCESS, "In completion handler for send " "event, got error \"%s\"(%ld).", error_str ? error_str : "", open_app_error); - // REMOVE ME - DNBLogError("In completion handler for send event, got error " - "\"%s\"(%ld).", - error_str ? error_str : "", - open_app_error); } [system_service release];