Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 769048 part C - Build an injector DLL which can watch for crashes…
… in Flash player processes. This involves building two copies of breakpad: one to live inside of libxul which uses mozalloc and the dynamic CRT, another to link into the injector which links the CRT statically and doesn't use mozalloc. Introduce a new define/makefile variable MOZ_CRASHREPORTER_INJECTOR rather than repeating "#if defined(XP_WIN) && !defined(HAVE_64BIT_OS) in many places. r=ehsan/khuey --HG-- extra : rebase_source : 33bd0a74ce70a564963a6ca125e01048577fb554
- Loading branch information
Showing
19 changed files
with
182 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# 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/. | ||
|
||
DEPTH = ../../.. | ||
topsrcdir = @top_srcdir@ | ||
srcdir = @srcdir@ | ||
VPATH = @srcdir@ | ||
|
||
include $(DEPTH)/config/autoconf.mk | ||
|
||
LIBRARY_NAME = google_breakpad_libxul_s | ||
FORCE_STATIC_LIB = 1 | ||
|
||
STL_FLAGS = | ||
|
||
LOCAL_INCLUDES = -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src | ||
|
||
include $(topsrcdir)/toolkit/crashreporter/google-breakpad/src/common/windows/objs.mk | ||
include $(topsrcdir)/toolkit/crashreporter/google-breakpad/src/client/windows/handler/objs.mk | ||
include $(topsrcdir)/toolkit/crashreporter/google-breakpad/src/client/windows/sender/objs.mk | ||
include $(topsrcdir)/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/objs.mk | ||
|
||
VPATH += \ | ||
$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/common/windows \ | ||
$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/client/windows/handler \ | ||
$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/client/windows/sender \ | ||
$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation \ | ||
$(NULL) | ||
|
||
CPPSRCS = \ | ||
$(objs_common) \ | ||
$(objs_handler) \ | ||
$(objs_sender) \ | ||
$(objs_crash_generation) \ | ||
http_upload.cc \ # required for the libxul version but not standalone | ||
$(NULL) | ||
|
||
DEFINES += -DUNICODE -DUNICODE_ -DBREAKPAD_NO_TERMINATE_THREAD -DNOMINMAX | ||
|
||
include $(topsrcdir)/config/rules.mk |
39 changes: 39 additions & 0 deletions
39
toolkit/crashreporter/breakpad-windows-standalone/Makefile.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# 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/. | ||
|
||
DEPTH = ../../.. | ||
topsrcdir = @top_srcdir@ | ||
srcdir = @srcdir@ | ||
VPATH = @srcdir@ | ||
|
||
include $(DEPTH)/config/autoconf.mk | ||
|
||
LIBRARY_NAME = google_breakpad_standalone_s | ||
FORCE_STATIC_LIB = 1 | ||
USE_STATIC_LIBS = 1 | ||
MOZ_GLUE_LDFLAGS = | ||
|
||
STL_FLAGS = | ||
|
||
LOCAL_INCLUDES = -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src | ||
|
||
include $(topsrcdir)/toolkit/crashreporter/google-breakpad/src/common/windows/objs.mk | ||
include $(topsrcdir)/toolkit/crashreporter/google-breakpad/src/client/windows/handler/objs.mk | ||
include $(topsrcdir)/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/objs.mk | ||
|
||
VPATH += \ | ||
$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/common/windows \ | ||
$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/client/windows/handler \ | ||
$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation \ | ||
$(NULL) | ||
|
||
CPPSRCS = \ | ||
$(objs_common) \ | ||
$(objs_handler) \ | ||
$(objs_crash_generation) \ | ||
$(NULL) | ||
|
||
DEFINES += -DUNICODE -DUNICODE_ -DBREAKPAD_NO_TERMINATE_THREAD -DNOMINMAX | ||
|
||
include $(topsrcdir)/config/rules.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/Makefile.in
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/objs.mk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
objs_crash_generation = \ | ||
client_info.cc \ | ||
crash_generation_client.cc \ | ||
crash_generation_server.cc \ | ||
minidump_generator.cc \ | ||
$(NULL) |
26 changes: 0 additions & 26 deletions
26
toolkit/crashreporter/google-breakpad/src/client/windows/handler/Makefile.in
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
toolkit/crashreporter/google-breakpad/src/client/windows/handler/objs.mk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
objs_handler = exception_handler.cc |
26 changes: 0 additions & 26 deletions
26
toolkit/crashreporter/google-breakpad/src/client/windows/sender/Makefile.in
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
toolkit/crashreporter/google-breakpad/src/client/windows/sender/objs.mk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
objs_sender = crash_report_sender.cc |
28 changes: 0 additions & 28 deletions
28
toolkit/crashreporter/google-breakpad/src/common/windows/Makefile.in
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
toolkit/crashreporter/google-breakpad/src/common/windows/objs.mk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
objs_common = \ | ||
guid_string.cc \ | ||
string_utils.cc \ | ||
$(NULL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# 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/. | ||
|
||
DEPTH = ../../.. | ||
topsrcdir = @top_srcdir@ | ||
srcdir = @srcdir@ | ||
VPATH = @srcdir@ | ||
|
||
include $(DEPTH)/config/autoconf.mk | ||
|
||
LIBRARY_NAME = breakpadinjector | ||
FORCE_SHARED_LIB = 1 | ||
USE_STATIC_LIBS = 1 | ||
STL_FLAGS = | ||
MOZ_GLUE_LDFLAGS = | ||
|
||
CPPSRCS = injector.cpp | ||
|
||
SHARED_LIBRARY_LIBS += ../breakpad-windows-standalone/$(LIB_PREFIX)google_breakpad_standalone_s.$(LIB_SUFFIX) | ||
|
||
include $(topsrcdir)/config/config.mk | ||
include $(topsrcdir)/ipc/chromium/chromium-config.mk | ||
include $(topsrcdir)/config/rules.mk | ||
|
||
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src | ||
LDFLAGS += -ENTRY:DummyEntryPoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* 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 <windows.h> | ||
|
||
#include "client/windows/handler/exception_handler.h" | ||
|
||
using google_breakpad::ExceptionHandler; | ||
using std::wstring; | ||
|
||
BOOL WINAPI DummyEntryPoint(HINSTANCE instance, | ||
DWORD reason, | ||
void* reserved) | ||
{ | ||
__debugbreak(); | ||
|
||
return FALSE; // We're being loaded remotely, this shouldn't happen! | ||
} | ||
|
||
// support.microsoft.com/kb/94248 | ||
extern "C" BOOL WINAPI _CRT_INIT(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved); | ||
|
||
extern "C" | ||
__declspec(dllexport) DWORD Start(void* context) | ||
{ | ||
// Because the remote DLL injector does not call DllMain, we have to | ||
// initialize the CRT manually | ||
_CRT_INIT(NULL, DLL_PROCESS_ATTACH, NULL); | ||
|
||
HANDLE hCrashPipe = reinterpret_cast<HANDLE>(context); | ||
|
||
ExceptionHandler* e = new (std::nothrow) | ||
ExceptionHandler(wstring(), NULL, NULL, NULL, | ||
ExceptionHandler::HANDLER_ALL, | ||
MiniDumpNormal, hCrashPipe, NULL); | ||
if (e) | ||
e->set_handle_debug_exceptions(true); | ||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters