diff options
author | Lei Zhang <thestig@google.com> | 2018-04-02 22:29:08 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2018-04-03 16:35:14 +0000 |
commit | adcc90ddb8c9ebc13a4312116ad92d8628b691c3 (patch) | |
tree | dbbb720156554b0078598fcd612718b01d9eb912 /src/client/linux/minidump_writer/minidump_writer.cc | |
parent | Add missing header for free function (diff) | |
download | breakpad-adcc90ddb8c9ebc13a4312116ad92d8628b691c3.tar.xz |
Linux: Write out si_code for SIGBUS exceptions.
Store the information in the exception record's exception_information
field.
Change-Id: Ie215cae2f070fdab63c3d05cc1bc4fb4b7b095fa
Reviewed-on: https://chromium-review.googlesource.com/990799
Reviewed-by: Mark Mentovai <mark@chromium.org>
Diffstat (limited to 'src/client/linux/minidump_writer/minidump_writer.cc')
-rw-r--r-- | src/client/linux/minidump_writer/minidump_writer.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc index c7161434..cdf4bf65 100644 --- a/src/client/linux/minidump_writer/minidump_writer.cc +++ b/src/client/linux/minidump_writer/minidump_writer.cc @@ -702,15 +702,18 @@ class MinidumpWriter { TypedMDRVA<MDRawExceptionStream> exc(&minidump_writer_); if (!exc.Allocate()) return false; - my_memset(exc.get(), 0, sizeof(MDRawExceptionStream)); + + MDRawExceptionStream* stream = exc.get(); + my_memset(stream, 0, sizeof(MDRawExceptionStream)); dirent->stream_type = MD_EXCEPTION_STREAM; dirent->location = exc.location(); - exc.get()->thread_id = GetCrashThread(); - exc.get()->exception_record.exception_code = dumper_->crash_signal(); - exc.get()->exception_record.exception_address = dumper_->crash_address(); - exc.get()->thread_context = crashing_thread_context_; + stream->thread_id = GetCrashThread(); + stream->exception_record.exception_code = dumper_->crash_signal(); + stream->exception_record.exception_flags = dumper_->crash_signal_code(); + stream->exception_record.exception_address = dumper_->crash_address(); + stream->thread_context = crashing_thread_context_; return true; } @@ -1366,9 +1369,7 @@ bool WriteMinidumpImpl(const char* minidump_path, if (blob_size != sizeof(ExceptionHandler::CrashContext)) return false; context = reinterpret_cast<const ExceptionHandler::CrashContext*>(blob); - dumper.set_crash_address( - reinterpret_cast<uintptr_t>(context->siginfo.si_addr)); - dumper.set_crash_signal(context->siginfo.si_signo); + dumper.SetCrashInfoFromSigInfo(context->siginfo); dumper.set_crash_thread(context->tid); } MinidumpWriter writer(minidump_path, minidump_fd, context, mappings, |