gecko-dev/toolkit/crashreporter/breakpad-client/minidump_file_writer.h
Ted Mielczarek 08da42ee56 bug 1336548 - fork breakpad src/client into toolkit/crashreporter/breakpad-client. r=gsvelto
The client portion of Breakpad is unmaintained upstream for Windows and OS X,
since Chromium has switched to Crashpad there. The Linux client still gets
fixes, but they're essentially all for ChromeOS support so they're not very
useful to us. This patch forks what is currently in
toolkit/crashreporter/google-breakpad/src/client into
toolkit/crashreporter/breakpad-client so we can make changes in mozilla-central
as needed without upstreaming them to a dead upstream.

This patch also changes the update-breakpad script to remove the src/client
directory when updating to a newer Breakpad revision.

A followup patch will remove unused files from the forked copy.

MozReview-Commit-ID: Fj4o2XjjkkD

--HG--
rename : toolkit/crashreporter/google-breakpad/src/client/apple/Framework/BreakpadDefines.h => toolkit/crashreporter/breakpad-client/apple/Framework/BreakpadDefines.h
rename : toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.h => toolkit/crashreporter/breakpad-client/ios/Breakpad.h
rename : toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.mm => toolkit/crashreporter/breakpad-client/ios/Breakpad.mm
rename : toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.xcodeproj/project.pbxproj => toolkit/crashreporter/breakpad-client/ios/Breakpad.xcodeproj/project.pbxproj
rename : toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.h => toolkit/crashreporter/breakpad-client/ios/BreakpadController.h
rename : toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.mm => toolkit/crashreporter/breakpad-client/ios/BreakpadController.mm
rename : toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad_Prefix.pch => toolkit/crashreporter/breakpad-client/ios/Breakpad_Prefix.pch
rename : toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.h => toolkit/crashreporter/breakpad-client/ios/handler/ios_exception_minidump_generator.h
rename : toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm => toolkit/crashreporter/breakpad-client/ios/handler/ios_exception_minidump_generator.mm
rename : toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h => toolkit/crashreporter/breakpad-client/linux/crash_generation/client_info.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc => toolkit/crashreporter/breakpad-client/linux/crash_generation/crash_generation_client.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.h => toolkit/crashreporter/breakpad-client/linux/crash_generation/crash_generation_client.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc => toolkit/crashreporter/breakpad-client/linux/crash_generation/crash_generation_server.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.h => toolkit/crashreporter/breakpad-client/linux/crash_generation/crash_generation_server.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/data/linux-gate-amd.sym => toolkit/crashreporter/breakpad-client/linux/data/linux-gate-amd.sym
rename : toolkit/crashreporter/google-breakpad/src/client/linux/data/linux-gate-intel.sym => toolkit/crashreporter/breakpad-client/linux/data/linux-gate-intel.sym
rename : toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/mapping_info.h => toolkit/crashreporter/breakpad-client/linux/dump_writer_common/mapping_info.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h => toolkit/crashreporter/breakpad-client/linux/dump_writer_common/raw_context_cpu.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/thread_info.cc => toolkit/crashreporter/breakpad-client/linux/dump_writer_common/thread_info.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/thread_info.h => toolkit/crashreporter/breakpad-client/linux/dump_writer_common/thread_info.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc => toolkit/crashreporter/breakpad-client/linux/dump_writer_common/ucontext_reader.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.h => toolkit/crashreporter/breakpad-client/linux/dump_writer_common/ucontext_reader.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc => toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h => toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler_unittest.cc => toolkit/crashreporter/breakpad-client/linux/handler/exception_handler_unittest.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/handler/microdump_extra_info.h => toolkit/crashreporter/breakpad-client/linux/handler/microdump_extra_info.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.cc => toolkit/crashreporter/breakpad-client/linux/handler/minidump_descriptor.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.h => toolkit/crashreporter/breakpad-client/linux/handler/minidump_descriptor.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/log/log.cc => toolkit/crashreporter/breakpad-client/linux/log/log.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/log/log.h => toolkit/crashreporter/breakpad-client/linux/log/log.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer.cc => toolkit/crashreporter/breakpad-client/linux/microdump_writer/microdump_writer.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer.h => toolkit/crashreporter/breakpad-client/linux/microdump_writer/microdump_writer.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc => toolkit/crashreporter/breakpad-client/linux/microdump_writer/microdump_writer_unittest.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/cpu_set.h => toolkit/crashreporter/breakpad-client/linux/minidump_writer/cpu_set.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/cpu_set_unittest.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/cpu_set_unittest.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/directory_reader.h => toolkit/crashreporter/breakpad-client/linux/minidump_writer/directory_reader.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/directory_reader_unittest.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/directory_reader_unittest.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader.h => toolkit/crashreporter/breakpad-client/linux/minidump_writer/line_reader.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/line_reader_unittest.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_core_dumper.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.h => toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_core_dumper.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_core_dumper_unittest.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_dumper.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.h => toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_dumper.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_dumper_unittest_helper.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_ptrace_dumper.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.h => toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_ptrace_dumper.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.h => toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer_unittest.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer_unittest_utils.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.h => toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer_unittest_utils.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h => toolkit/crashreporter/breakpad-client/linux/minidump_writer/proc_cpuinfo_reader.h
rename : toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc => toolkit/crashreporter/breakpad-client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc
rename : toolkit/crashreporter/google-breakpad/src/client/linux/moz.build => toolkit/crashreporter/breakpad-client/linux/moz.build
rename : toolkit/crashreporter/google-breakpad/src/client/linux/sender/google_crash_report_sender.cc => toolkit/crashreporter/breakpad-client/linux/sender/google_crash_report_sender.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/Breakpad.xcodeproj/project.pbxproj => toolkit/crashreporter/breakpad-client/mac/Breakpad.xcodeproj/project.pbxproj
rename : toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.h => toolkit/crashreporter/breakpad-client/mac/Framework/Breakpad.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.mm => toolkit/crashreporter/breakpad-client/mac/Framework/Breakpad.mm
rename : toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad_Prefix.pch => toolkit/crashreporter/breakpad-client/mac/Framework/Breakpad_Prefix.pch
rename : toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Info.plist => toolkit/crashreporter/breakpad-client/mac/Framework/Info.plist
rename : toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.h => toolkit/crashreporter/breakpad-client/mac/Framework/OnDemandServer.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.mm => toolkit/crashreporter/breakpad-client/mac/Framework/OnDemandServer.mm
rename : toolkit/crashreporter/google-breakpad/src/client/mac/UnitTests-Info.plist => toolkit/crashreporter/breakpad-client/mac/UnitTests-Info.plist
rename : toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/ConfigFile.h => toolkit/crashreporter/breakpad-client/mac/crash_generation/ConfigFile.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/ConfigFile.mm => toolkit/crashreporter/breakpad-client/mac/crash_generation/ConfigFile.mm
rename : toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.h => toolkit/crashreporter/breakpad-client/mac/crash_generation/Inspector.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.mm => toolkit/crashreporter/breakpad-client/mac/crash_generation/Inspector.mm
rename : toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/InspectorMain.mm => toolkit/crashreporter/breakpad-client/mac/crash_generation/InspectorMain.mm
rename : toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/client_info.h => toolkit/crashreporter/breakpad-client/mac/crash_generation/client_info.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.cc => toolkit/crashreporter/breakpad-client/mac/crash_generation/crash_generation_client.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.h => toolkit/crashreporter/breakpad-client/mac/crash_generation/crash_generation_client.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.cc => toolkit/crashreporter/breakpad-client/mac/crash_generation/crash_generation_server.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.h => toolkit/crashreporter/breakpad-client/mac/crash_generation/crash_generation_server.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build => toolkit/crashreporter/breakpad-client/mac/crash_generation/moz.build
rename : toolkit/crashreporter/google-breakpad/src/client/mac/gcov/libgcov.a => toolkit/crashreporter/breakpad-client/mac/gcov/libgcov.a
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.cc => toolkit/crashreporter/breakpad-client/mac/handler/breakpad_nlist_64.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.h => toolkit/crashreporter/breakpad-client/mac/handler/breakpad_nlist_64.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.cc => toolkit/crashreporter/breakpad-client/mac/handler/dynamic_images.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.h => toolkit/crashreporter/breakpad-client/mac/handler/dynamic_images.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc => toolkit/crashreporter/breakpad-client/mac/handler/exception_handler.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.h => toolkit/crashreporter/breakpad-client/mac/handler/exception_handler.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/mach_vm_compat.h => toolkit/crashreporter/breakpad-client/mac/handler/mach_vm_compat.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.cc => toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.h => toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj => toolkit/crashreporter/breakpad-client/mac/handler/minidump_test.xcodeproj/project.pbxproj
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_tests32-Info.plist => toolkit/crashreporter/breakpad-client/mac/handler/minidump_tests32-Info.plist
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_tests64-Info.plist => toolkit/crashreporter/breakpad-client/mac/handler/minidump_tests64-Info.plist
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build => toolkit/crashreporter/breakpad-client/mac/handler/moz.build
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/obj-cTestCases-Info.plist => toolkit/crashreporter/breakpad-client/mac/handler/obj-cTestCases-Info.plist
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.cc => toolkit/crashreporter/breakpad-client/mac/handler/protected_memory_allocator.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.h => toolkit/crashreporter/breakpad-client/mac/handler/protected_memory_allocator.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/DynamicImagesTests.cc => toolkit/crashreporter/breakpad-client/mac/handler/testcases/DynamicImagesTests.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/DynamicImagesTests.h => toolkit/crashreporter/breakpad-client/mac/handler/testcases/DynamicImagesTests.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.cc => toolkit/crashreporter/breakpad-client/mac/handler/testcases/breakpad_nlist_test.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.h => toolkit/crashreporter/breakpad-client/mac/handler/testcases/breakpad_nlist_test.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/dwarftests.h => toolkit/crashreporter/breakpad-client/mac/handler/testcases/dwarftests.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/dwarftests.mm => toolkit/crashreporter/breakpad-client/mac/handler/testcases/dwarftests.mm
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/testdata/dump_syms_dwarf_data => toolkit/crashreporter/breakpad-client/mac/handler/testcases/testdata/dump_syms_dwarf_data
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/testdata/dump_syms_i386_breakpad.sym => toolkit/crashreporter/breakpad-client/mac/handler/testcases/testdata/dump_syms_i386_breakpad.sym
rename : toolkit/crashreporter/google-breakpad/src/client/mac/handler/ucontext_compat.h => toolkit/crashreporter/breakpad-client/mac/handler/ucontext_compat.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/Breakpad.xib => toolkit/crashreporter/breakpad-client/mac/sender/Breakpad.xib
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/English.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/sender/English.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/English.lproj/Localizable.strings => toolkit/crashreporter/breakpad-client/mac/sender/English.lproj/Localizable.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/ReporterIcon.graffle => toolkit/crashreporter/breakpad-client/mac/sender/ReporterIcon.graffle
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender-Info.plist => toolkit/crashreporter/breakpad-client/mac/sender/crash_report_sender-Info.plist
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.h => toolkit/crashreporter/breakpad-client/mac/sender/crash_report_sender.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.icns => toolkit/crashreporter/breakpad-client/mac/sender/crash_report_sender.icns
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.m => toolkit/crashreporter/breakpad-client/mac/sender/crash_report_sender.m
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/sender/da.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/Localizable.strings => toolkit/crashreporter/breakpad-client/mac/sender/da.lproj/Localizable.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/sender/de.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/Localizable.strings => toolkit/crashreporter/breakpad-client/mac/sender/de.lproj/Localizable.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/sender/es.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/Localizable.strings => toolkit/crashreporter/breakpad-client/mac/sender/es.lproj/Localizable.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/sender/fr.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/Localizable.strings => toolkit/crashreporter/breakpad-client/mac/sender/fr.lproj/Localizable.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/goArrow.png => toolkit/crashreporter/breakpad-client/mac/sender/goArrow.png
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/sender/it.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/Localizable.strings => toolkit/crashreporter/breakpad-client/mac/sender/it.lproj/Localizable.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/sender/ja.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/Localizable.strings => toolkit/crashreporter/breakpad-client/mac/sender/ja.lproj/Localizable.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/nl.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/sender/nl.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/nl.lproj/Localizable.strings => toolkit/crashreporter/breakpad-client/mac/sender/nl.lproj/Localizable.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/no.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/sender/no.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/no.lproj/Localizable.strings => toolkit/crashreporter/breakpad-client/mac/sender/no.lproj/Localizable.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/sender/sl.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/Localizable.strings => toolkit/crashreporter/breakpad-client/mac/sender/sl.lproj/Localizable.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/sender/sv.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/Localizable.strings => toolkit/crashreporter/breakpad-client/mac/sender/sv.lproj/Localizable.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/tr.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/sender/tr.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/tr.lproj/Localizable.strings => toolkit/crashreporter/breakpad-client/mac/sender/tr.lproj/Localizable.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/uploader.h => toolkit/crashreporter/breakpad-client/mac/sender/uploader.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/sender/uploader.mm => toolkit/crashreporter/breakpad-client/mac/sender/uploader.mm
rename : toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.h => toolkit/crashreporter/breakpad-client/mac/testapp/Controller.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.m => toolkit/crashreporter/breakpad-client/mac/testapp/Controller.m
rename : toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/InfoPlist.strings => toolkit/crashreporter/breakpad-client/mac/testapp/English.lproj/InfoPlist.strings
rename : toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/MainMenu.xib => toolkit/crashreporter/breakpad-client/mac/testapp/English.lproj/MainMenu.xib
rename : toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Info.plist => toolkit/crashreporter/breakpad-client/mac/testapp/Info.plist
rename : toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.h => toolkit/crashreporter/breakpad-client/mac/testapp/TestClass.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.mm => toolkit/crashreporter/breakpad-client/mac/testapp/TestClass.mm
rename : toolkit/crashreporter/google-breakpad/src/client/mac/testapp/bomb.icns => toolkit/crashreporter/breakpad-client/mac/testapp/bomb.icns
rename : toolkit/crashreporter/google-breakpad/src/client/mac/testapp/crashInMain => toolkit/crashreporter/breakpad-client/mac/testapp/crashInMain
rename : toolkit/crashreporter/google-breakpad/src/client/mac/testapp/crashduringload => toolkit/crashreporter/breakpad-client/mac/testapp/crashduringload
rename : toolkit/crashreporter/google-breakpad/src/client/mac/testapp/main.m => toolkit/crashreporter/breakpad-client/mac/testapp/main.m
rename : toolkit/crashreporter/google-breakpad/src/client/mac/tests/BreakpadFramework_Test.mm => toolkit/crashreporter/breakpad-client/mac/tests/BreakpadFramework_Test.mm
rename : toolkit/crashreporter/google-breakpad/src/client/mac/tests/crash_generation_server_test.cc => toolkit/crashreporter/breakpad-client/mac/tests/crash_generation_server_test.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/tests/exception_handler_test.cc => toolkit/crashreporter/breakpad-client/mac/tests/exception_handler_test.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/tests/minidump_generator_test.cc => toolkit/crashreporter/breakpad-client/mac/tests/minidump_generator_test.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/tests/minidump_generator_test_helper.cc => toolkit/crashreporter/breakpad-client/mac/tests/minidump_generator_test_helper.cc
rename : toolkit/crashreporter/google-breakpad/src/client/mac/tests/spawn_child_process.h => toolkit/crashreporter/breakpad-client/mac/tests/spawn_child_process.h
rename : toolkit/crashreporter/google-breakpad/src/client/mac/tests/testlogging.h => toolkit/crashreporter/breakpad-client/mac/tests/testlogging.h
rename : toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer-inl.h => toolkit/crashreporter/breakpad-client/minidump_file_writer-inl.h
rename : toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.cc => toolkit/crashreporter/breakpad-client/minidump_file_writer.cc
rename : toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.h => toolkit/crashreporter/breakpad-client/minidump_file_writer.h
rename : toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer_unittest.cc => toolkit/crashreporter/breakpad-client/minidump_file_writer_unittest.cc
rename : toolkit/crashreporter/google-breakpad/src/client/moz.build => toolkit/crashreporter/breakpad-client/moz.build
rename : toolkit/crashreporter/google-breakpad/src/client/solaris/handler/Makefile => toolkit/crashreporter/breakpad-client/solaris/handler/Makefile
rename : toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler.cc => toolkit/crashreporter/breakpad-client/solaris/handler/exception_handler.cc
rename : toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler.h => toolkit/crashreporter/breakpad-client/solaris/handler/exception_handler.h
rename : toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler_test.cc => toolkit/crashreporter/breakpad-client/solaris/handler/exception_handler_test.cc
rename : toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_generator.cc => toolkit/crashreporter/breakpad-client/solaris/handler/minidump_generator.cc
rename : toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_generator.h => toolkit/crashreporter/breakpad-client/solaris/handler/minidump_generator.h
rename : toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_test.cc => toolkit/crashreporter/breakpad-client/solaris/handler/minidump_test.cc
rename : toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build => toolkit/crashreporter/breakpad-client/solaris/handler/moz.build
rename : toolkit/crashreporter/google-breakpad/src/client/solaris/handler/solaris_lwp.cc => toolkit/crashreporter/breakpad-client/solaris/handler/solaris_lwp.cc
rename : toolkit/crashreporter/google-breakpad/src/client/solaris/handler/solaris_lwp.h => toolkit/crashreporter/breakpad-client/solaris/handler/solaris_lwp.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/breakpad_client.gyp => toolkit/crashreporter/breakpad-client/windows/breakpad_client.gyp
rename : toolkit/crashreporter/google-breakpad/src/client/windows/common/auto_critical_section.h => toolkit/crashreporter/breakpad-client/windows/common/auto_critical_section.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/common/ipc_protocol.h => toolkit/crashreporter/breakpad-client/windows/common/ipc_protocol.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/ReadMe.txt => toolkit/crashreporter/breakpad-client/windows/crash_generation/ReadMe.txt
rename : toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.cc => toolkit/crashreporter/breakpad-client/windows/crash_generation/client_info.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.h => toolkit/crashreporter/breakpad-client/windows/crash_generation/client_info.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation.gyp => toolkit/crashreporter/breakpad-client/windows/crash_generation/crash_generation.gyp
rename : toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.cc => toolkit/crashreporter/breakpad-client/windows/crash_generation/crash_generation_client.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.h => toolkit/crashreporter/breakpad-client/windows/crash_generation/crash_generation_client.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.cc => toolkit/crashreporter/breakpad-client/windows/crash_generation/crash_generation_server.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.h => toolkit/crashreporter/breakpad-client/windows/crash_generation/crash_generation_server.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/minidump_generator.cc => toolkit/crashreporter/breakpad-client/windows/crash_generation/minidump_generator.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/minidump_generator.h => toolkit/crashreporter/breakpad-client/windows/crash_generation/minidump_generator.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/objs.mozbuild => toolkit/crashreporter/breakpad-client/windows/crash_generation/objs.mozbuild
rename : toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.cc => toolkit/crashreporter/breakpad-client/windows/handler/exception_handler.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.gyp => toolkit/crashreporter/breakpad-client/windows/handler/exception_handler.gyp
rename : toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.h => toolkit/crashreporter/breakpad-client/windows/handler/exception_handler.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/handler/objs.mozbuild => toolkit/crashreporter/breakpad-client/windows/handler/objs.mozbuild
rename : toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.cc => toolkit/crashreporter/breakpad-client/windows/sender/crash_report_sender.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.gyp => toolkit/crashreporter/breakpad-client/windows/sender/crash_report_sender.gyp
rename : toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.h => toolkit/crashreporter/breakpad-client/windows/sender/crash_report_sender.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/sender/objs.mozbuild => toolkit/crashreporter/breakpad-client/windows/sender/objs.mozbuild
rename : toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/abstract_class.cc => toolkit/crashreporter/breakpad-client/windows/tests/crash_generation_app/abstract_class.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/abstract_class.h => toolkit/crashreporter/breakpad-client/windows/tests/crash_generation_app/abstract_class.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.cc => toolkit/crashreporter/breakpad-client/windows/tests/crash_generation_app/crash_generation_app.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp => toolkit/crashreporter/breakpad-client/windows/tests/crash_generation_app/crash_generation_app.gyp
rename : toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.h => toolkit/crashreporter/breakpad-client/windows/tests/crash_generation_app/crash_generation_app.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.ico => toolkit/crashreporter/breakpad-client/windows/tests/crash_generation_app/crash_generation_app.ico
rename : toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.rc => toolkit/crashreporter/breakpad-client/windows/tests/crash_generation_app/crash_generation_app.rc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/resource.h => toolkit/crashreporter/breakpad-client/windows/tests/crash_generation_app/resource.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/small.ico => toolkit/crashreporter/breakpad-client/windows/tests/crash_generation_app/small.ico
rename : toolkit/crashreporter/google-breakpad/src/client/windows/unittests/client_tests.gyp => toolkit/crashreporter/breakpad-client/windows/unittests/client_tests.gyp
rename : toolkit/crashreporter/google-breakpad/src/client/windows/unittests/crash_generation_server_test.cc => toolkit/crashreporter/breakpad-client/windows/unittests/crash_generation_server_test.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.cc => toolkit/crashreporter/breakpad-client/windows/unittests/dump_analysis.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.h => toolkit/crashreporter/breakpad-client/windows/unittests/dump_analysis.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_death_test.cc => toolkit/crashreporter/breakpad-client/windows/unittests/exception_handler_death_test.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_nesting_test.cc => toolkit/crashreporter/breakpad-client/windows/unittests/exception_handler_nesting_test.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.cc => toolkit/crashreporter/breakpad-client/windows/unittests/exception_handler_test.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.h => toolkit/crashreporter/breakpad-client/windows/unittests/exception_handler_test.h
rename : toolkit/crashreporter/google-breakpad/src/client/windows/unittests/minidump_test.cc => toolkit/crashreporter/breakpad-client/windows/unittests/minidump_test.cc
rename : toolkit/crashreporter/google-breakpad/src/client/windows/unittests/testing.gyp => toolkit/crashreporter/breakpad-client/windows/unittests/testing.gyp
extra : rebase_source : 24f82cf7110b18ae6d11cc3d7f73bd0855a4eec0
2017-02-08 06:45:38 -05:00

