gecko-dev/toolkit/crashreporter/InjectCrashReporter.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

78 lines
2.6 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "InjectCrashReporter.h"
#include "nsDirectoryServiceUtils.h"
#include "nsDirectoryServiceDefs.h"
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 11:45:38 +00:00
#include "windows/crash_generation/crash_generation_client.h"
#include "nsExceptionHandler.h"
#include "LoadLibraryRemote.h"
#include "nsWindowsHelpers.h"
using CrashReporter::GetChildNotificationPipe;
using google_breakpad::CrashGenerationClient;
namespace mozilla {
InjectCrashRunnable::InjectCrashRunnable(DWORD pid)
: Runnable("InjectCrashRunnable"), mPID(pid) {
nsCOMPtr<nsIFile> dll;
nsresult rv = NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(dll));
if (NS_SUCCEEDED(rv)) {
dll->Append(u"breakpadinjector.dll"_ns);
dll->GetPath(mInjectorPath);
}
}
NS_IMETHODIMP
InjectCrashRunnable::Run() {
if (mInjectorPath.IsEmpty()) return NS_OK;
nsAutoHandle hProcess(OpenProcess(
PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_DUP_HANDLE |
PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_VM_READ,
FALSE, mPID));
if (!hProcess) {
NS_WARNING(
"Unable to open remote process handle for crashreporter injection.");
return NS_OK;
}
void* proc =
LoadRemoteLibraryAndGetAddress(hProcess, mInjectorPath.get(), "Start");
if (!proc) {
NS_WARNING("Unable to inject crashreporter DLL.");
return NS_OK;
}
HANDLE hRemotePipe = CrashGenerationClient::DuplicatePipeToClientProcess(
NS_ConvertASCIItoUTF16(GetChildNotificationPipe()).get(), hProcess);
if (INVALID_HANDLE_VALUE == hRemotePipe) {
NS_WARNING("Unable to duplicate crash reporter pipe to process.");
return NS_OK;
}
nsAutoHandle hThread(CreateRemoteThread(hProcess, nullptr, 0,
(LPTHREAD_START_ROUTINE)proc,
(void*)hRemotePipe, 0, nullptr));
if (!hThread) {
NS_WARNING("Unable to CreateRemoteThread");
// We have to close the remote pipe or else our crash generation client
// will be stuck unable to accept other remote requests.
HANDLE toClose = INVALID_HANDLE_VALUE;
if (DuplicateHandle(hProcess, hRemotePipe, ::GetCurrentProcess(), &toClose,
0, FALSE,
DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {
CloseHandle(toClose);
return NS_OK;
}
}
return NS_OK;
}
} // namespace mozilla