Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: minidump/minidump_exception_writer.cc

Issue 698673002: Add MinidumpExceptionWriter::InitializeFromSnapshot() and test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_init_from_snapshot_thread_new
Patch Set: Rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « minidump/minidump_exception_writer.h ('k') | minidump/minidump_exception_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « minidump/minidump_exception_writer.h ('k') | minidump/minidump_exception_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698