273 lines
9.4 KiB
C++

// Copyright (c) 2006, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// minidump_file_writer.h: Implements file-based minidump generation. It's
// intended to be used with the Google Breakpad open source crash handling
// project.
#ifndef CLIENT_MINIDUMP_FILE_WRITER_H__
#define CLIENT_MINIDUMP_FILE_WRITER_H__
#include <string>
#include "google_breakpad/common/minidump_format.h"
namespace google_breakpad {
class UntypedMDRVA;
template<typename MDType> class TypedMDRVA;
// The user of this class can Open() a file and add minidump streams, data, and
// strings using the definitions in minidump_format.h. Since this class is
// expected to be used in a situation where the current process may be
// damaged, it will not allocate heap memory.
// Sample usage:
// MinidumpFileWriter writer;
// writer.Open("/tmp/minidump.dmp");
// TypedMDRVA<MDRawHeader> header(&writer_);
// header.Allocate();
// header->get()->signature = MD_HEADER_SIGNATURE;
// :
// writer.Close();
//
// An alternative is to use SetFile and provide a file descriptor:
// MinidumpFileWriter writer;
// writer.SetFile(minidump_fd);
// TypedMDRVA<MDRawHeader> header(&writer_);
// header.Allocate();
// header->get()->signature = MD_HEADER_SIGNATURE;
// :
// writer.Close();
class MinidumpFileWriter {
public:
// Invalid MDRVA (Minidump Relative Virtual Address)
// returned on failed allocation
static const MDRVA kInvalidMDRVA;
MinidumpFileWriter();
~MinidumpFileWriter();
// Open |path| as the destination of the minidump data. If |path| already
// exists, then Open() will fail.
// Return true on success, or false on failure.
bool Open(const char *path);
// Sets the file descriptor |file| as the destination of the minidump data.
// Can be used as an alternative to Open() when a file descriptor is
// available.
// Note that |fd| is not closed when the instance of MinidumpFileWriter is
// destroyed.
void SetFile(const int file);
// Close the current file (that was either created when Open was called, or
// specified with SetFile).
// Return true on success, or false on failure.
bool Close();
// Copy the contents of |str| to a MDString and write it to the file.
// |str| is expected to be either UTF-16 or UTF-32 depending on the size
// of wchar_t.
// Maximum |length| of characters to copy from |str|, or specify 0 to use the
// entire NULL terminated string. Copying will stop at the first NULL.
// |location| the allocated location
// Return true on success, or false on failure
bool WriteString(const wchar_t *str, unsigned int length,
MDLocationDescriptor *location);
// Same as above, except with |str| as a UTF-8 string
bool WriteString(const char *str, unsigned int length,
MDLocationDescriptor *location);
// Write |size| bytes starting at |src| into the current position.
// Return true on success and set |output| to position, or false on failure
bool WriteMemory(const void *src, size_t size, MDMemoryDescriptor *output);
// Copies |size| bytes from |src| to |position|
// Return true on success, or false on failure
bool Copy(MDRVA position, const void *src, ssize_t size);
// Return the current position for writing to the minidump
inline MDRVA position() const { return position_; }
private:
friend class UntypedMDRVA;
// Allocates an area of |size| bytes.
// Returns the position of the allocation, or kInvalidMDRVA if it was
// unable to allocate the bytes.
MDRVA Allocate(size_t size);
// The file descriptor for the output file.
int file_;
// Whether |file_| should be closed when the instance is destroyed.
bool close_file_when_destroyed_;
// Current position in buffer
MDRVA position_;
// Current allocated size
size_t size_;
// Copy |length| characters from |str| to |mdstring|. These are distinct
// because the underlying MDString is a UTF-16 based string. The wchar_t
// variant may need to create a MDString that has more characters than the
// source |str|, whereas the UTF-8 variant may coalesce characters to form
// a single UTF-16 character.
bool CopyStringToMDString(const wchar_t *str, unsigned int length,
TypedMDRVA<MDString> *mdstring);
bool CopyStringToMDString(const char *str, unsigned int length,
TypedMDRVA<MDString> *mdstring);
// The common templated code for writing a string
template <typename CharType>
bool WriteStringCore(const CharType *str, unsigned int length,
MDLocationDescriptor *location);
};
// Represents an untyped allocated chunk
class UntypedMDRVA {
public:
explicit UntypedMDRVA(MinidumpFileWriter *writer)
: writer_(writer),
position_(writer->position()),
size_(0) {}
// Allocates |size| bytes. Must not call more than once.
// Return true on success, or false on failure
bool Allocate(size_t size);
// Returns the current position or kInvalidMDRVA if allocation failed
inline MDRVA position() const { return position_; }
// Number of bytes allocated
inline size_t size() const { return size_; }
// Return size and position
inline MDLocationDescriptor location() const {
MDLocationDescriptor location = { static_cast<uint32_t>(size_),
position_ };
return location;
}
// Copy |size| bytes starting at |src| into the minidump at |position|
// Return true on success, or false on failure
bool Copy(MDRVA position, const void *src, size_t size);
// Copy |size| bytes from |src| to the current position
inline bool Copy(const void *src, size_t size) {
return Copy(position_, src, size);
}
protected:
// Writer we associate with
MinidumpFileWriter *writer_;
// Position of the start of the data
MDRVA position_;
// Allocated size
size_t size_;
};
// Represents a Minidump object chunk. Additional memory can be allocated at
// the end of the object as a:
// - single allocation
// - Array of MDType objects
// - A MDType object followed by an array
template<typename MDType>
class TypedMDRVA : public UntypedMDRVA {
public:
// Constructs an unallocated MDRVA
explicit TypedMDRVA(MinidumpFileWriter *writer)
: UntypedMDRVA(writer),
data_(),
allocation_state_(UNALLOCATED) {}
inline ~TypedMDRVA() {
// Ensure that the data_ object is written out
if (allocation_state_ != ARRAY)
Flush();
}
// Address of object data_ of MDType. This is not declared const as the
// typical usage will be to access the underlying |data_| object as to
// alter its contents.
MDType *get() { return &data_; }
// Allocates minidump_size<MDType>::size() bytes.
// Must not call more than once.
// Return true on success, or false on failure
bool Allocate();
// Allocates minidump_size<MDType>::size() + |additional| bytes.
// Must not call more than once.
// Return true on success, or false on failure
bool Allocate(size_t additional);
// Allocate an array of |count| elements of MDType.
// Must not call more than once.
// Return true on success, or false on failure
bool AllocateArray(size_t count);
// Allocate an array of |count| elements of |size| after object of MDType
// Must not call more than once.
// Return true on success, or false on failure
bool AllocateObjectAndArray(size_t count, size_t size);
// Copy |item| to |index|
// Must have been allocated using AllocateArray().
// Return true on success, or false on failure
bool CopyIndex(unsigned int index, MDType *item);
// Copy |size| bytes starting at |str| to |index|
// Must have been allocated using AllocateObjectAndArray().
// Return true on success, or false on failure
bool CopyIndexAfterObject(unsigned int index, const void *src, size_t size);
// Write data_
bool Flush();
private:
enum AllocationState {
UNALLOCATED = 0,
SINGLE_OBJECT,
ARRAY,
SINGLE_OBJECT_WITH_ARRAY
};
MDType data_;
AllocationState allocation_state_;
};
} // namespace google_breakpad
#endif // CLIENT_MINIDUMP_FILE_WRITER_H__