|
|
@ -89,7 +89,6 @@
|
|
|
|
#include <string>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
|
|
#include "common/basictypes.h"
|
|
|
|
|
|
|
|
#include "common/using_std_string.h"
|
|
|
|
#include "common/using_std_string.h"
|
|
|
|
#include "google_breakpad/processor/code_module.h"
|
|
|
|
#include "google_breakpad/processor/code_module.h"
|
|
|
|
#include "google_breakpad/processor/code_modules.h"
|
|
|
|
#include "google_breakpad/processor/code_modules.h"
|
|
|
@ -114,7 +113,7 @@ template<typename AddressType, typename EntryType> class RangeMap;
|
|
|
|
// itself.
|
|
|
|
// itself.
|
|
|
|
class MinidumpObject : public DumpObject {
|
|
|
|
class MinidumpObject : public DumpObject {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpObject() {}
|
|
|
|
virtual ~MinidumpObject() = default;
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
explicit MinidumpObject(Minidump* minidump);
|
|
|
|
explicit MinidumpObject(Minidump* minidump);
|
|
|
@ -136,7 +135,9 @@ class MinidumpObject : public DumpObject {
|
|
|
|
// same interface, and may be derived from this class.
|
|
|
|
// same interface, and may be derived from this class.
|
|
|
|
class MinidumpStream : public MinidumpObject {
|
|
|
|
class MinidumpStream : public MinidumpObject {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpStream() {}
|
|
|
|
MinidumpStream(const MinidumpStream&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpStream&) = delete;
|
|
|
|
|
|
|
|
~MinidumpStream() override = default;
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
explicit MinidumpStream(Minidump* minidump);
|
|
|
|
explicit MinidumpStream(Minidump* minidump);
|
|
|
@ -150,8 +151,6 @@ class MinidumpStream : public MinidumpObject {
|
|
|
|
// that implements MinidumpStream can compare expected_size to a
|
|
|
|
// that implements MinidumpStream can compare expected_size to a
|
|
|
|
// known size as an integrity check.
|
|
|
|
// known size as an integrity check.
|
|
|
|
virtual bool Read(uint32_t expected_size) = 0;
|
|
|
|
virtual bool Read(uint32_t expected_size) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpStream);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -167,7 +166,9 @@ class MinidumpStream : public MinidumpObject {
|
|
|
|
// user wants).
|
|
|
|
// user wants).
|
|
|
|
class MinidumpContext : public DumpContext {
|
|
|
|
class MinidumpContext : public DumpContext {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpContext();
|
|
|
|
MinidumpContext(const MinidumpContext&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpContext&) = delete;
|
|
|
|
|
|
|
|
~MinidumpContext() override;
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
explicit MinidumpContext(Minidump* minidump);
|
|
|
|
explicit MinidumpContext(Minidump* minidump);
|
|
|
@ -192,8 +193,6 @@ class MinidumpContext : public DumpContext {
|
|
|
|
// for access to data about the minidump file itself, such as whether
|
|
|
|
// for access to data about the minidump file itself, such as whether
|
|
|
|
// it should be byte-swapped.
|
|
|
|
// it should be byte-swapped.
|
|
|
|
Minidump* minidump_;
|
|
|
|
Minidump* minidump_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpContext);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -208,7 +207,7 @@ class MinidumpContext : public DumpContext {
|
|
|
|
class MinidumpMemoryRegion : public MinidumpObject,
|
|
|
|
class MinidumpMemoryRegion : public MinidumpObject,
|
|
|
|
public MemoryRegion {
|
|
|
|
public MemoryRegion {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpMemoryRegion();
|
|
|
|
~MinidumpMemoryRegion() override;
|
|
|
|
|
|
|
|
|
|
|
|
static void set_max_bytes(uint32_t max_bytes) { max_bytes_ = max_bytes; }
|
|
|
|
static void set_max_bytes(uint32_t max_bytes) { max_bytes_ = max_bytes; }
|
|
|
|
static uint32_t max_bytes() { return max_bytes_; }
|
|
|
|
static uint32_t max_bytes() { return max_bytes_; }
|
|
|
@ -219,22 +218,22 @@ class MinidumpMemoryRegion : public MinidumpObject,
|
|
|
|
const uint8_t* GetMemory() const;
|
|
|
|
const uint8_t* GetMemory() const;
|
|
|
|
|
|
|
|
|
|
|
|
// The address of the base of the memory region.
|
|
|
|
// The address of the base of the memory region.
|
|
|
|
uint64_t GetBase() const;
|
|
|
|
uint64_t GetBase() const override;
|
|
|
|
|
|
|
|
|
|
|
|
// The size, in bytes, of the memory region.
|
|
|
|
// The size, in bytes, of the memory region.
|
|
|
|
uint32_t GetSize() const;
|
|
|
|
uint32_t GetSize() const override;
|
|
|
|
|
|
|
|
|
|
|
|
// Frees the cached memory region, if cached.
|
|
|
|
// Frees the cached memory region, if cached.
|
|
|
|
void FreeMemory();
|
|
|
|
void FreeMemory();
|
|
|
|
|
|
|
|
|
|
|
|
// Obtains the value of memory at the pointer specified by address.
|
|
|
|
// Obtains the value of memory at the pointer specified by address.
|
|
|
|
bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const;
|
|
|
|
bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const override;
|
|
|
|
bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const;
|
|
|
|
bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const override;
|
|
|
|
bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const;
|
|
|
|
bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const override;
|
|
|
|
bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const;
|
|
|
|
bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const override;
|
|
|
|
|
|
|
|
|
|
|
|
// Print a human-readable representation of the object to stdout.
|
|
|
|
// Print a human-readable representation of the object to stdout.
|
|
|
|
void Print() const;
|
|
|
|
void Print() const override;
|
|
|
|
void SetPrintMode(bool hexdump, unsigned int width);
|
|
|
|
void SetPrintMode(bool hexdump, unsigned int width);
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
@ -277,9 +276,9 @@ class MinidumpMemoryRegion : public MinidumpObject,
|
|
|
|
// contain a memory region or context.
|
|
|
|
// contain a memory region or context.
|
|
|
|
class MinidumpThread : public MinidumpObject {
|
|
|
|
class MinidumpThread : public MinidumpObject {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpThread();
|
|
|
|
~MinidumpThread() override;
|
|
|
|
|
|
|
|
|
|
|
|
const MDRawThread* thread() const { return valid_ ? &thread_ : NULL; }
|
|
|
|
const MDRawThread* thread() const { return valid_ ? &thread_ : nullptr; }
|
|
|
|
// GetMemory may return NULL even if the MinidumpThread is valid,
|
|
|
|
// GetMemory may return NULL even if the MinidumpThread is valid,
|
|
|
|
// if the thread memory cannot be read.
|
|
|
|
// if the thread memory cannot be read.
|
|
|
|
virtual MinidumpMemoryRegion* GetMemory();
|
|
|
|
virtual MinidumpMemoryRegion* GetMemory();
|
|
|
@ -322,7 +321,9 @@ class MinidumpThread : public MinidumpObject {
|
|
|
|
// a process.
|
|
|
|
// a process.
|
|
|
|
class MinidumpThreadList : public MinidumpStream {
|
|
|
|
class MinidumpThreadList : public MinidumpStream {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpThreadList();
|
|
|
|
MinidumpThreadList(const MinidumpThreadList&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpThreadList&) = delete;
|
|
|
|
|
|
|
|
~MinidumpThreadList() override;
|
|
|
|
|
|
|
|
|
|
|
|
static void set_max_threads(uint32_t max_threads) {
|
|
|
|
static void set_max_threads(uint32_t max_threads) {
|
|
|
|
max_threads_ = max_threads;
|
|
|
|
max_threads_ = max_threads;
|
|
|
@ -364,18 +365,16 @@ class MinidumpThreadList : public MinidumpStream {
|
|
|
|
|
|
|
|
|
|
|
|
// The list of threads.
|
|
|
|
// The list of threads.
|
|
|
|
MinidumpThreads* threads_;
|
|
|
|
MinidumpThreads* threads_;
|
|
|
|
uint32_t thread_count_;
|
|
|
|
uint32_t thread_count_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpThreadList);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// MinidumpThreadName contains the name of a thread.
|
|
|
|
// MinidumpThreadName contains the name of a thread.
|
|
|
|
class MinidumpThreadName : public MinidumpObject {
|
|
|
|
class MinidumpThreadName : public MinidumpObject {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpThreadName();
|
|
|
|
~MinidumpThreadName() override;
|
|
|
|
|
|
|
|
|
|
|
|
const MDRawThreadName* thread_name() const {
|
|
|
|
const MDRawThreadName* thread_name() const {
|
|
|
|
return valid_ ? &thread_name_ : NULL;
|
|
|
|
return valid_ ? &thread_name_ : nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Gets the thread ID.
|
|
|
|
// Gets the thread ID.
|
|
|
@ -419,7 +418,9 @@ class MinidumpThreadName : public MinidumpObject {
|
|
|
|
// MinidumpThreadNames) in a process.
|
|
|
|
// MinidumpThreadNames) in a process.
|
|
|
|
class MinidumpThreadNameList : public MinidumpStream {
|
|
|
|
class MinidumpThreadNameList : public MinidumpStream {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpThreadNameList();
|
|
|
|
MinidumpThreadNameList(const MinidumpThreadNameList&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpThreadNameList&) = delete;
|
|
|
|
|
|
|
|
~MinidumpThreadNameList() override;
|
|
|
|
|
|
|
|
|
|
|
|
virtual unsigned int thread_name_count() const {
|
|
|
|
virtual unsigned int thread_name_count() const {
|
|
|
|
return valid_ ? thread_name_count_ : 0;
|
|
|
|
return valid_ ? thread_name_count_ : 0;
|
|
|
@ -446,8 +447,6 @@ class MinidumpThreadNameList : public MinidumpStream {
|
|
|
|
// The list of thread names.
|
|
|
|
// The list of thread names.
|
|
|
|
MinidumpThreadNames* thread_names_;
|
|
|
|
MinidumpThreadNames* thread_names_;
|
|
|
|
uint32_t thread_name_count_;
|
|
|
|
uint32_t thread_name_count_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpThreadNameList);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// MinidumpModule wraps MDRawModule, which contains information about loaded
|
|
|
|
// MinidumpModule wraps MDRawModule, which contains information about loaded
|
|
|
@ -457,7 +456,7 @@ class MinidumpThreadNameList : public MinidumpStream {
|
|
|
|
class MinidumpModule : public MinidumpObject,
|
|
|
|
class MinidumpModule : public MinidumpObject,
|
|
|
|
public CodeModule {
|
|
|
|
public CodeModule {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpModule();
|
|
|
|
~MinidumpModule() override;
|
|
|
|
|
|
|
|
|
|
|
|
static void set_max_cv_bytes(uint32_t max_cv_bytes) {
|
|
|
|
static void set_max_cv_bytes(uint32_t max_cv_bytes) {
|
|
|
|
max_cv_bytes_ = max_cv_bytes;
|
|
|
|
max_cv_bytes_ = max_cv_bytes;
|
|
|
@ -469,27 +468,27 @@ class MinidumpModule : public MinidumpObject,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static uint32_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; }
|
|
|
|
const MDRawModule* module() const { return valid_ ? &module_ : nullptr; }
|
|
|
|
|
|
|
|
|
|
|
|
// CodeModule implementation
|
|
|
|
// CodeModule implementation
|
|
|
|
virtual uint64_t base_address() const {
|
|
|
|
uint64_t base_address() const override {
|
|
|
|
return valid_ ? module_.base_of_image : static_cast<uint64_t>(-1);
|
|
|
|
return valid_ ? module_.base_of_image : static_cast<uint64_t>(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
virtual uint64_t size() const { return valid_ ? module_.size_of_image : 0; }
|
|
|
|
uint64_t size() const override { return valid_ ? module_.size_of_image : 0; }
|
|
|
|
virtual string code_file() const;
|
|
|
|
string code_file() const override;
|
|
|
|
virtual string code_identifier() const;
|
|
|
|
string code_identifier() const override;
|
|
|
|
virtual string debug_file() const;
|
|
|
|
string debug_file() const override;
|
|
|
|
virtual string debug_identifier() const;
|
|
|
|
string debug_identifier() const override;
|
|
|
|
virtual string version() const;
|
|
|
|
string version() const override;
|
|
|
|
virtual CodeModule* Copy() const;
|
|
|
|
CodeModule* Copy() const override;
|
|
|
|
virtual bool is_unloaded() const { return false; }
|
|
|
|
bool is_unloaded() const override { return false; }
|
|
|
|
|
|
|
|
|
|
|
|
// Getter and setter for shrink_down_delta. This is used when the address
|
|
|
|
// Getter and setter for shrink_down_delta. This is used when the address
|
|
|
|
// range for a module is shrunk down due to address range conflicts with
|
|
|
|
// range for a module is shrunk down due to address range conflicts with
|
|
|
|
// other modules. The base_address and size fields are not updated and they
|
|
|
|
// other modules. The base_address and size fields are not updated and they
|
|
|
|
// should always reflect the original values (reported in the minidump).
|
|
|
|
// should always reflect the original values (reported in the minidump).
|
|
|
|
virtual uint64_t shrink_down_delta() const;
|
|
|
|
uint64_t shrink_down_delta() const override;
|
|
|
|
virtual void SetShrinkDownDelta(uint64_t shrink_down_delta);
|
|
|
|
void SetShrinkDownDelta(uint64_t shrink_down_delta) override;
|
|
|
|
|
|
|
|
|
|
|
|
// The CodeView record, which contains information to locate the module's
|
|
|
|
// The CodeView record, which contains information to locate the module's
|
|
|
|
// debugging information (pdb). This is returned as uint8_t* because
|
|
|
|
// debugging information (pdb). This is returned as uint8_t* because
|
|
|
@ -580,7 +579,9 @@ class MinidumpModule : public MinidumpObject,
|
|
|
|
class MinidumpModuleList : public MinidumpStream,
|
|
|
|
class MinidumpModuleList : public MinidumpStream,
|
|
|
|
public CodeModules {
|
|
|
|
public CodeModules {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpModuleList();
|
|
|
|
MinidumpModuleList(const MinidumpModuleList&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpModuleList&) = delete;
|
|
|
|
|
|
|
|
~MinidumpModuleList() override;
|
|
|
|
|
|
|
|
|
|
|
|
static void set_max_modules(uint32_t max_modules) {
|
|
|
|
static void set_max_modules(uint32_t max_modules) {
|
|
|
|
max_modules_ = max_modules;
|
|
|
|
max_modules_ = max_modules;
|
|
|
@ -588,19 +589,19 @@ class MinidumpModuleList : public MinidumpStream,
|
|
|
|
static uint32_t max_modules() { return max_modules_; }
|
|
|
|
static uint32_t max_modules() { return max_modules_; }
|
|
|
|
|
|
|
|
|
|
|
|
// CodeModules implementation.
|
|
|
|
// CodeModules implementation.
|
|
|
|
virtual unsigned int module_count() const {
|
|
|
|
unsigned int module_count() const override {
|
|
|
|
return valid_ ? module_count_ : 0;
|
|
|
|
return valid_ ? module_count_ : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
virtual const MinidumpModule* GetModuleForAddress(uint64_t address) const;
|
|
|
|
const MinidumpModule* GetModuleForAddress(uint64_t address) const override;
|
|
|
|
virtual const MinidumpModule* GetMainModule() const;
|
|
|
|
const MinidumpModule* GetMainModule() const override;
|
|
|
|
virtual const MinidumpModule* GetModuleAtSequence(
|
|
|
|
const MinidumpModule* GetModuleAtSequence(
|
|
|
|
unsigned int sequence) const;
|
|
|
|
unsigned int sequence) const override;
|
|
|
|
virtual const MinidumpModule* GetModuleAtIndex(unsigned int index) const;
|
|
|
|
const MinidumpModule* GetModuleAtIndex(unsigned int index) const override;
|
|
|
|
virtual const CodeModules* Copy() const;
|
|
|
|
const CodeModules* Copy() const override;
|
|
|
|
|
|
|
|
|
|
|
|
// Returns a vector of all modules which address ranges needed to be shrunk
|
|
|
|
// Returns a vector of all modules which address ranges needed to be shrunk
|
|
|
|
// down due to address range conflicts with other modules.
|
|
|
|
// down due to address range conflicts with other modules.
|
|
|
|
virtual vector<linked_ptr<const CodeModule> > GetShrunkRangeModules() const;
|
|
|
|
vector<linked_ptr<const CodeModule>> GetShrunkRangeModules() const override;
|
|
|
|
|
|
|
|
|
|
|
|
// Print a human-readable representation of the object to stdout.
|
|
|
|
// Print a human-readable representation of the object to stdout.
|
|
|
|
void Print();
|
|
|
|
void Print();
|
|
|
@ -615,7 +616,7 @@ class MinidumpModuleList : public MinidumpStream,
|
|
|
|
|
|
|
|
|
|
|
|
static const uint32_t kStreamType = MD_MODULE_LIST_STREAM;
|
|
|
|
static const uint32_t kStreamType = MD_MODULE_LIST_STREAM;
|
|
|
|
|
|
|
|
|
|
|
|
bool Read(uint32_t expected_size);
|
|
|
|
bool Read(uint32_t expected_size) override;
|
|
|
|
|
|
|
|
|
|
|
|
bool StoreRange(const MinidumpModule& module,
|
|
|
|
bool StoreRange(const MinidumpModule& module,
|
|
|
|
uint64_t base_address,
|
|
|
|
uint64_t base_address,
|
|
|
@ -632,8 +633,6 @@ class MinidumpModuleList : public MinidumpStream,
|
|
|
|
|
|
|
|
|
|
|
|
MinidumpModules* modules_;
|
|
|
|
MinidumpModules* modules_;
|
|
|
|
uint32_t module_count_;
|
|
|
|
uint32_t module_count_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleList);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -648,7 +647,9 @@ class MinidumpModuleList : public MinidumpStream,
|
|
|
|
// memory minidumps contain all of a process' mapped memory.
|
|
|
|
// memory minidumps contain all of a process' mapped memory.
|
|
|
|
class MinidumpMemoryList : public MinidumpStream {
|
|
|
|
class MinidumpMemoryList : public MinidumpStream {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpMemoryList();
|
|
|
|
MinidumpMemoryList(const MinidumpMemoryList&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpMemoryList&) = delete;
|
|
|
|
|
|
|
|
~MinidumpMemoryList() override;
|
|
|
|
|
|
|
|
|
|
|
|
static void set_max_regions(uint32_t max_regions) {
|
|
|
|
static void set_max_regions(uint32_t max_regions) {
|
|
|
|
max_regions_ = max_regions;
|
|
|
|
max_regions_ = max_regions;
|
|
|
@ -696,8 +697,6 @@ class MinidumpMemoryList : public MinidumpStream {
|
|
|
|
// The list of regions.
|
|
|
|
// The list of regions.
|
|
|
|
MemoryRegions* regions_;
|
|
|
|
MemoryRegions* regions_;
|
|
|
|
uint32_t region_count_;
|
|
|
|
uint32_t region_count_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryList);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -709,10 +708,12 @@ class MinidumpMemoryList : public MinidumpStream {
|
|
|
|
// occurred.
|
|
|
|
// occurred.
|
|
|
|
class MinidumpException : public MinidumpStream {
|
|
|
|
class MinidumpException : public MinidumpStream {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpException();
|
|
|
|
MinidumpException(const MinidumpException&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpException&) = delete;
|
|
|
|
|
|
|
|
~MinidumpException() override;
|
|
|
|
|
|
|
|
|
|
|
|
const MDRawExceptionStream* exception() const {
|
|
|
|
const MDRawExceptionStream* exception() const {
|
|
|
|
return valid_ ? &exception_ : NULL;
|
|
|
|
return valid_ ? &exception_ : nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// The thread ID is used to determine if a thread is the exception thread,
|
|
|
|
// The thread ID is used to determine if a thread is the exception thread,
|
|
|
@ -736,19 +737,19 @@ class MinidumpException : public MinidumpStream {
|
|
|
|
bool Read(uint32_t expected_size) override;
|
|
|
|
bool Read(uint32_t expected_size) override;
|
|
|
|
|
|
|
|
|
|
|
|
MDRawExceptionStream exception_;
|
|
|
|
MDRawExceptionStream exception_;
|
|
|
|
MinidumpContext* context_;
|
|
|
|
MinidumpContext* context_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpException);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// MinidumpAssertion wraps MDRawAssertionInfo, which contains information
|
|
|
|
// MinidumpAssertion wraps MDRawAssertionInfo, which contains information
|
|
|
|
// about an assertion that caused the minidump to be generated.
|
|
|
|
// about an assertion that caused the minidump to be generated.
|
|
|
|
class MinidumpAssertion : public MinidumpStream {
|
|
|
|
class MinidumpAssertion : public MinidumpStream {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpAssertion();
|
|
|
|
MinidumpAssertion(const MinidumpAssertion&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpAssertion&) = delete;
|
|
|
|
|
|
|
|
~MinidumpAssertion() override;
|
|
|
|
|
|
|
|
|
|
|
|
const MDRawAssertionInfo* assertion() const {
|
|
|
|
const MDRawAssertionInfo* assertion() const {
|
|
|
|
return valid_ ? &assertion_ : NULL;
|
|
|
|
return valid_ ? &assertion_ : nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string expression() const {
|
|
|
|
string expression() const {
|
|
|
@ -779,8 +780,6 @@ class MinidumpAssertion : public MinidumpStream {
|
|
|
|
string expression_;
|
|
|
|
string expression_;
|
|
|
|
string function_;
|
|
|
|
string function_;
|
|
|
|
string file_;
|
|
|
|
string file_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpAssertion);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -788,10 +787,12 @@ class MinidumpAssertion : public MinidumpStream {
|
|
|
|
// the system on which the minidump was generated. See also MinidumpMiscInfo.
|
|
|
|
// the system on which the minidump was generated. See also MinidumpMiscInfo.
|
|
|
|
class MinidumpSystemInfo : public MinidumpStream {
|
|
|
|
class MinidumpSystemInfo : public MinidumpStream {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpSystemInfo();
|
|
|
|
MinidumpSystemInfo(const MinidumpSystemInfo&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpSystemInfo&) = delete;
|
|
|
|
|
|
|
|
~MinidumpSystemInfo() override;
|
|
|
|
|
|
|
|
|
|
|
|
const MDRawSystemInfo* system_info() const {
|
|
|
|
const MDRawSystemInfo* system_info() const {
|
|
|
|
return valid_ ? &system_info_ : NULL;
|
|
|
|
return valid_ ? &system_info_ : nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetOS and GetCPU return textual representations of the operating system
|
|
|
|
// GetOS and GetCPU return textual representations of the operating system
|
|
|
@ -834,8 +835,6 @@ class MinidumpSystemInfo : public MinidumpStream {
|
|
|
|
|
|
|
|
|
|
|
|
// A string identifying the CPU vendor, if known.
|
|
|
|
// A string identifying the CPU vendor, if known.
|
|
|
|
const string* cpu_vendor_;
|
|
|
|
const string* cpu_vendor_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpSystemInfo);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -846,7 +845,7 @@ class MinidumpUnloadedModule : public MinidumpObject,
|
|
|
|
~MinidumpUnloadedModule() override;
|
|
|
|
~MinidumpUnloadedModule() override;
|
|
|
|
|
|
|
|
|
|
|
|
const MDRawUnloadedModule* module() const {
|
|
|
|
const MDRawUnloadedModule* module() const {
|
|
|
|
return valid_ ? &unloaded_module_ : NULL;
|
|
|
|
return valid_ ? &unloaded_module_ : nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CodeModule implementation
|
|
|
|
// CodeModule implementation
|
|
|
@ -903,6 +902,8 @@ class MinidumpUnloadedModule : public MinidumpObject,
|
|
|
|
class MinidumpUnloadedModuleList : public MinidumpStream,
|
|
|
|
class MinidumpUnloadedModuleList : public MinidumpStream,
|
|
|
|
public CodeModules {
|
|
|
|
public CodeModules {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
|
|
|
|
MinidumpUnloadedModuleList(const MinidumpUnloadedModuleList&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpUnloadedModuleList&) = delete;
|
|
|
|
~MinidumpUnloadedModuleList() override;
|
|
|
|
~MinidumpUnloadedModuleList() override;
|
|
|
|
|
|
|
|
|
|
|
|
static void set_max_modules(uint32_t max_modules) {
|
|
|
|
static void set_max_modules(uint32_t max_modules) {
|
|
|
@ -945,8 +946,6 @@ class MinidumpUnloadedModuleList : public MinidumpStream,
|
|
|
|
|
|
|
|
|
|
|
|
MinidumpUnloadedModules* unloaded_modules_;
|
|
|
|
MinidumpUnloadedModules* unloaded_modules_;
|
|
|
|
uint32_t module_count_;
|
|
|
|
uint32_t module_count_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpUnloadedModuleList);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -955,8 +954,11 @@ class MinidumpUnloadedModuleList : public MinidumpStream,
|
|
|
|
// information. See also MinidumpSystemInfo.
|
|
|
|
// information. See also MinidumpSystemInfo.
|
|
|
|
class MinidumpMiscInfo : public MinidumpStream {
|
|
|
|
class MinidumpMiscInfo : public MinidumpStream {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
|
|
|
|
MinidumpMiscInfo(const MinidumpMiscInfo&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpMiscInfo&) = delete;
|
|
|
|
|
|
|
|
|
|
|
|
const MDRawMiscInfo* misc_info() const {
|
|
|
|
const MDRawMiscInfo* misc_info() const {
|
|
|
|
return valid_ ? &misc_info_ : NULL;
|
|
|
|
return valid_ ? &misc_info_ : nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Print a human-readable representation of the object to stdout.
|
|
|
|
// Print a human-readable representation of the object to stdout.
|
|
|
@ -980,8 +982,6 @@ class MinidumpMiscInfo : public MinidumpStream {
|
|
|
|
string daylight_name_;
|
|
|
|
string daylight_name_;
|
|
|
|
string build_string_;
|
|
|
|
string build_string_;
|
|
|
|
string dbg_bld_str_;
|
|
|
|
string dbg_bld_str_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpMiscInfo);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -990,8 +990,11 @@ class MinidumpMiscInfo : public MinidumpStream {
|
|
|
|
// at the time the minidump was generated.
|
|
|
|
// at the time the minidump was generated.
|
|
|
|
class MinidumpBreakpadInfo : public MinidumpStream {
|
|
|
|
class MinidumpBreakpadInfo : public MinidumpStream {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
|
|
|
|
MinidumpBreakpadInfo(const MinidumpBreakpadInfo&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpBreakpadInfo&) = delete;
|
|
|
|
|
|
|
|
|
|
|
|
const MDRawBreakpadInfo* breakpad_info() const {
|
|
|
|
const MDRawBreakpadInfo* breakpad_info() const {
|
|
|
|
return valid_ ? &breakpad_info_ : NULL;
|
|
|
|
return valid_ ? &breakpad_info_ : nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// These thread IDs are used to determine if threads deserve special
|
|
|
|
// These thread IDs are used to determine if threads deserve special
|
|
|
@ -1014,8 +1017,6 @@ class MinidumpBreakpadInfo : public MinidumpStream {
|
|
|
|
bool Read(uint32_t expected_size_) override;
|
|
|
|
bool Read(uint32_t expected_size_) override;
|
|
|
|
|
|
|
|
|
|
|
|
MDRawBreakpadInfo breakpad_info_;
|
|
|
|
MDRawBreakpadInfo breakpad_info_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpBreakpadInfo);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// MinidumpMemoryInfo wraps MDRawMemoryInfo, which provides information
|
|
|
|
// MinidumpMemoryInfo wraps MDRawMemoryInfo, which provides information
|
|
|
@ -1023,7 +1024,9 @@ class MinidumpBreakpadInfo : public MinidumpStream {
|
|
|
|
// and protection.
|
|
|
|
// and protection.
|
|
|
|
class MinidumpMemoryInfo : public MinidumpObject {
|
|
|
|
class MinidumpMemoryInfo : public MinidumpObject {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
const MDRawMemoryInfo* info() const { return valid_ ? &memory_info_ : NULL; }
|
|
|
|
const MDRawMemoryInfo* info() const {
|
|
|
|
|
|
|
|
return valid_ ? &memory_info_ : nullptr;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// The address of the base of the memory region.
|
|
|
|
// The address of the base of the memory region.
|
|
|
|
uint64_t GetBase() const { return valid_ ? memory_info_.base_address : 0; }
|
|
|
|
uint64_t GetBase() const { return valid_ ? memory_info_.base_address : 0; }
|
|
|
@ -1060,7 +1063,9 @@ class MinidumpMemoryInfo : public MinidumpObject {
|
|
|
|
// info corresponding to a specific address.
|
|
|
|
// info corresponding to a specific address.
|
|
|
|
class MinidumpMemoryInfoList : public MinidumpStream {
|
|
|
|
class MinidumpMemoryInfoList : public MinidumpStream {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpMemoryInfoList();
|
|
|
|
MinidumpMemoryInfoList(const MinidumpMemoryInfoList&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpMemoryInfoList&) = delete;
|
|
|
|
|
|
|
|
~MinidumpMemoryInfoList() override;
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int info_count() const { return valid_ ? info_count_ : 0; }
|
|
|
|
unsigned int info_count() const { return valid_ ? info_count_ : 0; }
|
|
|
|
|
|
|
|
|
|
|
@ -1086,14 +1091,15 @@ class MinidumpMemoryInfoList : public MinidumpStream {
|
|
|
|
|
|
|
|
|
|
|
|
MinidumpMemoryInfos* infos_;
|
|
|
|
MinidumpMemoryInfos* infos_;
|
|
|
|
uint32_t info_count_;
|
|
|
|
uint32_t info_count_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryInfoList);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// MinidumpLinuxMaps wraps information about a single mapped memory region
|
|
|
|
// MinidumpLinuxMaps wraps information about a single mapped memory region
|
|
|
|
// from /proc/self/maps.
|
|
|
|
// from /proc/self/maps.
|
|
|
|
class MinidumpLinuxMaps : public MinidumpObject {
|
|
|
|
class MinidumpLinuxMaps : public MinidumpObject {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
|
|
|
|
MinidumpLinuxMaps(const MinidumpLinuxMaps&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpLinuxMaps&) = delete;
|
|
|
|
|
|
|
|
|
|
|
|
// The memory address of the base of the mapped region.
|
|
|
|
// The memory address of the base of the mapped region.
|
|
|
|
uint64_t GetBase() const { return valid_ ? region_.start : 0; }
|
|
|
|
uint64_t GetBase() const { return valid_ ? region_.start : 0; }
|
|
|
|
// The size of the mapped region.
|
|
|
|
// The size of the mapped region.
|
|
|
@ -1139,8 +1145,6 @@ class MinidumpLinuxMaps : public MinidumpObject {
|
|
|
|
|
|
|
|
|
|
|
|
// The memory region struct that this class wraps.
|
|
|
|
// The memory region struct that this class wraps.
|
|
|
|
MappedMemoryRegion region_;
|
|
|
|
MappedMemoryRegion region_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpLinuxMaps);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// MinidumpLinuxMapsList corresponds to the Linux-exclusive MD_LINUX_MAPS
|
|
|
|
// MinidumpLinuxMapsList corresponds to the Linux-exclusive MD_LINUX_MAPS
|
|
|
@ -1148,7 +1152,9 @@ class MinidumpLinuxMaps : public MinidumpObject {
|
|
|
|
// the mapped memory regions and their access permissions.
|
|
|
|
// the mapped memory regions and their access permissions.
|
|
|
|
class MinidumpLinuxMapsList : public MinidumpStream {
|
|
|
|
class MinidumpLinuxMapsList : public MinidumpStream {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~MinidumpLinuxMapsList();
|
|
|
|
MinidumpLinuxMapsList(const MinidumpLinuxMapsList&) = delete;
|
|
|
|
|
|
|
|
void operator=(const MinidumpLinuxMapsList&) = delete;
|
|
|
|
|
|
|
|
~MinidumpLinuxMapsList() override;
|
|
|
|
|
|
|
|
|
|
|
|
// Get number of mappings.
|
|
|
|
// Get number of mappings.
|
|
|
|
unsigned int get_maps_count() const { return valid_ ? maps_count_ : 0; }
|
|
|
|
unsigned int get_maps_count() const { return valid_ ? maps_count_ : 0; }
|
|
|
@ -1180,8 +1186,6 @@ class MinidumpLinuxMapsList : public MinidumpStream {
|
|
|
|
MinidumpLinuxMappings* maps_;
|
|
|
|
MinidumpLinuxMappings* maps_;
|
|
|
|
// The number of mappings.
|
|
|
|
// The number of mappings.
|
|
|
|
uint32_t maps_count_;
|
|
|
|
uint32_t maps_count_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MinidumpLinuxMapsList);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// MinidumpCrashpadInfo wraps MDRawCrashpadInfo, which is an optional stream in
|
|
|
|
// MinidumpCrashpadInfo wraps MDRawCrashpadInfo, which is an optional stream in
|
|
|
@ -1196,12 +1200,12 @@ class MinidumpCrashpadInfo : public MinidumpStream {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const MDRawCrashpadInfo* crashpad_info() const {
|
|
|
|
const MDRawCrashpadInfo* crashpad_info() const {
|
|
|
|
return valid_ ? &crashpad_info_ : NULL;
|
|
|
|
return valid_ ? &crashpad_info_ : nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const std::vector<std::vector<AnnotationObject>>*
|
|
|
|
const std::vector<std::vector<AnnotationObject>>*
|
|
|
|
GetModuleCrashpadInfoAnnotationObjects() const {
|
|
|
|
GetModuleCrashpadInfoAnnotationObjects() const {
|
|
|
|
return valid_ ? &module_crashpad_info_annotation_objects_ : NULL;
|
|
|
|
return valid_ ? &module_crashpad_info_annotation_objects_ : nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Print a human-readable representation of the object to stdout.
|
|
|
|
// Print a human-readable representation of the object to stdout.
|
|
|
@ -1242,6 +1246,9 @@ class Minidump {
|
|
|
|
// is valid as long as the Minidump object is.
|
|
|
|
// is valid as long as the Minidump object is.
|
|
|
|
explicit Minidump(std::istream& input);
|
|
|
|
explicit Minidump(std::istream& input);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Minidump(const Minidump&) = delete;
|
|
|
|
|
|
|
|
void operator=(const Minidump&) = delete;
|
|
|
|
|
|
|
|
|
|
|
|
virtual ~Minidump();
|
|
|
|
virtual ~Minidump();
|
|
|
|
|
|
|
|
|
|
|
|
// path may be empty if the minidump was not opened from a file
|
|
|
|
// path may be empty if the minidump was not opened from a file
|
|
|
@ -1258,7 +1265,9 @@ class Minidump {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static uint32_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; }
|
|
|
|
virtual const MDRawHeader* header() const {
|
|
|
|
|
|
|
|
return valid_ ? &header_ : nullptr;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Reads the CPU information from the system info stream and generates the
|
|
|
|
// Reads the CPU information from the system info stream and generates the
|
|
|
|
// appropriate CPU flags. The returned context_cpu_flags are the same as
|
|
|
|
// appropriate CPU flags. The returned context_cpu_flags are the same as
|
|
|
@ -1374,7 +1383,7 @@ class Minidump {
|
|
|
|
// the Minidump object locate interesting streams quickly, and
|
|
|
|
// the Minidump object locate interesting streams quickly, and
|
|
|
|
// provides a convenient place to stash MinidumpStream objects.
|
|
|
|
// provides a convenient place to stash MinidumpStream objects.
|
|
|
|
struct MinidumpStreamInfo {
|
|
|
|
struct MinidumpStreamInfo {
|
|
|
|
MinidumpStreamInfo() : stream_index(0), stream(NULL) {}
|
|
|
|
MinidumpStreamInfo() : stream_index(0), stream(nullptr) {}
|
|
|
|
~MinidumpStreamInfo() { delete stream; }
|
|
|
|
~MinidumpStreamInfo() { delete stream; }
|
|
|
|
|
|
|
|
|
|
|
|
// Index into the MinidumpDirectoryEntries vector
|
|
|
|
// Index into the MinidumpDirectoryEntries vector
|
|
|
@ -1436,8 +1445,6 @@ class Minidump {
|
|
|
|
// Knobs for controlling display of memory printing.
|
|
|
|
// Knobs for controlling display of memory printing.
|
|
|
|
bool hexdump_;
|
|
|
|
bool hexdump_;
|
|
|
|
unsigned int hexdump_width_;
|
|
|
|
unsigned int hexdump_width_;
|
|
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(Minidump);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|