| Index: minidump/minidump_exception_writer.cc
|
| diff --git a/minidump/minidump_exception_writer.cc b/minidump/minidump_exception_writer.cc
|
| index 2f39497b48f2e6eab5f80dbbfadc62a313ad5769..b88f46aeffcff9937ea54a1f826d880c25def59e 100644
|
| --- a/minidump/minidump_exception_writer.cc
|
| +++ b/minidump/minidump_exception_writer.cc
|
| @@ -18,6 +18,7 @@
|
|
|
| #include "base/logging.h"
|
| #include "minidump/minidump_context_writer.h"
|
| +#include "snapshot/exception_snapshot.h"
|
| #include "util/file/file_writer.h"
|
|
|
| namespace crashpad {
|
| @@ -29,6 +30,26 @@ MinidumpExceptionWriter::MinidumpExceptionWriter()
|
| MinidumpExceptionWriter::~MinidumpExceptionWriter() {
|
| }
|
|
|
| +void MinidumpExceptionWriter::InitializeFromSnapshot(
|
| + const ExceptionSnapshot* exception_snapshot,
|
| + const MinidumpThreadIDMap* thread_id_map) {
|
| + DCHECK_EQ(state(), kStateMutable);
|
| + DCHECK(!context_);
|
| +
|
| + auto thread_id_it = thread_id_map->find(exception_snapshot->ThreadID());
|
| + DCHECK(thread_id_it != thread_id_map->end());
|
| + SetThreadID(thread_id_it->second);
|
| +
|
| + SetExceptionCode(exception_snapshot->Exception());
|
| + SetExceptionFlags(exception_snapshot->ExceptionInfo());
|
| + SetExceptionAddress(exception_snapshot->ExceptionAddress());
|
| + SetExceptionInformation(exception_snapshot->Codes());
|
| +
|
| + scoped_ptr<MinidumpContextWriter> context =
|
| + MinidumpContextWriter::CreateFromSnapshot(exception_snapshot->Context());
|
| + SetContext(context.Pass());
|
| +}
|
| +
|
| void MinidumpExceptionWriter::SetContext(
|
| scoped_ptr<MinidumpContextWriter> context) {
|
| DCHECK_EQ(state(), kStateMutable);
|
|
|