aboutsummaryrefslogtreecommitdiff
path: root/src/google_breakpad/processor/minidump.h
diff options
context:
space:
mode:
authorted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-03-06 14:04:42 +0000
committerted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-03-06 14:04:42 +0000
commitaeffe1056f9ff6526d87a16ef55222899f5528f7 (patch)
tree1b7601a9135f82c14e73535c9d4a24f94d494662 /src/google_breakpad/processor/minidump.h
parentWork around Windows headers #defining ERROR by renaming enum values in StackF... (diff)
downloadbreakpad-aeffe1056f9ff6526d87a16ef55222899f5528f7.tar.xz
Use stdint types everywhere
R=mark at https://breakpad.appspot.com/535002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1121 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/google_breakpad/processor/minidump.h')
-rw-r--r--src/google_breakpad/processor/minidump.h176
1 files changed, 88 insertions, 88 deletions
diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h
index 0fe78443..18097714 100644
--- a/src/google_breakpad/processor/minidump.h
+++ b/src/google_breakpad/processor/minidump.h
@@ -154,7 +154,7 @@ class MinidumpStream : public MinidumpObject {
// the MDRawDirectory record or other identifying record. A class
// that implements MinidumpStream can compare expected_size to a
// known size as an integrity check.
- virtual bool Read(u_int32_t expected_size) = 0;
+ virtual bool Read(uint32_t expected_size) = 0;
};
@@ -176,11 +176,11 @@ class MinidumpContext : public MinidumpStream {
// identifying the CPU type that the context was collected from. The
// returned value will identify the CPU only, and will have any other
// MD_CONTEXT_* bits masked out. Returns 0 on failure.
- u_int32_t GetContextCPU() const;
+ uint32_t GetContextCPU() const;
// A convenience method to get the instruction pointer out of the
// MDRawContext, since it varies per-CPU architecture.
- bool GetInstructionPointer(u_int64_t* ip) const;
+ bool GetInstructionPointer(uint64_t* ip) const;
// Returns raw CPU-specific context data for the named CPU type. If the
// context data does not match the CPU type or does not exist, returns
@@ -210,13 +210,13 @@ class MinidumpContext : public MinidumpStream {
} context_;
// Store this separately because of the weirdo AMD64 context
- u_int32_t context_flags_;
+ uint32_t context_flags_;
private:
friend class MinidumpThread;
friend class MinidumpException;
- bool Read(u_int32_t expected_size);
+ bool Read(uint32_t expected_size);
// Free the CPU-specific context structure.
void FreeContext();
@@ -226,7 +226,7 @@ class MinidumpContext : public MinidumpStream {
// CPU type in context_cpu_type. Returns false if the CPU type does not
// match. Returns true if the CPU type matches or if the minidump does
// not contain a system info stream.
- bool CheckAgainstSystemInfo(u_int32_t context_cpu_type);
+ bool CheckAgainstSystemInfo(uint32_t context_cpu_type);
};
@@ -243,28 +243,28 @@ class MinidumpMemoryRegion : public MinidumpObject,
public:
virtual ~MinidumpMemoryRegion();
- static void set_max_bytes(u_int32_t max_bytes) { max_bytes_ = max_bytes; }
- static u_int32_t max_bytes() { return max_bytes_; }
+ static void set_max_bytes(uint32_t max_bytes) { max_bytes_ = max_bytes; }
+ static uint32_t max_bytes() { return max_bytes_; }
// Returns a pointer to the base of the memory region. Returns the
// cached value if available, otherwise, reads the minidump file and
// caches the memory region.
- const u_int8_t* GetMemory() const;
+ const uint8_t* GetMemory() const;
// The address of the base of the memory region.
- u_int64_t GetBase() const;
+ uint64_t GetBase() const;
// The size, in bytes, of the memory region.
- u_int32_t GetSize() const;
+ uint32_t GetSize() const;
// Frees the cached memory region, if cached.
void FreeMemory();
// Obtains the value of memory at the pointer specified by address.
- bool GetMemoryAtAddress(u_int64_t address, u_int8_t* value) const;
- bool GetMemoryAtAddress(u_int64_t address, u_int16_t* value) const;
- bool GetMemoryAtAddress(u_int64_t address, u_int32_t* value) const;
- bool GetMemoryAtAddress(u_int64_t address, u_int64_t* value) const;
+ bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const;
+ bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const;
+ bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const;
+ bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const;
// Print a human-readable representation of the object to stdout.
void Print();
@@ -281,19 +281,19 @@ class MinidumpMemoryRegion : public MinidumpObject,
void SetDescriptor(MDMemoryDescriptor* descriptor);
// Implementation for GetMemoryAtAddress
- template<typename T> bool GetMemoryAtAddressInternal(u_int64_t address,
+ template<typename T> bool GetMemoryAtAddressInternal(uint64_t address,
T* value) const;
// The largest memory region that will be read from a minidump. The
// default is 1MB.
- static u_int32_t max_bytes_;
+ static uint32_t max_bytes_;
// Base address and size of the memory region, and its position in the
// minidump file.
MDMemoryDescriptor* descriptor_;
// Cached memory.
- mutable vector<u_int8_t>* memory_;
+ mutable vector<uint8_t>* memory_;
};
@@ -319,7 +319,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(u_int32_t *thread_id) const;
+ virtual bool GetThreadID(uint32_t *thread_id) const;
// Print a human-readable representation of the object to stdout.
void Print();
@@ -348,10 +348,10 @@ class MinidumpThreadList : public MinidumpStream {
public:
virtual ~MinidumpThreadList();
- static void set_max_threads(u_int32_t max_threads) {
+ static void set_max_threads(uint32_t max_threads) {
max_threads_ = max_threads;
}
- static u_int32_t max_threads() { return max_threads_; }
+ static uint32_t max_threads() { return max_threads_; }
virtual unsigned int thread_count() const {
return valid_ ? thread_count_ : 0;
@@ -361,7 +361,7 @@ class MinidumpThreadList : public MinidumpStream {
virtual MinidumpThread* GetThreadAtIndex(unsigned int index) const;
// Random access to threads.
- MinidumpThread* GetThreadByID(u_int32_t thread_id);
+ MinidumpThread* GetThreadByID(uint32_t thread_id);
// Print a human-readable representation of the object to stdout.
void Print();
@@ -372,23 +372,23 @@ class MinidumpThreadList : public MinidumpStream {
private:
friend class Minidump;
- typedef map<u_int32_t, MinidumpThread*> IDToThreadMap;
+ typedef map<uint32_t, MinidumpThread*> IDToThreadMap;
typedef vector<MinidumpThread> MinidumpThreads;
- static const u_int32_t kStreamType = MD_THREAD_LIST_STREAM;
+ static const uint32_t kStreamType = MD_THREAD_LIST_STREAM;
- bool Read(u_int32_t aExpectedSize);
+ bool Read(uint32_t aExpectedSize);
// The largest number of threads that will be read from a minidump. The
// default is 256.
- static u_int32_t max_threads_;
+ static uint32_t max_threads_;
// Access to threads using the thread ID as the key.
IDToThreadMap id_to_thread_map_;
// The list of threads.
MinidumpThreads* threads_;
- u_int32_t thread_count_;
+ uint32_t thread_count_;
};
@@ -401,23 +401,23 @@ class MinidumpModule : public MinidumpObject,
public:
virtual ~MinidumpModule();
- static void set_max_cv_bytes(u_int32_t max_cv_bytes) {
+ static void set_max_cv_bytes(uint32_t max_cv_bytes) {
max_cv_bytes_ = max_cv_bytes;
}
- static u_int32_t max_cv_bytes() { return max_cv_bytes_; }
+ static uint32_t max_cv_bytes() { return max_cv_bytes_; }
- static void set_max_misc_bytes(u_int32_t max_misc_bytes) {
+ static void set_max_misc_bytes(uint32_t max_misc_bytes) {
max_misc_bytes_ = max_misc_bytes;
}
- static u_int32_t max_misc_bytes() { return max_misc_bytes_; }
+ static uint32_t max_misc_bytes() { return max_misc_bytes_; }
const MDRawModule* module() const { return valid_ ? &module_ : NULL; }
// CodeModule implementation
- virtual u_int64_t base_address() const {
- return valid_ ? module_.base_of_image : static_cast<u_int64_t>(-1);
+ virtual uint64_t base_address() const {
+ return valid_ ? module_.base_of_image : static_cast<uint64_t>(-1);
}
- virtual u_int64_t size() const { return valid_ ? module_.size_of_image : 0; }
+ virtual uint64_t size() const { return valid_ ? module_.size_of_image : 0; }
virtual string code_file() const;
virtual string code_identifier() const;
virtual string debug_file() const;
@@ -426,7 +426,7 @@ class MinidumpModule : public MinidumpObject,
virtual const CodeModule* Copy() const;
// The CodeView record, which contains information to locate the module's
- // debugging information (pdb). This is returned as u_int8_t* because
+ // debugging information (pdb). This is returned as uint8_t* because
// the data can be of types MDCVInfoPDB20* or MDCVInfoPDB70*, or it may be
// of a type unknown to Breakpad, in which case the raw data will still be
// returned but no byte-swapping will have been performed. Check the
@@ -435,14 +435,14 @@ class MinidumpModule : public MinidumpObject,
// MDCVInfoPDB70 by default. Returns a pointer to the CodeView record on
// success, and NULL on failure. On success, the optional |size| argument
// is set to the size of the CodeView record.
- const u_int8_t* GetCVRecord(u_int32_t* size);
+ const uint8_t* GetCVRecord(uint32_t* size);
// The miscellaneous debug record, which is obsolete. Current toolchains
// do not generate this type of debugging information (dbg), and this
// field is not expected to be present. Returns a pointer to the debugging
// record on success, and NULL on failure. On success, the optional |size|
// argument is set to the size of the debugging record.
- const MDImageDebugMisc* GetMiscRecord(u_int32_t* size);
+ const MDImageDebugMisc* GetMiscRecord(uint32_t* size);
// Print a human-readable representation of the object to stdout.
void Print();
@@ -469,8 +469,8 @@ class MinidumpModule : public MinidumpObject,
// The largest number of bytes that will be read from a minidump for a
// CodeView record or miscellaneous debugging record, respectively. The
// default for each is 1024.
- static u_int32_t max_cv_bytes_;
- static u_int32_t max_misc_bytes_;
+ static uint32_t max_cv_bytes_;
+ static uint32_t max_misc_bytes_;
// True after a successful Read. This is different from valid_, which is
// not set true until ReadAuxiliaryData also completes successfully.
@@ -490,20 +490,20 @@ class MinidumpModule : public MinidumpObject,
const string* name_;
// Cached CodeView record - this is MDCVInfoPDB20 or (likely)
- // MDCVInfoPDB70, or possibly something else entirely. Stored as a u_int8_t
+ // MDCVInfoPDB70, or possibly something else entirely. Stored as a uint8_t
// because the structure contains a variable-sized string and its exact
// size cannot be known until it is processed.
- vector<u_int8_t>* cv_record_;
+ vector<uint8_t>* cv_record_;
// If cv_record_ is present, cv_record_signature_ contains a copy of the
// CodeView record's first four bytes, for ease of determinining the
// type of structure that cv_record_ contains.
- u_int32_t cv_record_signature_;
+ uint32_t cv_record_signature_;
- // Cached MDImageDebugMisc (usually not present), stored as u_int8_t
+ // Cached MDImageDebugMisc (usually not present), stored as uint8_t
// because the structure contains a variable-sized string and its exact
// size cannot be known until it is processed.
- vector<u_int8_t>* misc_record_;
+ vector<uint8_t>* misc_record_;
};
@@ -516,16 +516,16 @@ class MinidumpModuleList : public MinidumpStream,
public:
virtual ~MinidumpModuleList();
- static void set_max_modules(u_int32_t max_modules) {
+ static void set_max_modules(uint32_t max_modules) {
max_modules_ = max_modules;
}
- static u_int32_t max_modules() { return max_modules_; }
+ static uint32_t max_modules() { return max_modules_; }
// CodeModules implementation.
virtual unsigned int module_count() const {
return valid_ ? module_count_ : 0;
}
- virtual const MinidumpModule* GetModuleForAddress(u_int64_t address) const;
+ virtual const MinidumpModule* GetModuleForAddress(uint64_t address) const;
virtual const MinidumpModule* GetMainModule() const;
virtual const MinidumpModule* GetModuleAtSequence(
unsigned int sequence) const;
@@ -543,19 +543,19 @@ class MinidumpModuleList : public MinidumpStream,
typedef vector<MinidumpModule> MinidumpModules;
- static const u_int32_t kStreamType = MD_MODULE_LIST_STREAM;
+ static const uint32_t kStreamType = MD_MODULE_LIST_STREAM;
- bool Read(u_int32_t expected_size);
+ bool Read(uint32_t expected_size);
// The largest number of modules that will be read from a minidump. The
// default is 1024.
- static u_int32_t max_modules_;
+ static uint32_t max_modules_;
// Access to modules using addresses as the key.
- RangeMap<u_int64_t, unsigned int> *range_map_;
+ RangeMap<uint64_t, unsigned int> *range_map_;
MinidumpModules *modules_;
- u_int32_t module_count_;
+ uint32_t module_count_;
};
@@ -572,10 +572,10 @@ class MinidumpMemoryList : public MinidumpStream {
public:
virtual ~MinidumpMemoryList();
- static void set_max_regions(u_int32_t max_regions) {
+ static void set_max_regions(uint32_t max_regions) {
max_regions_ = max_regions;
}
- static u_int32_t max_regions() { return max_regions_; }
+ static uint32_t max_regions() { return max_regions_; }
unsigned int region_count() const { return valid_ ? region_count_ : 0; }
@@ -584,7 +584,7 @@ class MinidumpMemoryList : public MinidumpStream {
// Random access to memory regions. Returns the region encompassing
// the address identified by address.
- MinidumpMemoryRegion* GetMemoryRegionForAddress(u_int64_t address);
+ MinidumpMemoryRegion* GetMemoryRegionForAddress(uint64_t address);
// Print a human-readable representation of the object to stdout.
void Print();
@@ -595,18 +595,18 @@ class MinidumpMemoryList : public MinidumpStream {
typedef vector<MDMemoryDescriptor> MemoryDescriptors;
typedef vector<MinidumpMemoryRegion> MemoryRegions;
- static const u_int32_t kStreamType = MD_MEMORY_LIST_STREAM;
+ static const uint32_t kStreamType = MD_MEMORY_LIST_STREAM;
explicit MinidumpMemoryList(Minidump* minidump);
- bool Read(u_int32_t expected_size);
+ bool Read(uint32_t expected_size);
// The largest number of memory regions that will be read from a minidump.
// The default is 256.
- static u_int32_t max_regions_;
+ static uint32_t max_regions_;
// Access to memory regions using addresses as the key.
- RangeMap<u_int64_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
@@ -616,7 +616,7 @@ class MinidumpMemoryList : public MinidumpStream {
// The list of regions.
MemoryRegions *regions_;
- u_int32_t region_count_;
+ uint32_t region_count_;
};
@@ -638,7 +638,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(u_int32_t *thread_id) const;
+ bool GetThreadID(uint32_t *thread_id) const;
MinidumpContext* GetContext();
@@ -648,11 +648,11 @@ class MinidumpException : public MinidumpStream {
private:
friend class Minidump;
- static const u_int32_t kStreamType = MD_EXCEPTION_STREAM;
+ static const uint32_t kStreamType = MD_EXCEPTION_STREAM;
explicit MinidumpException(Minidump* minidump);
- bool Read(u_int32_t expected_size);
+ bool Read(uint32_t expected_size);
MDRawExceptionStream exception_;
MinidumpContext* context_;
@@ -686,11 +686,11 @@ class MinidumpAssertion : public MinidumpStream {
private:
friend class Minidump;
- static const u_int32_t kStreamType = MD_ASSERTION_INFO_STREAM;
+ static const uint32_t kStreamType = MD_ASSERTION_INFO_STREAM;
explicit MinidumpAssertion(Minidump* minidump);
- bool Read(u_int32_t expected_size);
+ bool Read(uint32_t expected_size);
MDRawAssertionInfo assertion_;
string expression_;
@@ -743,9 +743,9 @@ class MinidumpSystemInfo : public MinidumpStream {
private:
friend class Minidump;
- static const u_int32_t kStreamType = MD_SYSTEM_INFO_STREAM;
+ static const uint32_t kStreamType = MD_SYSTEM_INFO_STREAM;
- bool Read(u_int32_t expected_size);
+ bool Read(uint32_t expected_size);
// A string identifying the CPU vendor, if known.
const string* cpu_vendor_;
@@ -767,11 +767,11 @@ class MinidumpMiscInfo : public MinidumpStream {
private:
friend class Minidump;
- static const u_int32_t kStreamType = MD_MISC_INFO_STREAM;
+ static const uint32_t kStreamType = MD_MISC_INFO_STREAM;
explicit MinidumpMiscInfo(Minidump* minidump_);
- bool Read(u_int32_t expected_size_);
+ bool Read(uint32_t expected_size_);
MDRawMiscInfo misc_info_;
};
@@ -790,8 +790,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(u_int32_t *thread_id) const;
- bool GetRequestingThreadID(u_int32_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();
@@ -799,11 +799,11 @@ class MinidumpBreakpadInfo : public MinidumpStream {
private:
friend class Minidump;
- static const u_int32_t kStreamType = MD_BREAKPAD_INFO_STREAM;
+ static const uint32_t kStreamType = MD_BREAKPAD_INFO_STREAM;
explicit MinidumpBreakpadInfo(Minidump* minidump_);
- bool Read(u_int32_t expected_size_);
+ bool Read(uint32_t expected_size_);
MDRawBreakpadInfo breakpad_info_;
};
@@ -816,10 +816,10 @@ class MinidumpMemoryInfo : public MinidumpObject {
const MDRawMemoryInfo* info() const { return valid_ ? &memory_info_ : NULL; }
// The address of the base of the memory region.
- u_int64_t GetBase() const { return valid_ ? memory_info_.base_address : 0; }
+ uint64_t GetBase() const { return valid_ ? memory_info_.base_address : 0; }
// The size, in bytes, of the memory region.
- u_int32_t GetSize() const { return valid_ ? memory_info_.region_size : 0; }
+ uint32_t GetSize() const { return valid_ ? memory_info_.region_size : 0; }
// Return true if the memory protection allows execution.
bool IsExecutable() const;
@@ -854,7 +854,7 @@ class MinidumpMemoryInfoList : public MinidumpStream {
unsigned int info_count() const { return valid_ ? info_count_ : 0; }
- const MinidumpMemoryInfo* GetMemoryInfoForAddress(u_int64_t address) const;
+ const MinidumpMemoryInfo* GetMemoryInfoForAddress(uint64_t address) const;
const MinidumpMemoryInfo* GetMemoryInfoAtIndex(unsigned int index) const;
// Print a human-readable representation of the object to stdout.
@@ -865,17 +865,17 @@ class MinidumpMemoryInfoList : public MinidumpStream {
typedef vector<MinidumpMemoryInfo> MinidumpMemoryInfos;
- static const u_int32_t kStreamType = MD_MEMORY_INFO_LIST_STREAM;
+ static const uint32_t kStreamType = MD_MEMORY_INFO_LIST_STREAM;
explicit MinidumpMemoryInfoList(Minidump* minidump);
- bool Read(u_int32_t expected_size);
+ bool Read(uint32_t expected_size);
// Access to memory info using addresses as the key.
- RangeMap<u_int64_t, unsigned int> *range_map_;
+ RangeMap<uint64_t, unsigned int> *range_map_;
MinidumpMemoryInfos* infos_;
- u_int32_t info_count_;
+ uint32_t info_count_;
};
@@ -896,15 +896,15 @@ class Minidump {
virtual string path() const {
return path_;
}
- static void set_max_streams(u_int32_t max_streams) {
+ static void set_max_streams(uint32_t max_streams) {
max_streams_ = max_streams;
}
- static u_int32_t max_streams() { return max_streams_; }
+ static uint32_t max_streams() { return max_streams_; }
- static void set_max_string_length(u_int32_t max_string_length) {
+ static void set_max_string_length(uint32_t max_string_length) {
max_string_length_ = max_string_length;
}
- static u_int32_t max_string_length() { return max_string_length_; }
+ static uint32_t max_string_length() { return max_string_length_; }
virtual const MDRawHeader* header() const { return valid_ ? &header_ : NULL; }
@@ -916,7 +916,7 @@ class Minidump {
// Returns true if the current position in the stream was not changed.
// Returns false when the current location in the stream was changed and the
// attempt to restore the original position failed.
- bool GetContextCPUFlagsFromSystemInfo(u_int32_t* context_cpu_flags);
+ bool GetContextCPUFlagsFromSystemInfo(uint32_t* context_cpu_flags);
// Reads the minidump file's header and top-level stream directory.
// The minidump is expected to be positioned at the beginning of the
@@ -980,7 +980,7 @@ class Minidump {
// possibility, and consider using GetDirectoryEntryAtIndex (possibly
// with GetDirectoryEntryCount) if expecting multiple streams of the same
// type in a single minidump file.
- bool SeekToStreamType(u_int32_t stream_type, u_int32_t* stream_length);
+ bool SeekToStreamType(uint32_t stream_type, uint32_t* stream_length);
bool swap() const { return valid_ ? swap_ : false; }
@@ -1003,7 +1003,7 @@ class Minidump {
};
typedef vector<MDRawDirectory> MinidumpDirectoryEntries;
- typedef map<u_int32_t, MinidumpStreamInfo> MinidumpStreamMap;
+ typedef map<uint32_t, MinidumpStreamInfo> MinidumpStreamMap;
template<typename T> T* GetStream(T** stream);
@@ -1013,7 +1013,7 @@ class Minidump {
// The largest number of top-level streams that will be read from a minidump.
// Note that streams are only read (and only consume memory) as needed,
// when directed by the caller. The default is 128.
- static u_int32_t max_streams_;
+ static uint32_t max_streams_;
// The maximum length of a UTF-16 string that will be read from a minidump
// in 16-bit words. The default is 1024. UTF-16 strings are converted