From b5e5d8bd3074f4decc5e942291db5c004685c48d Mon Sep 17 00:00:00 2001 From: "altse@chromium.org" Date: Thu, 12 Dec 2013 19:58:00 +0000 Subject: Remove usage of gDebugLog and DEBUGLOG from Mac and iOS client code. The inconsistent and duplicated references to gDebugLog caused problems building on iOS and the current logging implementation had little utility because it was never activated in debug builds. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1257 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/mac/crash_generation/ConfigFile.mm | 22 ----------------- src/client/mac/crash_generation/Inspector.h | 4 --- src/client/mac/crash_generation/Inspector.mm | 35 ++++----------------------- 3 files changed, 5 insertions(+), 56 deletions(-) (limited to 'src/client/mac/crash_generation') diff --git a/src/client/mac/crash_generation/ConfigFile.mm b/src/client/mac/crash_generation/ConfigFile.mm index 7ff25378..dbb0f24d 100644 --- a/src/client/mac/crash_generation/ConfigFile.mm +++ b/src/client/mac/crash_generation/ConfigFile.mm @@ -38,15 +38,6 @@ #import "client/apple/Framework/BreakpadDefines.h" #import "GTMDefines.h" -#define VERBOSE 0 - -#if VERBOSE - bool gDebugLog = true; -#else - bool gDebugLog = false; -#endif - -#define DEBUGLOG if (gDebugLog) fprintf namespace google_breakpad { @@ -77,13 +68,10 @@ BOOL ConfigFile::AppendConfigData(const char *key, assert(config_file_ != -1); if (!key) { - DEBUGLOG(stderr, "Breakpad: Missing Key\n"); return NO; } if (!data) { - DEBUGLOG(stderr, "Breakpad: Missing data for key: %s\n", key ? key : - ""); return NO; } @@ -147,14 +135,8 @@ void ConfigFile::WriteFile(const char* directory, config_file_ = mkstemp(config_file_path_); if (config_file_ == -1) { - DEBUGLOG(stderr, - "mkstemp(config_file_path_) == -1 (%s)\n", - strerror(errno)); return; } - else { - DEBUGLOG(stderr, "Writing config file to (%s)\n", config_file_path_); - } has_created_file_ = true; @@ -170,10 +152,6 @@ void ConfigFile::WriteFile(const char* directory, SimpleStringDictionary::Iterator iter(dictionary); while ((entry = iter.Next())) { - DEBUGLOG(stderr, - "config: (%s) -> (%s)\n", - entry->key, - entry->value); result = AppendConfigString(entry->key, entry->value); if (!result) diff --git a/src/client/mac/crash_generation/Inspector.h b/src/client/mac/crash_generation/Inspector.h index 4fb62f6b..7e2eec80 100644 --- a/src/client/mac/crash_generation/Inspector.h +++ b/src/client/mac/crash_generation/Inspector.h @@ -38,9 +38,6 @@ #import "client/mac/crash_generation/ConfigFile.h" #import "client/mac/handler/minidump_generator.h" -extern bool gDebugLog; - -#define DEBUGLOG if (gDebugLog) fprintf // Types of mach messsages (message IDs) enum { @@ -87,7 +84,6 @@ class MinidumpLocation { // Ensure that the path exists. Fallback to /tmp if unable to locate path. assert(minidumpDir); if (!EnsureDirectoryPathExists(minidumpDir)) { - DEBUGLOG(stderr, "Unable to create: %s\n", [minidumpDir UTF8String]); minidumpDir = @"/tmp"; } diff --git a/src/client/mac/crash_generation/Inspector.mm b/src/client/mac/crash_generation/Inspector.mm index c6259121..d226ca38 100644 --- a/src/client/mac/crash_generation/Inspector.mm +++ b/src/client/mac/crash_generation/Inspector.mm @@ -252,8 +252,6 @@ kern_return_t Inspector::ReadMessages() { } } if (parameters_read != info.parameter_count) { - DEBUGLOG(stderr, "Only read %d parameters instead of %d, aborting crash " - "dump generation.", parameters_read, info.parameter_count); return KERN_FAILURE; } } @@ -265,7 +263,6 @@ kern_return_t Inspector::ReadMessages() { bool Inspector::InspectTask() { // keep the task quiet while we're looking at it task_suspend(remote_task_); - DEBUGLOG(stderr, "Suspended Remote task\n"); NSString *minidumpDir; @@ -282,11 +279,11 @@ bool Inspector::InspectTask() { NSString *applicationSupportDirectory = [libraryDirectories objectAtIndex:0]; - NSString *library_subdirectory = [NSString + NSString *library_subdirectory = [NSString stringWithUTF8String:kDefaultLibrarySubdirectory]; - NSString *breakpad_product = [NSString + NSString *breakpad_product = [NSString stringWithUTF8String:config_params_.GetValueForKey(BREAKPAD_PRODUCT)]; - + NSArray *path_components = [NSArray arrayWithObjects:applicationSupportDirectory, library_subdirectory, @@ -298,9 +295,6 @@ bool Inspector::InspectTask() { minidumpDir = [[NSString stringWithUTF8String:minidumpDirectory] stringByExpandingTildeInPath]; } - DEBUGLOG(stderr, - "Writing minidump to directory (%s)\n", - [minidumpDir UTF8String]); MinidumpLocation minidumpLocation(minidumpDir); @@ -314,13 +308,8 @@ bool Inspector::InspectTask() { NSString *pathid_ns = [NSString stringWithUTF8String:minidumpLocation.GetID()]; NSString *minidumpPath = [path_ns stringByAppendingPathComponent:pathid_ns]; - minidumpPath = [minidumpPath + minidumpPath = [minidumpPath stringByAppendingPathExtension:@"dmp"]; - - DEBUGLOG(stderr, - "minidump path (%s)\n", - [minidumpPath UTF8String]); - config_file_.WriteFile( 0, &config_params_, @@ -340,15 +329,8 @@ bool Inspector::InspectTask() { bool result = generator.Write([minidumpPath fileSystemRepresentation]); - if (result) { - DEBUGLOG(stderr, "Wrote minidump - OK\n"); - } else { - DEBUGLOG(stderr, "Error writing minidump - errno=%s\n", strerror(errno)); - } - // let the task continue task_resume(remote_task_); - DEBUGLOG(stderr, "Resumed remote task\n"); return result; } @@ -361,9 +343,6 @@ kern_return_t Inspector::SendAcknowledgement() { MachPortSender sender(ack_port_); MachSendMessage ack_message(kMsgType_InspectorAcknowledgement); - DEBUGLOG(stderr, "Inspector: trying to send acknowledgement to port %d\n", - ack_port_); - kern_return_t result = sender.SendMessage(ack_message, 2000); #if VERBOSE @@ -373,7 +352,6 @@ kern_return_t Inspector::SendAcknowledgement() { return result; } - DEBUGLOG(stderr, "Inspector: port translation failure!\n"); return KERN_INVALID_NAME; } @@ -382,7 +360,6 @@ void Inspector::LaunchReporter(const char *inConfigFilePath) { // Extract the path to the reporter executable. const char *reporterExecutablePath = config_params_.GetValueForKey(BREAKPAD_REPORTER_EXE_LOCATION); - DEBUGLOG(stderr, "reporter path = %s\n", reporterExecutablePath); // Setup and launch the crash dump sender. const char *argv[3]; @@ -398,7 +375,6 @@ void Inspector::LaunchReporter(const char *inConfigFilePath) { if (pid == 0) { execv(argv[0], (char * const *)argv); config_file_.Unlink(); // launch failed - get rid of config file - DEBUGLOG(stderr, "Inspector: unable to launch reporter app\n"); _exit(1); } @@ -416,8 +392,7 @@ void Inspector::LaunchReporter(const char *inConfigFilePath) { // The child has not yet finished. sleep(1); } else if (result == -1) { - DEBUGLOG(stderr, "Inspector: waitpid error (%d) waiting for reporter app\n", - errno); + // error occurred. break; } else { // child has finished -- cgit v1.2.1