2017-11-17 17:48:22 -08:00
|
|
|
|
# Copyright 2015 The Crashpad Authors. All rights reserved.
|
|
|
|
|
#
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
import("../build/crashpad_buildconfig.gni")
|
|
|
|
|
|
2020-07-07 23:26:07 -04:00
|
|
|
|
if (crashpad_is_in_chromium) {
|
|
|
|
|
# Prevent Chromium source assignment filters from being inherited.
|
|
|
|
|
set_sources_assignment_filter([])
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-17 17:48:22 -08:00
|
|
|
|
static_library("handler") {
|
|
|
|
|
sources = [
|
|
|
|
|
"crash_report_upload_thread.cc",
|
|
|
|
|
"crash_report_upload_thread.h",
|
2018-02-19 11:11:38 -08:00
|
|
|
|
"handler_main.cc",
|
|
|
|
|
"handler_main.h",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
"minidump_to_upload_parameters.cc",
|
|
|
|
|
"minidump_to_upload_parameters.h",
|
|
|
|
|
"prune_crash_reports_thread.cc",
|
|
|
|
|
"prune_crash_reports_thread.h",
|
|
|
|
|
"user_stream_data_source.cc",
|
|
|
|
|
"user_stream_data_source.h",
|
|
|
|
|
]
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_mac) {
|
2017-11-28 10:31:13 -08:00
|
|
|
|
sources += [
|
|
|
|
|
"mac/crash_report_exception_handler.cc",
|
|
|
|
|
"mac/crash_report_exception_handler.h",
|
|
|
|
|
"mac/exception_handler_server.cc",
|
|
|
|
|
"mac/exception_handler_server.h",
|
|
|
|
|
"mac/file_limit_annotation.cc",
|
|
|
|
|
"mac/file_limit_annotation.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-21 17:54:12 -05:00
|
|
|
|
if (crashpad_is_linux || crashpad_is_android) {
|
2017-12-19 17:13:13 -05:00
|
|
|
|
sources += [
|
2019-08-30 08:21:23 -07:00
|
|
|
|
"linux/capture_snapshot.cc",
|
|
|
|
|
"linux/capture_snapshot.h",
|
2018-02-16 09:13:35 -08:00
|
|
|
|
"linux/crash_report_exception_handler.cc",
|
|
|
|
|
"linux/crash_report_exception_handler.h",
|
2017-12-19 17:13:13 -05:00
|
|
|
|
"linux/exception_handler_server.cc",
|
|
|
|
|
"linux/exception_handler_server.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-30 11:51:47 -07:00
|
|
|
|
if (crashpad_is_linux) {
|
|
|
|
|
sources += [
|
|
|
|
|
"linux/cros_crash_report_exception_handler.cc",
|
|
|
|
|
"linux/cros_crash_report_exception_handler.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_win) {
|
2017-11-28 10:31:13 -08:00
|
|
|
|
sources += [
|
|
|
|
|
"win/crash_report_exception_handler.cc",
|
|
|
|
|
"win/crash_report_exception_handler.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public_configs = [ "..:crashpad_config" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
2018-10-16 10:49:43 -07:00
|
|
|
|
public_deps = [
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
2018-10-16 10:49:43 -07:00
|
|
|
|
"../third_party/mini_chromium:base",
|
|
|
|
|
"../util",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
deps = [
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../minidump",
|
|
|
|
|
"../snapshot",
|
|
|
|
|
"../tools:tool_support",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
]
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_win) {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-15 10:23:10 -07:00
|
|
|
|
if (crashpad_is_android) {
|
|
|
|
|
# CrashpadHandlerMain is defined in a separate target so that it can be
|
|
|
|
|
# overriden by implementers
|
|
|
|
|
source_set("crashpad_handler_main") {
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "crashpad_handler_main.cc" ]
|
2019-07-15 10:23:10 -07:00
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
deps = [ ":handler" ]
|
2019-07-15 10:23:10 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-17 17:48:22 -08:00
|
|
|
|
source_set("handler_test") {
|
|
|
|
|
testonly = true
|
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "minidump_to_upload_parameters_test.cc" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
2017-12-21 17:54:12 -05:00
|
|
|
|
if (crashpad_is_linux || crashpad_is_android) {
|
2017-12-19 17:13:13 -05:00
|
|
|
|
sources += [ "linux/exception_handler_server_test.cc" ]
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_win) {
|
2017-12-19 17:13:13 -05:00
|
|
|
|
sources += [ "crashpad_handler_test.cc" ]
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-17 17:48:22 -08:00
|
|
|
|
deps = [
|
|
|
|
|
":handler",
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
|
|
|
|
"../compat",
|
|
|
|
|
"../snapshot",
|
2017-12-06 10:08:11 -08:00
|
|
|
|
"../snapshot:test_support",
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../test",
|
2020-05-06 20:39:19 -04:00
|
|
|
|
"../third_party/googletest:googletest",
|
2017-12-18 14:35:55 -08:00
|
|
|
|
"../third_party/mini_chromium:base",
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../util",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
]
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_win) {
|
2020-04-10 17:40:41 -04:00
|
|
|
|
deps += [ "../minidump:test_support" ]
|
|
|
|
|
|
2017-11-17 17:48:22 -08:00
|
|
|
|
data_deps = [
|
|
|
|
|
":crashpad_handler_test_extended_handler",
|
2018-05-28 12:38:46 -07:00
|
|
|
|
":fake_handler_that_crashes_at_startup",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-18 14:49:10 -05:00
|
|
|
|
if (!crashpad_is_ios) {
|
|
|
|
|
crashpad_executable("crashpad_handler") {
|
|
|
|
|
sources = [ "main.cc" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
2020-02-18 14:49:10 -05:00
|
|
|
|
deps = [
|
|
|
|
|
":handler",
|
|
|
|
|
"../build:default_exe_manifest_win",
|
|
|
|
|
"../compat",
|
|
|
|
|
"../third_party/mini_chromium:base",
|
2020-04-10 17:40:41 -04:00
|
|
|
|
"../tools:tool_support",
|
2020-02-18 14:49:10 -05:00
|
|
|
|
]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
2020-02-18 14:49:10 -05:00
|
|
|
|
if (crashpad_is_win) {
|
|
|
|
|
if (crashpad_is_in_chromium || crashpad_is_in_dart) {
|
|
|
|
|
remove_configs = [ "//build/config/win:console" ]
|
|
|
|
|
configs = [ "//build/config/win:windowed" ]
|
|
|
|
|
} else {
|
2020-09-23 14:39:45 -07:00
|
|
|
|
remove_configs = [
|
|
|
|
|
"//third_party/mini_chromium/mini_chromium/build/config:win_console",
|
|
|
|
|
]
|
|
|
|
|
configs = [
|
|
|
|
|
"//third_party/mini_chromium/mini_chromium/build/config:win_windowed",
|
|
|
|
|
]
|
2020-02-18 14:49:10 -05:00
|
|
|
|
}
|
2018-02-06 10:57:23 -08:00
|
|
|
|
}
|
2020-07-15 11:26:08 -07:00
|
|
|
|
|
|
|
|
|
if (crashpad_is_linux) {
|
|
|
|
|
deps += [ "../client:pthread_create" ]
|
|
|
|
|
}
|
2017-11-17 17:48:22 -08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-24 15:48:14 -07:00
|
|
|
|
# There is not any normal way to package native executables in an Android APK.
|
|
|
|
|
# It is normal to package native code as a loadable module but Android's APK
|
|
|
|
|
# installer will ignore files not named like a shared object, so give the
|
|
|
|
|
# handler executable an acceptable name.
|
|
|
|
|
if (crashpad_is_android) {
|
2018-07-25 16:31:30 -07:00
|
|
|
|
copy("crashpad_handler_named_as_so") {
|
2020-01-23 08:00:33 -05:00
|
|
|
|
deps = [ ":crashpad_handler" ]
|
2018-04-24 15:48:14 -07:00
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "$root_out_dir/crashpad_handler" ]
|
2018-04-24 15:48:14 -07:00
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
outputs = [ "$root_out_dir/libcrashpad_handler.so" ]
|
2018-04-24 15:48:14 -07:00
|
|
|
|
}
|
2019-02-21 17:26:25 -08:00
|
|
|
|
|
|
|
|
|
crashpad_executable("crashpad_handler_trampoline") {
|
|
|
|
|
output_name = "libcrashpad_handler_trampoline.so"
|
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "linux/handler_trampoline.cc" ]
|
2019-02-21 17:26:25 -08:00
|
|
|
|
|
2020-09-10 14:23:59 -07:00
|
|
|
|
deps = [ "../util:no_cfi_icall" ]
|
|
|
|
|
|
2019-02-21 17:26:25 -08:00
|
|
|
|
ldflags = [ "-llog" ]
|
|
|
|
|
|
2019-03-30 00:39:49 +00:00
|
|
|
|
if (crashpad_is_in_chromium) {
|
2019-02-21 17:26:25 -08:00
|
|
|
|
no_default_deps = true
|
2020-08-13 11:53:06 -07:00
|
|
|
|
remove_configs =
|
|
|
|
|
[ "//build/config/android:default_orderfile_instrumentation" ]
|
2019-02-21 17:26:25 -08:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-24 15:48:14 -07:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-18 14:49:10 -05:00
|
|
|
|
if (!crashpad_is_ios) {
|
|
|
|
|
crashpad_executable("crashpad_handler_test_extended_handler") {
|
|
|
|
|
testonly = true
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
2020-02-18 14:49:10 -05:00
|
|
|
|
sources = [ "crashpad_handler_test_extended_handler.cc" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
2020-02-18 14:49:10 -05:00
|
|
|
|
deps = [
|
|
|
|
|
":handler",
|
|
|
|
|
"../build:default_exe_manifest_win",
|
|
|
|
|
"../compat",
|
|
|
|
|
"../minidump:test_support",
|
|
|
|
|
"../third_party/mini_chromium:base",
|
|
|
|
|
"../tools:tool_support",
|
|
|
|
|
]
|
|
|
|
|
}
|
2017-11-17 17:48:22 -08:00
|
|
|
|
}
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_win) {
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("crashpad_handler_com") {
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "main.cc" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
|
|
|
|
# Avoid .exp, .ilk, and .lib file collisions with crashpad_handler.exe by
|
|
|
|
|
# having this target produce crashpad_handler_com.com. Don’t use this target
|
|
|
|
|
# directly. Instead, use crashpad_handler_console.
|
|
|
|
|
output_extension = "com"
|
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
":handler",
|
2017-12-18 14:35:55 -08:00
|
|
|
|
"../build:default_exe_manifest_win",
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../compat",
|
2017-12-18 14:35:55 -08:00
|
|
|
|
"../third_party/mini_chromium:base",
|
2020-04-10 17:40:41 -04:00
|
|
|
|
"../tools:tool_support",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
copy("crashpad_handler_console") {
|
2020-01-23 08:00:33 -05:00
|
|
|
|
deps = [ ":crashpad_handler_com" ]
|
|
|
|
|
sources = [ "$root_out_dir/crashpad_handler_com.com" ]
|
|
|
|
|
outputs = [ "$root_out_dir/crashpad_handler.com" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
}
|
2018-02-05 15:25:30 -08:00
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("crash_other_program") {
|
2018-02-05 15:25:30 -08:00
|
|
|
|
testonly = true
|
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/crash_other_program.cc" ]
|
2018-02-05 15:25:30 -08:00
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
"../client",
|
|
|
|
|
"../test",
|
2020-05-06 20:39:19 -04:00
|
|
|
|
"../third_party/googletest:googletest",
|
2018-02-05 15:25:30 -08:00
|
|
|
|
"../third_party/mini_chromium:base",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("crashy_program") {
|
2018-02-05 15:25:30 -08:00
|
|
|
|
testonly = true
|
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/crashy_test_program.cc" ]
|
2018-02-05 15:25:30 -08:00
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
"../client",
|
|
|
|
|
"../third_party/mini_chromium:base",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("crashy_signal") {
|
2018-02-05 15:25:30 -08:00
|
|
|
|
testonly = true
|
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/crashy_signal.cc" ]
|
2018-02-05 15:25:30 -08:00
|
|
|
|
|
2018-02-27 15:29:38 -08:00
|
|
|
|
cflags = [ "/wd4702" ] # Unreachable code.
|
|
|
|
|
|
2018-02-05 15:25:30 -08:00
|
|
|
|
deps = [
|
|
|
|
|
"../client",
|
|
|
|
|
"../third_party/mini_chromium:base",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("fake_handler_that_crashes_at_startup") {
|
2018-02-05 15:25:30 -08:00
|
|
|
|
testonly = true
|
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/fake_handler_that_crashes_at_startup.cc" ]
|
2018-02-05 15:25:30 -08:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("hanging_program") {
|
2018-02-05 15:25:30 -08:00
|
|
|
|
testonly = true
|
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/hanging_program.cc" ]
|
2018-02-05 15:25:30 -08:00
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
"../client",
|
|
|
|
|
"../third_party/mini_chromium:base",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_loadable_module("loader_lock_dll") {
|
2018-02-05 15:25:30 -08:00
|
|
|
|
testonly = true
|
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/loader_lock_dll.cc" ]
|
2018-02-05 15:25:30 -08:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("self_destroying_program") {
|
2018-02-05 15:25:30 -08:00
|
|
|
|
testonly = true
|
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/self_destroying_test_program.cc" ]
|
2018-02-05 15:25:30 -08:00
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
"../client",
|
|
|
|
|
"../compat",
|
|
|
|
|
"../snapshot",
|
|
|
|
|
"../third_party/mini_chromium:base",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (current_cpu == "x86") {
|
|
|
|
|
# Cannot create an x64 DLL with embedded debug info.
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("crashy_z7_loader") {
|
2018-02-05 15:25:30 -08:00
|
|
|
|
testonly = true
|
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/crashy_test_z7_loader.cc" ]
|
2018-02-05 15:25:30 -08:00
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
"../client",
|
|
|
|
|
"../test",
|
|
|
|
|
"../third_party/mini_chromium:base",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-11-17 17:48:22 -08:00
|
|
|
|
}
|