From f944ba3fbb6136a14d47bf40f5cf1567ba3f8008 Mon Sep 17 00:00:00 2001 From: mmentovai Date: Thu, 26 Oct 2006 23:09:02 +0000 Subject: MinidumpProcessor uses the wrong context for non-crash threads (#62). r=bryner http://groups.google.com/group/airbag-dev/browse_thread/thread/74743a397c52b7e2 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@52 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/processor/minidump_processor.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index d783654d..9d1279bf 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -79,6 +79,8 @@ ProcessState* MinidumpProcessor::Process(const string &minidump_file) { return NULL; } + MinidumpContext *context = thread->GetContext(); + if (process_state->crashed_ && thread->GetThreadID() == exception_thread_id) { if (found_crash_thread) { @@ -86,6 +88,13 @@ ProcessState* MinidumpProcessor::Process(const string &minidump_file) { return NULL; } + // Use the exception record's context for the crashed thread, instead + // of the thread's own context. For the crashed thread, the thread's + // own context is the state inside the exception handler. Using it + // would not result in the expected stack trace from the time of the + // crash. + context = exception->GetContext(); + process_state->crash_thread_ = thread_index; found_crash_thread = true; } @@ -96,7 +105,7 @@ ProcessState* MinidumpProcessor::Process(const string &minidump_file) { } scoped_ptr stackwalker( - Stackwalker::StackwalkerForCPU(exception->GetContext(), + Stackwalker::StackwalkerForCPU(context, thread_memory, dump.GetModuleList(), supplier_)); -- cgit v1.2.1