diff options
author | Mike Frysinger <vapier@chromium.org> | 2020-06-23 18:55:43 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@chromium.org> | 2020-07-15 06:20:02 +0000 |
commit | 09b056975dacd1f0f815ad820b6dc9913b0118a3 (patch) | |
tree | 67ba67549b44e6d98b9ff2dfb3e0396e0a252b96 /src/client/mac/crash_generation | |
parent | Add support for dwarf5 line tables. (diff) | |
download | breakpad-09b056975dacd1f0f815ad820b6dc9913b0118a3.tar.xz |
fix pointer style to match the style guide
We do this in a lot of places, but we're inconsistent.
Normalize the code to the Google C++ style guide.
Change-Id: Ic2aceab661ce8f6b993dda21b1cdf5d2198dcbbf
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2262932
Reviewed-by: Sterling Augustine <saugustine@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Diffstat (limited to 'src/client/mac/crash_generation')
-rw-r--r-- | src/client/mac/crash_generation/ConfigFile.h | 22 | ||||
-rw-r--r-- | src/client/mac/crash_generation/ConfigFile.mm | 28 | ||||
-rw-r--r-- | src/client/mac/crash_generation/Inspector.h | 14 | ||||
-rw-r--r-- | src/client/mac/crash_generation/Inspector.mm | 30 | ||||
-rw-r--r-- | src/client/mac/crash_generation/crash_generation_server.cc | 16 | ||||
-rw-r--r-- | src/client/mac/crash_generation/crash_generation_server.h | 32 |
6 files changed, 71 insertions, 71 deletions
diff --git a/src/client/mac/crash_generation/ConfigFile.h b/src/client/mac/crash_generation/ConfigFile.h index f2da7c24..11bc2e43 100644 --- a/src/client/mac/crash_generation/ConfigFile.h +++ b/src/client/mac/crash_generation/ConfigFile.h @@ -35,7 +35,7 @@ namespace google_breakpad { -BOOL EnsureDirectoryPathExists(NSString *dirPath); +BOOL EnsureDirectoryPathExists(NSString* dirPath); //============================================================================= class ConfigFile { @@ -50,11 +50,11 @@ class ConfigFile { } void WriteFile(const char* directory, - const SimpleStringDictionary *configurationParameters, - const char *dump_dir, - const char *minidump_id); + const SimpleStringDictionary* configurationParameters, + const char* dump_dir, + const char* minidump_id); - const char *GetFilePath() { return config_file_path_; } + const char* GetFilePath() { return config_file_path_; } void Unlink() { if (config_file_ != -1) @@ -64,16 +64,16 @@ class ConfigFile { } private: - BOOL WriteData(const void *data, size_t length); + BOOL WriteData(const void* data, size_t length); - BOOL AppendConfigData(const char *key, - const void *data, + BOOL AppendConfigData(const char* key, + const void* data, size_t length); - BOOL AppendConfigString(const char *key, - const char *value); + BOOL AppendConfigString(const char* key, + const char* value); - BOOL AppendCrashTimeParameters(const char *processStartTimeString); + BOOL AppendCrashTimeParameters(const char* processStartTimeString); int config_file_; // descriptor for config file char config_file_path_[PATH_MAX]; // Path to configuration file diff --git a/src/client/mac/crash_generation/ConfigFile.mm b/src/client/mac/crash_generation/ConfigFile.mm index acab7de8..57d07590 100644 --- a/src/client/mac/crash_generation/ConfigFile.mm +++ b/src/client/mac/crash_generation/ConfigFile.mm @@ -42,10 +42,10 @@ namespace google_breakpad { //============================================================================= -BOOL EnsureDirectoryPathExists(NSString *dirPath) { - NSFileManager *mgr = [NSFileManager defaultManager]; +BOOL EnsureDirectoryPathExists(NSString* dirPath) { + NSFileManager* mgr = [NSFileManager defaultManager]; - NSDictionary *attrs = + NSDictionary* attrs = [NSDictionary dictionaryWithObject:[NSNumber numberWithUnsignedLong:0750] forKey:NSFilePosixPermissions]; @@ -56,15 +56,15 @@ BOOL EnsureDirectoryPathExists(NSString *dirPath) { } //============================================================================= -BOOL ConfigFile::WriteData(const void *data, size_t length) { +BOOL ConfigFile::WriteData(const void* data, size_t length) { size_t result = write(config_file_, data, length); return result == length; } //============================================================================= -BOOL ConfigFile::AppendConfigData(const char *key, - const void *data, size_t length) { +BOOL ConfigFile::AppendConfigData(const char* key, + const void* data, size_t length) { assert(config_file_ != -1); if (!key) { @@ -88,13 +88,13 @@ BOOL ConfigFile::AppendConfigData(const char *key, } //============================================================================= -BOOL ConfigFile::AppendConfigString(const char *key, - const char *value) { +BOOL ConfigFile::AppendConfigString(const char* key, + const char* value) { return AppendConfigData(key, value, strlen(value)); } //============================================================================= -BOOL ConfigFile::AppendCrashTimeParameters(const char *processStartTimeString) { +BOOL ConfigFile::AppendCrashTimeParameters(const char* processStartTimeString) { // Set process uptime parameter struct timeval tv; gettimeofday(&tv, NULL); @@ -118,9 +118,9 @@ BOOL ConfigFile::AppendCrashTimeParameters(const char *processStartTimeString) { //============================================================================= void ConfigFile::WriteFile(const char* directory, - const SimpleStringDictionary *configurationParameters, - const char *dump_dir, - const char *minidump_id) { + const SimpleStringDictionary* configurationParameters, + const char* dump_dir, + const char* minidump_id) { assert(config_file_ == -1); @@ -146,9 +146,9 @@ void ConfigFile::WriteFile(const char* directory, // Write out the configuration parameters BOOL result = YES; - const SimpleStringDictionary &dictionary = *configurationParameters; + const SimpleStringDictionary& dictionary = *configurationParameters; - const SimpleStringDictionary::Entry *entry = NULL; + const SimpleStringDictionary::Entry* entry = NULL; SimpleStringDictionary::Iterator iter(dictionary); while ((entry = iter.Next())) { diff --git a/src/client/mac/crash_generation/Inspector.h b/src/client/mac/crash_generation/Inspector.h index 7f923ed6..c9671136 100644 --- a/src/client/mac/crash_generation/Inspector.h +++ b/src/client/mac/crash_generation/Inspector.h @@ -63,7 +63,7 @@ struct KeyValueMessageData { public: KeyValueMessageData() {} explicit KeyValueMessageData( - const google_breakpad::SimpleStringDictionary::Entry &inEntry) { + const google_breakpad::SimpleStringDictionary::Entry& inEntry) { strlcpy(key, inEntry.key, sizeof(key) ); strlcpy(value, inEntry.value, sizeof(value) ); } @@ -80,7 +80,7 @@ namespace google_breakpad { //============================================================================= class MinidumpLocation { public: - MinidumpLocation(NSString *minidumpDir) { + MinidumpLocation(NSString* minidumpDir) { // Ensure that the path exists. Fallback to /tmp if unable to locate path. assert(minidumpDir); if (!EnsureDirectoryPathExists(minidumpDir)) { @@ -100,8 +100,8 @@ class MinidumpLocation { strlcpy(minidump_id_, next_minidump_id.c_str(), sizeof(minidump_id_)); } - const char *GetPath() { return minidump_dir_path_; } - const char *GetID() { return minidump_id_; } + const char* GetPath() { return minidump_dir_path_; } + const char* GetID() { return minidump_id_; } private: char minidump_dir_path_[PATH_MAX]; // Path to minidump directory @@ -116,7 +116,7 @@ class Inspector { // given a bootstrap service name, receives mach messages // from a crashed process, then inspects it, creates a minidump file // and asks the user if he wants to upload it to a server. - void Inspect(const char *receive_port_name); + void Inspect(const char* receive_port_name); private: // The Inspector is invoked with its bootstrap port set to the bootstrap @@ -131,8 +131,8 @@ class Inspector { // ServiceCheckOut. kern_return_t ResetBootstrapPort(); - kern_return_t ServiceCheckIn(const char *receive_port_name); - kern_return_t ServiceCheckOut(const char *receive_port_name); + kern_return_t ServiceCheckIn(const char* receive_port_name); + kern_return_t ServiceCheckOut(const char* receive_port_name); kern_return_t ReadMessages(); diff --git a/src/client/mac/crash_generation/Inspector.mm b/src/client/mac/crash_generation/Inspector.mm index dc6f4808..d5fc29e0 100644 --- a/src/client/mac/crash_generation/Inspector.mm +++ b/src/client/mac/crash_generation/Inspector.mm @@ -52,7 +52,7 @@ namespace google_breakpad { //============================================================================= -void Inspector::Inspect(const char *receive_port_name) { +void Inspector::Inspect(const char* receive_port_name) { kern_return_t result = ResetBootstrapPort(); if (result != KERN_SUCCESS) { return; @@ -143,7 +143,7 @@ kern_return_t Inspector::ResetBootstrapPort() { } //============================================================================= -kern_return_t Inspector::ServiceCheckIn(const char *receive_port_name) { +kern_return_t Inspector::ServiceCheckIn(const char* receive_port_name) { // We need to get the mach port representing this service, so we can // get information from the crashed process. kern_return_t kr = bootstrap_check_in(bootstrap_subset_port_, @@ -160,7 +160,7 @@ kern_return_t Inspector::ServiceCheckIn(const char *receive_port_name) { } //============================================================================= -kern_return_t Inspector::ServiceCheckOut(const char *receive_port_name) { +kern_return_t Inspector::ServiceCheckOut(const char* receive_port_name) { // We're done receiving mach messages from the crashed process, // so clean up a bit. kern_return_t kr; @@ -198,7 +198,7 @@ kern_return_t Inspector::ReadMessages() { kern_return_t result = receive_port.WaitForMessage(&message, 1000); if (result == KERN_SUCCESS) { - InspectorInfo &info = (InspectorInfo &)*message.GetData(); + InspectorInfo& info = (InspectorInfo&)*message.GetData(); exception_type_ = info.exception_type; exception_code_ = info.exception_code; exception_subcode_ = info.exception_subcode; @@ -237,7 +237,7 @@ kern_return_t Inspector::ReadMessages() { result = receive_port.WaitForMessage(¶meter_message, 1000); if(result == KERN_SUCCESS) { - KeyValueMessageData &key_value_data = + KeyValueMessageData& key_value_data = (KeyValueMessageData&)*parameter_message.GetData(); // If we get a blank key, make sure we don't increment the // parameter count; in some cases (notably on-demand generation @@ -267,27 +267,27 @@ bool Inspector::InspectTask() { // keep the task quiet while we're looking at it task_suspend(remote_task_); - NSString *minidumpDir; + NSString* minidumpDir; - const char *minidumpDirectory = + const char* minidumpDirectory = config_params_.GetValueForKey(BREAKPAD_DUMP_DIRECTORY); // If the client app has not specified a minidump directory, // use a default of Library/<kDefaultLibrarySubdirectory>/<Product Name> if (!minidumpDirectory || 0 == strlen(minidumpDirectory)) { - NSArray *libraryDirectories = + NSArray* libraryDirectories = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); - NSString *applicationSupportDirectory = + 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 + NSArray* path_components = [NSArray arrayWithObjects:applicationSupportDirectory, library_subdirectory, breakpad_product, @@ -306,11 +306,11 @@ bool Inspector::InspectTask() { // assumes system encoding and in RTL locales will prepend an LTR override // character for paths beginning with '/' which fileSystemRepresentation does // not remove. Filed as rdar://6889706 . - NSString *path_ns = [NSString + NSString* path_ns = [NSString stringWithUTF8String:minidumpLocation.GetPath()]; - NSString *pathid_ns = [NSString + NSString* pathid_ns = [NSString stringWithUTF8String:minidumpLocation.GetID()]; - NSString *minidumpPath = [path_ns stringByAppendingPathComponent:pathid_ns]; + NSString* minidumpPath = [path_ns stringByAppendingPathComponent:pathid_ns]; minidumpPath = [minidumpPath stringByAppendingPathExtension:@"dmp"]; diff --git a/src/client/mac/crash_generation/crash_generation_server.cc b/src/client/mac/crash_generation/crash_generation_server.cc index 451e8d9c..ae44e8bf 100644 --- a/src/client/mac/crash_generation/crash_generation_server.cc +++ b/src/client/mac/crash_generation/crash_generation_server.cc @@ -38,15 +38,15 @@ namespace google_breakpad { CrashGenerationServer::CrashGenerationServer( - const char *mach_port_name, + const char* mach_port_name, FilterCallback filter, - void *filter_context, + void* filter_context, OnClientDumpRequestCallback dump_callback, - void *dump_context, + void* dump_context, OnClientExitingCallback exit_callback, - void *exit_context, + void* exit_context, bool generate_dumps, - const std::string &dump_path) + const std::string& dump_path) : filter_(filter), filter_context_(filter_context), dump_callback_(dump_callback), @@ -90,8 +90,8 @@ bool CrashGenerationServer::Stop() { } // static -void *CrashGenerationServer::WaitForMessages(void *server) { - CrashGenerationServer *self = +void* CrashGenerationServer::WaitForMessages(void* server) { + CrashGenerationServer* self = reinterpret_cast<CrashGenerationServer*>(server); while (self->WaitForOneMessage()) {} return NULL; @@ -104,7 +104,7 @@ bool CrashGenerationServer::WaitForOneMessage() { if (result == KERN_SUCCESS) { switch (message.GetMessageID()) { case kDumpRequestMessage: { - ExceptionInfo &info = (ExceptionInfo &)*message.GetData(); + ExceptionInfo& info = (ExceptionInfo&)*message.GetData(); mach_port_t remote_task = message.GetTranslatedPort(0); mach_port_t crashing_thread = message.GetTranslatedPort(1); diff --git a/src/client/mac/crash_generation/crash_generation_server.h b/src/client/mac/crash_generation/crash_generation_server.h index 85bd5b5e..82fef146 100644 --- a/src/client/mac/crash_generation/crash_generation_server.h +++ b/src/client/mac/crash_generation/crash_generation_server.h @@ -59,14 +59,14 @@ class CrashGenerationServer { // WARNING: callbacks may be invoked on a different thread // than that which creates the CrashGenerationServer. They must // be thread safe. - typedef void (*OnClientDumpRequestCallback)(void *context, - const ClientInfo &client_info, - const std::string &file_path); + typedef void (*OnClientDumpRequestCallback)(void* context, + const ClientInfo& client_info, + const std::string& file_path); - typedef void (*OnClientExitingCallback)(void *context, - const ClientInfo &client_info); + typedef void (*OnClientExitingCallback)(void* context, + const ClientInfo& client_info); // If a FilterCallback returns false, the dump will not be written. - typedef bool (*FilterCallback)(void *context); + typedef bool (*FilterCallback)(void* context); // Create an instance with the given parameters. // @@ -83,15 +83,15 @@ class CrashGenerationServer { // passed for this parameter. // dump_path: Path for generating dumps; required only if true is // passed for generateDumps parameter; NULL can be passed otherwise. - CrashGenerationServer(const char *mach_port_name, + CrashGenerationServer(const char* mach_port_name, FilterCallback filter, - void *filter_context, + void* filter_context, OnClientDumpRequestCallback dump_callback, - void *dump_context, + void* dump_context, OnClientExitingCallback exit_callback, - void *exit_context, + void* exit_context, bool generate_dumps, - const std::string &dump_path); + const std::string& dump_path); ~CrashGenerationServer(); @@ -105,24 +105,24 @@ class CrashGenerationServer { private: // Return a unique filename at which a minidump can be written. - bool MakeMinidumpFilename(std::string &outFilename); + bool MakeMinidumpFilename(std::string& outFilename); // Loop reading client messages and responding to them until // a quit message is received. - static void *WaitForMessages(void *server); + static void* WaitForMessages(void* server); // Wait for a single client message and respond to it. Returns false // if a quit message was received or if an error occurred. bool WaitForOneMessage(); FilterCallback filter_; - void *filter_context_; + void* filter_context_; OnClientDumpRequestCallback dump_callback_; - void *dump_context_; + void* dump_context_; OnClientExitingCallback exit_callback_; - void *exit_context_; + void* exit_context_; bool generate_dumps_; |