mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-03 13:14:45 +01:00
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>
This commit is contained in:
parent
a741027533
commit
09b056975d
289 changed files with 3770 additions and 3775 deletions
|
|
@ -90,9 +90,9 @@ class SymbolParseHelper {
|
|||
// can't be const. On success, <id>, and <filename> 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 [<multiple>] <address> <size> <stack_param_size> <name>.
|
||||
|
|
@ -101,12 +101,12 @@ class SymbolParseHelper {
|
|||
// <stack_param_size>, and <name> 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: <address> <size> <line number> <source file id>
|
||||
|
|
@ -114,11 +114,11 @@ class SymbolParseHelper {
|
|||
// it can't be const. On success, <address>, <size>, <line number>, and
|
||||
// <source file id> 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 [<multiple>] <address> <stack_param_size> <name>
|
||||
|
|
@ -127,15 +127,15 @@ class SymbolParseHelper {
|
|||
// <stack_param_size>, <name> 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();
|
||||
|
|
|
|||
|
|
@ -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<uint64_t, unsigned int> *range_map_;
|
||||
RangeMap<uint64_t, unsigned int>* 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<uint64_t, unsigned int> *range_map_;
|
||||
RangeMap<uint64_t, unsigned int>* 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<uint64_t, unsigned int> *range_map_;
|
||||
RangeMap<uint64_t, unsigned int>* 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<uint64_t, unsigned int> *range_map_;
|
||||
RangeMap<uint64_t, unsigned int>* 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<MinidumpLinuxMaps *> MinidumpLinuxMappings;
|
||||
typedef vector<MinidumpLinuxMaps*> 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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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<string, Module*, CompareString> ModuleMap;
|
||||
ModuleMap *modules_;
|
||||
ModuleMap* modules_;
|
||||
|
||||
// The loaded modules that were detecting to be corrupt during load.
|
||||
typedef set<string, CompareString> ModuleSet;
|
||||
ModuleSet *corrupt_modules_;
|
||||
ModuleSet* corrupt_modules_;
|
||||
|
||||
// All of heap-allocated buffers that are owned locally by resolver.
|
||||
typedef std::map<string, char*, CompareString> 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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue