mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-11-28 01:14:20 +01:00
Fix minor style problems (#58). r=bryner
http://groups.google.com/group/airbag-dev/browse_thread/thread/bbcecab979fa82bc git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@49 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
0a7e6bf16c
commit
80e98391dc
@ -33,8 +33,8 @@
|
||||
#ifndef _PDB_SOURCE_LINE_WRITER_H__
|
||||
#define _PDB_SOURCE_LINE_WRITER_H__
|
||||
|
||||
#include <string>
|
||||
#include <atlcomcli.h>
|
||||
#include <string>
|
||||
|
||||
struct IDiaEnumLineNumbers;
|
||||
struct IDiaSession;
|
||||
|
@ -44,7 +44,7 @@ class MinidumpProcessor {
|
||||
public:
|
||||
// Initializes this MinidumpProcessor. supplier should be an
|
||||
// implementation of the SymbolSupplier abstract base class.
|
||||
MinidumpProcessor(SymbolSupplier *supplier);
|
||||
explicit MinidumpProcessor(SymbolSupplier *supplier);
|
||||
~MinidumpProcessor();
|
||||
|
||||
// Returns a new ProcessState object produced by processing the minidump
|
||||
|
@ -51,8 +51,9 @@ typedef SSIZE_T ssize_t;
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include "processor/minidump.h"
|
||||
#include "processor/range_map-inl.h"
|
||||
|
||||
#include "processor/minidump.h"
|
||||
#include "processor/scoped_ptr.h"
|
||||
|
||||
|
||||
@ -2126,7 +2127,7 @@ bool Minidump::Read() {
|
||||
// Initialize the stream_map map, which speeds locating a stream by
|
||||
// type.
|
||||
unsigned int stream_type = directory_entry->stream_type;
|
||||
switch(stream_type) {
|
||||
switch (stream_type) {
|
||||
case THREAD_LIST_STREAM:
|
||||
case MODULE_LIST_STREAM:
|
||||
case MEMORY_LIST_STREAM:
|
||||
@ -2203,7 +2204,8 @@ void Minidump::Print() {
|
||||
printf(" stream_count = %d\n", header_.stream_count);
|
||||
printf(" stream_directory_rva = 0x%x\n", header_.stream_directory_rva);
|
||||
printf(" checksum = 0x%x\n", header_.checksum);
|
||||
struct tm* timestruct = gmtime((time_t*)&header_.time_date_stamp);
|
||||
struct tm* timestruct =
|
||||
gmtime(reinterpret_cast<time_t*>(&header_.time_date_stamp));
|
||||
char timestr[20];
|
||||
strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", timestruct);
|
||||
printf(" time_date_stamp = 0x%x %s\n", header_.time_date_stamp,
|
||||
|
@ -108,7 +108,7 @@ class MinidumpObject {
|
||||
virtual ~MinidumpObject() {}
|
||||
|
||||
protected:
|
||||
MinidumpObject(Minidump* minidump);
|
||||
explicit MinidumpObject(Minidump* minidump);
|
||||
|
||||
// Refers to the Minidump object that is the ultimate parent of this
|
||||
// Some MinidumpObjects are owned by other MinidumpObjects, but at the
|
||||
@ -137,7 +137,7 @@ class MinidumpStream : public MinidumpObject {
|
||||
virtual ~MinidumpStream() {}
|
||||
|
||||
protected:
|
||||
MinidumpStream(Minidump* minidump);
|
||||
explicit MinidumpStream(Minidump* minidump);
|
||||
|
||||
private:
|
||||
// Populate (and validate) the MinidumpStream. minidump_ is expected
|
||||
@ -184,7 +184,7 @@ class MinidumpContext : public MinidumpStream {
|
||||
friend class MinidumpThread;
|
||||
friend class MinidumpException;
|
||||
|
||||
MinidumpContext(Minidump* minidump);
|
||||
explicit MinidumpContext(Minidump* minidump);
|
||||
|
||||
bool Read(u_int32_t expected_size);
|
||||
|
||||
@ -247,7 +247,7 @@ class MinidumpMemoryRegion : public MinidumpObject,
|
||||
friend class MinidumpThread;
|
||||
friend class MinidumpMemoryList;
|
||||
|
||||
MinidumpMemoryRegion(Minidump* minidump);
|
||||
explicit MinidumpMemoryRegion(Minidump* minidump);
|
||||
|
||||
// Identify the base address and size of the memory region, and the
|
||||
// location it may be found in the minidump file.
|
||||
@ -291,7 +291,7 @@ class MinidumpThread : public MinidumpObject {
|
||||
// These objects are managed by MinidumpThreadList.
|
||||
friend class MinidumpThreadList;
|
||||
|
||||
MinidumpThread(Minidump* minidump);
|
||||
explicit MinidumpThread(Minidump* minidump);
|
||||
|
||||
// This works like MinidumpStream::Read, but is driven by
|
||||
// MinidumpThreadList. No size checking is done, because
|
||||
@ -329,7 +329,7 @@ class MinidumpThreadList : public MinidumpStream {
|
||||
|
||||
static const u_int32_t kStreamType = THREAD_LIST_STREAM;
|
||||
|
||||
MinidumpThreadList(Minidump* aMinidump);
|
||||
explicit MinidumpThreadList(Minidump* aMinidump);
|
||||
|
||||
bool Read(u_int32_t aExpectedSize);
|
||||
|
||||
@ -384,7 +384,7 @@ class MinidumpModule : public MinidumpObject {
|
||||
// These objects are managed by MinidumpModuleList.
|
||||
friend class MinidumpModuleList;
|
||||
|
||||
MinidumpModule(Minidump* minidump);
|
||||
explicit MinidumpModule(Minidump* minidump);
|
||||
|
||||
// This works like MinidumpStream::Read, but is driven by
|
||||
// MinidumpModuleList. No size checking is done, because
|
||||
@ -439,7 +439,7 @@ class MinidumpModuleList : public MinidumpStream {
|
||||
|
||||
static const u_int32_t kStreamType = MODULE_LIST_STREAM;
|
||||
|
||||
MinidumpModuleList(Minidump* minidump);
|
||||
explicit MinidumpModuleList(Minidump* minidump);
|
||||
|
||||
bool Read(u_int32_t expected_size);
|
||||
|
||||
@ -484,7 +484,7 @@ class MinidumpMemoryList : public MinidumpStream {
|
||||
|
||||
static const u_int32_t kStreamType = MEMORY_LIST_STREAM;
|
||||
|
||||
MinidumpMemoryList(Minidump* minidump);
|
||||
explicit MinidumpMemoryList(Minidump* minidump);
|
||||
|
||||
bool Read(u_int32_t expected_size);
|
||||
|
||||
@ -531,7 +531,7 @@ class MinidumpException : public MinidumpStream {
|
||||
|
||||
static const u_int32_t kStreamType = EXCEPTION_STREAM;
|
||||
|
||||
MinidumpException(Minidump* minidump);
|
||||
explicit MinidumpException(Minidump* minidump);
|
||||
|
||||
bool Read(u_int32_t expected_size);
|
||||
|
||||
@ -568,7 +568,7 @@ class MinidumpSystemInfo : public MinidumpStream {
|
||||
|
||||
static const u_int32_t kStreamType = SYSTEM_INFO_STREAM;
|
||||
|
||||
MinidumpSystemInfo(Minidump* minidump);
|
||||
explicit MinidumpSystemInfo(Minidump* minidump);
|
||||
|
||||
bool Read(u_int32_t expected_size);
|
||||
|
||||
@ -598,7 +598,7 @@ class MinidumpMiscInfo : public MinidumpStream {
|
||||
|
||||
static const u_int32_t kStreamType = MISC_INFO_STREAM;
|
||||
|
||||
MinidumpMiscInfo(Minidump* minidump_);
|
||||
explicit MinidumpMiscInfo(Minidump* minidump_);
|
||||
|
||||
bool Read(u_int32_t expected_size_);
|
||||
|
||||
@ -611,7 +611,7 @@ class MinidumpMiscInfo : public MinidumpStream {
|
||||
class Minidump {
|
||||
public:
|
||||
// path is the pathname of a file containing the minidump.
|
||||
Minidump(const string& path);
|
||||
explicit Minidump(const string& path);
|
||||
|
||||
~Minidump();
|
||||
|
||||
|
@ -483,7 +483,7 @@ typedef enum {
|
||||
FUNCTION_TABLE_STREAM = 13,
|
||||
UNLOADED_MODULE_LIST_STREAM = 14,
|
||||
MISC_INFO_STREAM = 15, /* MDRawMiscInfo */
|
||||
LAST_RESERVED_STREAM = 0x0000FFFF
|
||||
LAST_RESERVED_STREAM = 0x0000ffff
|
||||
} MDStreamType; /* MINIDUMP_STREAM_TYPE */
|
||||
|
||||
|
||||
|
@ -271,7 +271,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, u_int64_t *address) {
|
||||
if (!raw_system_info)
|
||||
return reason;
|
||||
|
||||
switch(raw_system_info->platform_id) {
|
||||
switch (raw_system_info->platform_id) {
|
||||
case MD_OS_WIN32_NT:
|
||||
case MD_OS_WIN32_WINDOWS: {
|
||||
switch (raw_exception->exception_record.exception_code) {
|
||||
|
@ -74,7 +74,6 @@ string TestSymbolSupplier::GetSymbolFile(MinidumpModule *module) {
|
||||
using google_airbag::TestSymbolSupplier;
|
||||
|
||||
static bool RunTests() {
|
||||
|
||||
TestSymbolSupplier supplier;
|
||||
MinidumpProcessor processor(&supplier);
|
||||
|
||||
|
@ -38,7 +38,7 @@ using std::ostringstream;
|
||||
// before returning failure.
|
||||
class AutoStackClearer {
|
||||
public:
|
||||
AutoStackClearer(vector<string> *stack) : stack_(stack) {}
|
||||
explicit AutoStackClearer(vector<string> *stack) : stack_(stack) {}
|
||||
~AutoStackClearer() { stack_->clear(); }
|
||||
|
||||
private:
|
||||
|
@ -20,9 +20,10 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "processor/postfix_evaluator-inl.h"
|
||||
|
||||
#include "google/airbag_types.h"
|
||||
#include "processor/memory_region.h"
|
||||
#include "processor/postfix_evaluator-inl.h"
|
||||
|
||||
|
||||
using std::map;
|
||||
@ -38,14 +39,22 @@ class FakeMemoryRegion : public MemoryRegion {
|
||||
public:
|
||||
virtual u_int64_t GetBase() { return 0; }
|
||||
virtual u_int32_t GetSize() { return 0; }
|
||||
virtual bool GetMemoryAtAddress(u_int64_t address, u_int8_t *value)
|
||||
{ *value = address + 1; return true; }
|
||||
virtual bool GetMemoryAtAddress(u_int64_t address, u_int16_t *value)
|
||||
{ *value = address + 1; return true; }
|
||||
virtual bool GetMemoryAtAddress(u_int64_t address, u_int32_t *value)
|
||||
{ *value = address + 1; return true; }
|
||||
virtual bool GetMemoryAtAddress(u_int64_t address, u_int64_t *value)
|
||||
{ *value = address + 1; return true; }
|
||||
virtual bool GetMemoryAtAddress(u_int64_t address, u_int8_t *value) {
|
||||
*value = address + 1;
|
||||
return true;
|
||||
}
|
||||
virtual bool GetMemoryAtAddress(u_int64_t address, u_int16_t *value) {
|
||||
*value = address + 1;
|
||||
return true;
|
||||
}
|
||||
virtual bool GetMemoryAtAddress(u_int64_t address, u_int32_t *value) {
|
||||
*value = address + 1;
|
||||
return true;
|
||||
}
|
||||
virtual bool GetMemoryAtAddress(u_int64_t address, u_int64_t *value) {
|
||||
*value = address + 1;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -210,7 +219,7 @@ bool RunTests() {
|
||||
}
|
||||
|
||||
// Validate the results.
|
||||
for(map<string, unsigned int>::const_iterator validate_iterator =
|
||||
for (map<string, unsigned int>::const_iterator validate_iterator =
|
||||
evaluate_test_set->validate_data->begin();
|
||||
validate_iterator != evaluate_test_set->validate_data->end();
|
||||
++validate_iterator) {
|
||||
|
@ -35,8 +35,9 @@
|
||||
#include <climits>
|
||||
#include <cstdio>
|
||||
|
||||
#include "processor/linked_ptr.h"
|
||||
#include "processor/range_map-inl.h"
|
||||
|
||||
#include "processor/linked_ptr.h"
|
||||
#include "processor/scoped_ptr.h"
|
||||
|
||||
|
||||
|
@ -29,15 +29,18 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include "processor/source_line_resolver.h"
|
||||
#include "google/stack_frame.h"
|
||||
#include "processor/linked_ptr.h"
|
||||
#include <vector>
|
||||
|
||||
#include "processor/address_map-inl.h"
|
||||
#include "processor/contained_range_map-inl.h"
|
||||
#include "processor/range_map-inl.h"
|
||||
|
||||
#include "processor/source_line_resolver.h"
|
||||
#include "google/stack_frame.h"
|
||||
#include "processor/linked_ptr.h"
|
||||
#include "processor/scoped_ptr.h"
|
||||
#include "processor/stack_frame_info.h"
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <ext/hash_map>
|
||||
#include "google/airbag_types.h"
|
||||
|
||||
namespace google_airbag {
|
||||
|
||||
@ -47,7 +48,7 @@ struct StackFrameInfo;
|
||||
|
||||
class SourceLineResolver {
|
||||
public:
|
||||
typedef unsigned long long MemAddr;
|
||||
typedef u_int64_t MemAddr;
|
||||
|
||||
SourceLineResolver();
|
||||
~SourceLineResolver();
|
||||
|
@ -95,7 +95,10 @@ struct StackFrameInfo {
|
||||
|
||||
// Clears the StackFrameInfo object so that users will see it as though
|
||||
// it contains no information.
|
||||
void Clear() { valid = VALID_NONE; program_string.erase(); }
|
||||
void Clear() {
|
||||
valid = VALID_NONE;
|
||||
program_string.erase();
|
||||
}
|
||||
|
||||
// Identifies which fields in the structure are valid. This is of
|
||||
// type Validity, but it is defined as an int because it's not
|
||||
|
@ -222,7 +222,7 @@ static unsigned int CountCallerFrames() {
|
||||
|
||||
#ifdef PRINT_STACKS
|
||||
printf("\n");
|
||||
for(unsigned int frame_index = 0;
|
||||
for (unsigned int frame_index = 0;
|
||||
frame_index < stack->frames()->size();
|
||||
++frame_index) {
|
||||
StackFrame *frame = stack->frames()->at(frame_index);
|
||||
|
@ -34,12 +34,13 @@
|
||||
// Author: Mark Mentovai
|
||||
|
||||
|
||||
#include "processor/postfix_evaluator-inl.h"
|
||||
|
||||
#include "processor/stackwalker_x86.h"
|
||||
#include "google/call_stack.h"
|
||||
#include "google/stack_frame_cpu.h"
|
||||
#include "processor/linked_ptr.h"
|
||||
#include "processor/minidump.h"
|
||||
#include "processor/postfix_evaluator-inl.h"
|
||||
#include "processor/stack_frame_info.h"
|
||||
|
||||
namespace google_airbag {
|
||||
|
Loading…
Reference in New Issue
Block a user