#include "minidump/minidump_context_writer.h"
#include <windows.h>
#include <dbghelp.h>
#include <stdint.h>
#include <string.h>
#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "build/build_config.h"
#include "snapshot/cpu_context.h"
#include "util/file/file_writer.h"
#include "util/stdlib/aligned_allocator.h"
namespace crashpad {
namespace {
static_assert …;
static_assert …;
#if BUILDFLAG(IS_WIN)
#if defined(ARCH_CPU_X86_FAMILY)
static_assert(sizeof(MinidumpContextX86) == sizeof(WOW64_CONTEXT),
"WOW64_CONTEXT size");
#if defined(ARCH_CPU_X86)
static_assert(sizeof(MinidumpContextX86) == sizeof(CONTEXT), "CONTEXT size");
#elif defined(ARCH_CPU_X86_64)
static_assert(sizeof(MinidumpContextAMD64) == sizeof(CONTEXT), "CONTEXT size");
#endif
#endif
#endif
}
MinidumpContextWriter::~MinidumpContextWriter() { … }
std::unique_ptr<MinidumpContextWriter>
MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) { … }
size_t MinidumpContextWriter::SizeOfObject() { … }
size_t MinidumpContextWriter::FreezeAndGetSizeOfObject() { … }
MinidumpContextX86Writer::MinidumpContextX86Writer()
: … { … }
MinidumpContextX86Writer::~MinidumpContextX86Writer() { … }
void MinidumpContextX86Writer::InitializeFromSnapshot(
const CPUContextX86* context_snapshot) { … }
bool MinidumpContextX86Writer::WriteObject(FileWriterInterface* file_writer) { … }
size_t MinidumpContextX86Writer::ContextSize() const { … }
static_assert …;
static_assert …;
MinidumpContextAMD64Writer::MinidumpContextAMD64Writer()
: … { … }
MinidumpContextAMD64Writer::~MinidumpContextAMD64Writer() { … }
void* MinidumpContextAMD64Writer::operator new(size_t size) { … }
void MinidumpContextAMD64Writer::operator delete(void* pointer) { … }
void MinidumpContextAMD64Writer::InitializeFromSnapshot(
const CPUContextX86_64* context_snapshot) { … }
size_t MinidumpContextAMD64Writer::Alignment() { … }
bool MinidumpContextAMD64Writer::WriteObject(FileWriterInterface* file_writer) { … }
size_t MinidumpContextAMD64Writer::ContextSize() const { … }
bool MinidumpXSaveAMD64CetU::InitializeFromSnapshot(
const CPUContextX86_64* context_snapshot) { … }
bool MinidumpXSaveAMD64CetU::Copy(void* dst) const { … }
MinidumpContextARMWriter::MinidumpContextARMWriter()
: … { … }
MinidumpContextARMWriter::~MinidumpContextARMWriter() = default;
void MinidumpContextARMWriter::InitializeFromSnapshot(
const CPUContextARM* context_snapshot) { … }
bool MinidumpContextARMWriter::WriteObject(FileWriterInterface* file_writer) { … }
size_t MinidumpContextARMWriter::ContextSize() const { … }
MinidumpContextARM64Writer::MinidumpContextARM64Writer()
: … { … }
MinidumpContextARM64Writer::~MinidumpContextARM64Writer() = default;
void MinidumpContextARM64Writer::InitializeFromSnapshot(
const CPUContextARM64* context_snapshot) { … }
bool MinidumpContextARM64Writer::WriteObject(FileWriterInterface* file_writer) { … }
size_t MinidumpContextARM64Writer::ContextSize() const { … }
MinidumpContextMIPSWriter::MinidumpContextMIPSWriter()
: … { … }
MinidumpContextMIPSWriter::~MinidumpContextMIPSWriter() = default;
void MinidumpContextMIPSWriter::InitializeFromSnapshot(
const CPUContextMIPS* context_snapshot) { … }
bool MinidumpContextMIPSWriter::WriteObject(FileWriterInterface* file_writer) { … }
size_t MinidumpContextMIPSWriter::ContextSize() const { … }
MinidumpContextMIPS64Writer::MinidumpContextMIPS64Writer()
: … { … }
MinidumpContextMIPS64Writer::~MinidumpContextMIPS64Writer() = default;
void MinidumpContextMIPS64Writer::InitializeFromSnapshot(
const CPUContextMIPS64* context_snapshot) { … }
bool MinidumpContextMIPS64Writer::WriteObject(
FileWriterInterface* file_writer) { … }
size_t MinidumpContextMIPS64Writer::ContextSize() const { … }
MinidumpContextRISCV64Writer::MinidumpContextRISCV64Writer()
: … { … }
MinidumpContextRISCV64Writer::~MinidumpContextRISCV64Writer() = default;
void MinidumpContextRISCV64Writer::InitializeFromSnapshot(
const CPUContextRISCV64* context_snapshot) { … }
bool MinidumpContextRISCV64Writer::WriteObject(
FileWriterInterface* file_writer) { … }
size_t MinidumpContextRISCV64Writer::ContextSize() const { … }
}