From 09b056975dacd1f0f815ad820b6dc9913b0118a3 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 23 Jun 2020 18:55:43 -0400 Subject: 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 Reviewed-by: Mark Mentovai --- .../processor/basic_source_line_resolver.h | 40 +++++++++++----------- src/google_breakpad/processor/minidump.h | 38 ++++++++++---------- src/google_breakpad/processor/minidump_processor.h | 2 +- .../processor/source_line_resolver_base.h | 40 +++++++++++----------- .../processor/source_line_resolver_interface.h | 24 ++++++------- src/google_breakpad/processor/symbol_supplier.h | 28 +++++++-------- 6 files changed, 86 insertions(+), 86 deletions(-) (limited to 'src/google_breakpad/processor') diff --git a/src/google_breakpad/processor/basic_source_line_resolver.h b/src/google_breakpad/processor/basic_source_line_resolver.h index 91fb7841..1c7bf465 100644 --- a/src/google_breakpad/processor/basic_source_line_resolver.h +++ b/src/google_breakpad/processor/basic_source_line_resolver.h @@ -90,9 +90,9 @@ class SymbolParseHelper { // can't be const. On success, , and are stored in |*index|, // and |*filename|. No allocation is done, |*filename| simply points inside // |file_line|. - static bool ParseFile(char *file_line, // in - long *index, // out - char **filename); // out + static bool ParseFile(char* file_line, // in + long* index, // out + char** filename); // out // Parses a |function_line| declaration. Returns true on success. // Format: FUNC []
. @@ -101,12 +101,12 @@ class SymbolParseHelper { // , and are stored in |*is_multiple|, |*address|, // |*size|, |*stack_param_size|, and |*name|. No allocation is done, |*name| // simply points inside |function_line|. - static bool ParseFunction(char *function_line, // in - bool *is_multiple, // out - uint64_t *address, // out - uint64_t *size, // out - long *stack_param_size, // out - char **name); // out + static bool ParseFunction(char* function_line, // in + bool* is_multiple, // out + uint64_t* address, // out + uint64_t* size, // out + long* stack_param_size, // out + char** name); // out // Parses a |line| declaration. Returns true on success. // Format:
@@ -114,11 +114,11 @@ class SymbolParseHelper { // it can't be const. On success,
, , , and // are stored in |*address|, |*size|, |*line_number|, and // |*source_file|. - static bool ParseLine(char *line_line, // in - uint64_t *address, // out - uint64_t *size, // out - long *line_number, // out - long *source_file); // out + static bool ParseLine(char* line_line, // in + uint64_t* address, // out + uint64_t* size, // out + long* line_number, // out + long* source_file); // out // Parses a |public_line| declaration. Returns true on success. // Format: PUBLIC []
@@ -127,15 +127,15 @@ class SymbolParseHelper { // , are stored in |*is_multiple|, |*address|, // |*stack_param_size|, and |*name|. No allocation is done, |*name| simply // points inside |public_line|. - static bool ParsePublicSymbol(char *public_line, // in - bool *is_multiple, // out - uint64_t *address, // out - long *stack_param_size, // out - char **name); // out + static bool ParsePublicSymbol(char* public_line, // in + bool* is_multiple, // out + uint64_t* address, // out + long* stack_param_size, // out + char** name); // out private: // Used for success checks after strtoull and strtol. - static bool IsValidAfterNumber(char *after_number); + static bool IsValidAfterNumber(char* after_number); // Only allow static methods. SymbolParseHelper(); diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h index d712cb66..1c40a821 100644 --- a/src/google_breakpad/processor/minidump.h +++ b/src/google_breakpad/processor/minidump.h @@ -291,7 +291,7 @@ class MinidumpThread : public MinidumpObject { // so a special getter is provided to retrieve this data from the // MDRawThread structure. Returns false if the thread ID cannot be // determined. - virtual bool GetThreadID(uint32_t *thread_id) const; + virtual bool GetThreadID(uint32_t* thread_id) const; // Print a human-readable representation of the object to stdout. void Print(); @@ -549,9 +549,9 @@ class MinidumpModuleList : public MinidumpStream, static uint32_t max_modules_; // Access to modules using addresses as the key. - RangeMap *range_map_; + RangeMap* range_map_; - MinidumpModules *modules_; + MinidumpModules* modules_; uint32_t module_count_; DISALLOW_COPY_AND_ASSIGN(MinidumpModuleList); @@ -606,16 +606,16 @@ class MinidumpMemoryList : public MinidumpStream { static uint32_t max_regions_; // Access to memory regions using addresses as the key. - RangeMap *range_map_; + RangeMap* range_map_; // The list of descriptors. This is maintained separately from the list // of regions, because MemoryRegion doesn't own its MemoryDescriptor, it // maintains a pointer to it. descriptors_ provides the storage for this // purpose. - MemoryDescriptors *descriptors_; + MemoryDescriptors* descriptors_; // The list of regions. - MemoryRegions *regions_; + MemoryRegions* regions_; uint32_t region_count_; DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryList); @@ -640,7 +640,7 @@ class MinidumpException : public MinidumpStream { // so a special getter is provided to retrieve this data from the // MDRawExceptionStream structure. Returns false if the thread ID cannot // be determined. - bool GetThreadID(uint32_t *thread_id) const; + bool GetThreadID(uint32_t* thread_id) const; MinidumpContext* GetContext(); @@ -862,9 +862,9 @@ class MinidumpUnloadedModuleList : public MinidumpStream, static uint32_t max_modules_; // Access to module indices using addresses as the key. - RangeMap *range_map_; + RangeMap* range_map_; - MinidumpUnloadedModules *unloaded_modules_; + MinidumpUnloadedModules* unloaded_modules_; uint32_t module_count_; DISALLOW_COPY_AND_ASSIGN(MinidumpUnloadedModuleList); @@ -919,8 +919,8 @@ class MinidumpBreakpadInfo : public MinidumpStream { // treatment, so special getters are provided to retrieve this data from // the MDRawBreakpadInfo structure. The getters return false if the thread // IDs cannot be determined. - bool GetDumpThreadID(uint32_t *thread_id) const; - bool GetRequestingThreadID(uint32_t *thread_id) const; + bool GetDumpThreadID(uint32_t* thread_id) const; + bool GetRequestingThreadID(uint32_t* thread_id) const; // Print a human-readable representation of the object to stdout. void Print(); @@ -1003,7 +1003,7 @@ class MinidumpMemoryInfoList : public MinidumpStream { bool Read(uint32_t expected_size) override; // Access to memory info using addresses as the key. - RangeMap *range_map_; + RangeMap* range_map_; MinidumpMemoryInfos* infos_; uint32_t info_count_; @@ -1056,7 +1056,7 @@ class MinidumpLinuxMaps : public MinidumpObject { friend class MinidumpLinuxMapsList; // This caller owns the pointer. - explicit MinidumpLinuxMaps(Minidump *minidump); + explicit MinidumpLinuxMaps(Minidump* minidump); // The memory region struct that this class wraps. MappedMemoryRegion region_; @@ -1075,9 +1075,9 @@ class MinidumpLinuxMapsList : public MinidumpStream { unsigned int get_maps_count() const { return valid_ ? maps_count_ : 0; } // Get mapping at the given memory address. The caller owns the pointer. - const MinidumpLinuxMaps *GetLinuxMapsForAddress(uint64_t address) const; + const MinidumpLinuxMaps* GetLinuxMapsForAddress(uint64_t address) const; // Get mapping at the given index. The caller owns the pointer. - const MinidumpLinuxMaps *GetLinuxMapsAtIndex(unsigned int index) const; + const MinidumpLinuxMaps* GetLinuxMapsAtIndex(unsigned int index) const; // Print the contents of /proc/self/maps to stdout. void Print() const; @@ -1085,12 +1085,12 @@ class MinidumpLinuxMapsList : public MinidumpStream { private: friend class Minidump; - typedef vector MinidumpLinuxMappings; + typedef vector MinidumpLinuxMappings; static const uint32_t kStreamType = MD_LINUX_MAPS; // The caller owns the pointer. - explicit MinidumpLinuxMapsList(Minidump *minidump); + explicit MinidumpLinuxMapsList(Minidump* minidump); // Read and load the contents of the process mapping data. // The stream should have data in the form of /proc/self/maps. @@ -1098,7 +1098,7 @@ class MinidumpLinuxMapsList : public MinidumpStream { bool Read(uint32_t expected_size) override; // The list of individual mappings. - MinidumpLinuxMappings *maps_; + MinidumpLinuxMappings* maps_; // The number of mappings. uint32_t maps_count_; @@ -1200,7 +1200,7 @@ class Minidump { MinidumpCrashpadInfo* GetCrashpadInfo(); // The next method also calls GetStream, but is exclusive for Linux dumps. - virtual MinidumpLinuxMapsList *GetLinuxMapsList(); + virtual MinidumpLinuxMapsList* GetLinuxMapsList(); // The next set of methods are provided for users who wish to access // data in minidump files directly, while leveraging the rest of diff --git a/src/google_breakpad/processor/minidump_processor.h b/src/google_breakpad/processor/minidump_processor.h index 387115ef..414050e9 100644 --- a/src/google_breakpad/processor/minidump_processor.h +++ b/src/google_breakpad/processor/minidump_processor.h @@ -70,7 +70,7 @@ class MinidumpProcessor { ~MinidumpProcessor(); // Processes the minidump file and fills process_state with the result. - ProcessResult Process(const string &minidump_file, + ProcessResult Process(const string& minidump_file, ProcessState* process_state); // Processes the minidump structure and fills process_state with the diff --git a/src/google_breakpad/processor/source_line_resolver_base.h b/src/google_breakpad/processor/source_line_resolver_base.h index c720b0c3..fea1657c 100644 --- a/src/google_breakpad/processor/source_line_resolver_base.h +++ b/src/google_breakpad/processor/source_line_resolver_base.h @@ -64,36 +64,36 @@ class SourceLineResolverBase : public SourceLineResolverInterface { // LoadMap() method. // Place dynamically allocated heap buffer in symbol_data. Caller has the // ownership of the buffer, and should call delete [] to free the buffer. - static bool ReadSymbolFile(const string &file_name, - char **symbol_data, - size_t *symbol_data_size); + static bool ReadSymbolFile(const string& file_name, + char** symbol_data, + size_t* symbol_data_size); protected: // Users are not allowed create SourceLineResolverBase instance directly. - SourceLineResolverBase(ModuleFactory *module_factory); + SourceLineResolverBase(ModuleFactory* module_factory); virtual ~SourceLineResolverBase(); // Virtual methods inherited from SourceLineResolverInterface. - virtual bool LoadModule(const CodeModule *module, const string &map_file); - virtual bool LoadModuleUsingMapBuffer(const CodeModule *module, - const string &map_buffer); - virtual bool LoadModuleUsingMemoryBuffer(const CodeModule *module, - char *memory_buffer, + virtual bool LoadModule(const CodeModule* module, const string& map_file); + virtual bool LoadModuleUsingMapBuffer(const CodeModule* module, + const string& map_buffer); + virtual bool LoadModuleUsingMemoryBuffer(const CodeModule* module, + char* memory_buffer, size_t memory_buffer_size); virtual bool ShouldDeleteMemoryBufferAfterLoadModule(); - virtual void UnloadModule(const CodeModule *module); - virtual bool HasModule(const CodeModule *module); - virtual bool IsModuleCorrupt(const CodeModule *module); - virtual void FillSourceLineInfo(StackFrame *frame); - virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame); - virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame); + virtual void UnloadModule(const CodeModule* module); + virtual bool HasModule(const CodeModule* module); + virtual bool IsModuleCorrupt(const CodeModule* module); + virtual void FillSourceLineInfo(StackFrame* frame); + virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame); + virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame); // Nested structs and classes. struct Line; struct Function; struct PublicSymbol; struct CompareString { - bool operator()(const string &s1, const string &s2) const; + bool operator()(const string& s1, const string& s2) const; }; // Module is an interface for an in-memory symbol file. class Module; @@ -101,18 +101,18 @@ class SourceLineResolverBase : public SourceLineResolverInterface { // All of the modules that are loaded. typedef map ModuleMap; - ModuleMap *modules_; + ModuleMap* modules_; // The loaded modules that were detecting to be corrupt during load. typedef set ModuleSet; - ModuleSet *corrupt_modules_; + ModuleSet* corrupt_modules_; // All of heap-allocated buffers that are owned locally by resolver. typedef std::map MemoryMap; - MemoryMap *memory_buffers_; + MemoryMap* memory_buffers_; // Creates a concrete module at run-time. - ModuleFactory *module_factory_; + ModuleFactory* module_factory_; private: // ModuleFactory needs to have access to protected type Module. diff --git a/src/google_breakpad/processor/source_line_resolver_interface.h b/src/google_breakpad/processor/source_line_resolver_interface.h index a694bf2e..99011404 100644 --- a/src/google_breakpad/processor/source_line_resolver_interface.h +++ b/src/google_breakpad/processor/source_line_resolver_interface.h @@ -58,11 +58,11 @@ class SourceLineResolverInterface { // and debug_identifier members populated. // // map_file should contain line/address mappings for this module. - virtual bool LoadModule(const CodeModule *module, - const string &map_file) = 0; + virtual bool LoadModule(const CodeModule* module, + const string& map_file) = 0; // Same as above, but takes the contents of a pre-read map buffer - virtual bool LoadModuleUsingMapBuffer(const CodeModule *module, - const string &map_buffer) = 0; + virtual bool LoadModuleUsingMapBuffer(const CodeModule* module, + const string& map_buffer) = 0; // Add an interface to load symbol using C-String data instead of string. // This is useful in the optimization design for avoiding unnecessary copying @@ -70,8 +70,8 @@ class SourceLineResolverInterface { // LoadModuleUsingMemoryBuffer() does NOT take ownership of memory_buffer. // LoadModuleUsingMemoryBuffer() null terminates the passed in buffer, if // the last character is not a null terminator. - virtual bool LoadModuleUsingMemoryBuffer(const CodeModule *module, - char *memory_buffer, + virtual bool LoadModuleUsingMemoryBuffer(const CodeModule* module, + char* memory_buffer, size_t memory_buffer_size) = 0; // Return true if the memory buffer should be deleted immediately after @@ -81,31 +81,31 @@ class SourceLineResolverInterface { // Request that the specified module be unloaded from this resolver. // A resolver may choose to ignore such a request. - virtual void UnloadModule(const CodeModule *module) = 0; + virtual void UnloadModule(const CodeModule* module) = 0; // Returns true if the module has been loaded. - virtual bool HasModule(const CodeModule *module) = 0; + virtual bool HasModule(const CodeModule* module) = 0; // Returns true if the module has been loaded and it is corrupt. - virtual bool IsModuleCorrupt(const CodeModule *module) = 0; + virtual bool IsModuleCorrupt(const CodeModule* module) = 0; // Fills in the function_base, function_name, source_file_name, // and source_line fields of the StackFrame. The instruction and // module_name fields must already be filled in. - virtual void FillSourceLineInfo(StackFrame *frame) = 0; + virtual void FillSourceLineInfo(StackFrame* frame) = 0; // If Windows stack walking information is available covering // FRAME's instruction address, return a WindowsFrameInfo structure // describing it. If the information is not available, returns NULL. // A NULL return value does not indicate an error. The caller takes // ownership of any returned WindowsFrameInfo object. - virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame) = 0; + virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame) = 0; // If CFI stack walking information is available covering ADDRESS, // return a CFIFrameInfo structure describing it. If the information // is not available, return NULL. The caller takes ownership of any // returned CFIFrameInfo object. - virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame) = 0; + virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame) = 0; protected: // SourceLineResolverInterface cannot be instantiated except by subclasses diff --git a/src/google_breakpad/processor/symbol_supplier.h b/src/google_breakpad/processor/symbol_supplier.h index a042081f..6ec01766 100644 --- a/src/google_breakpad/processor/symbol_supplier.h +++ b/src/google_breakpad/processor/symbol_supplier.h @@ -63,35 +63,35 @@ class SymbolSupplier { // to help locate the symbol file. system_info may be NULL or its // fields may be empty if these values are unknown. symbol_file // must be a pointer to a valid string - virtual SymbolResult GetSymbolFile(const CodeModule *module, - const SystemInfo *system_info, - string *symbol_file) = 0; + virtual SymbolResult GetSymbolFile(const CodeModule* module, + const SystemInfo* system_info, + string* symbol_file) = 0; // Same as above, except also places symbol data into symbol_data. // If symbol_data is NULL, the data is not returned. // TODO(nealsid) Once we have symbol data caching behavior implemented // investigate making all symbol suppliers implement all methods, // and make this pure virtual - virtual SymbolResult GetSymbolFile(const CodeModule *module, - const SystemInfo *system_info, - string *symbol_file, - string *symbol_data) = 0; + virtual SymbolResult GetSymbolFile(const CodeModule* module, + const SystemInfo* system_info, + string* symbol_file, + string* symbol_data) = 0; // Same as above, except allocates data buffer on heap and then places the // symbol data into the buffer as C-string. // SymbolSupplier is responsible for deleting the data buffer. After the call // to GetCStringSymbolData(), the caller should call FreeSymbolData(const - // Module *module) once the data buffer is no longer needed. + // Module* module) once the data buffer is no longer needed. // If symbol_data is not NULL, symbol supplier won't return FOUND unless it // returns a valid buffer in symbol_data, e.g., returns INTERRUPT on memory // allocation failure. - virtual SymbolResult GetCStringSymbolData(const CodeModule *module, - const SystemInfo *system_info, - string *symbol_file, - char **symbol_data, - size_t *symbol_data_size) = 0; + virtual SymbolResult GetCStringSymbolData(const CodeModule* module, + const SystemInfo* system_info, + string* symbol_file, + char** symbol_data, + size_t* symbol_data_size) = 0; // Frees the data buffer allocated for the module in GetCStringSymbolData. - virtual void FreeSymbolData(const CodeModule *module) = 0; + virtual void FreeSymbolData(const CodeModule* module) = 0; }; } // namespace google_breakpad -- cgit v1.2.1