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")
|
2018-06-04 16:16:19 -07:00
|
|
|
|
import("../build/crashpad_fuzzer_test.gni")
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
2017-12-19 17:15:10 -08:00
|
|
|
|
if (crashpad_is_in_chromium) {
|
|
|
|
|
import("//build/config/compiler/compiler.gni")
|
2020-03-24 16:53:56 -04:00
|
|
|
|
|
|
|
|
|
# Prevent Chromium source assignment filters from being inherited.
|
|
|
|
|
set_sources_assignment_filter([])
|
2017-12-19 17:15:10 -08:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-17 17:48:22 -08:00
|
|
|
|
static_library("snapshot") {
|
|
|
|
|
sources = [
|
|
|
|
|
"annotation_snapshot.cc",
|
|
|
|
|
"annotation_snapshot.h",
|
|
|
|
|
"capture_memory.cc",
|
|
|
|
|
"capture_memory.h",
|
|
|
|
|
"crashpad_info_client_options.cc",
|
|
|
|
|
"crashpad_info_client_options.h",
|
|
|
|
|
"exception_snapshot.h",
|
|
|
|
|
"handle_snapshot.cc",
|
|
|
|
|
"handle_snapshot.h",
|
2018-02-01 15:54:56 -08:00
|
|
|
|
"memory_snapshot.cc",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
"memory_snapshot.h",
|
2018-02-21 16:07:17 -08:00
|
|
|
|
"memory_snapshot_generic.h",
|
2019-04-17 12:54:06 -04:00
|
|
|
|
"minidump/exception_snapshot_minidump.cc",
|
|
|
|
|
"minidump/exception_snapshot_minidump.h",
|
2018-11-16 20:41:17 -08:00
|
|
|
|
"minidump/memory_snapshot_minidump.cc",
|
|
|
|
|
"minidump/memory_snapshot_minidump.h",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
"minidump/minidump_annotation_reader.cc",
|
|
|
|
|
"minidump/minidump_annotation_reader.h",
|
2019-08-13 15:14:20 -07:00
|
|
|
|
"minidump/minidump_context_converter.cc",
|
|
|
|
|
"minidump/minidump_context_converter.h",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
"minidump/minidump_simple_string_dictionary_reader.cc",
|
|
|
|
|
"minidump/minidump_simple_string_dictionary_reader.h",
|
2018-11-16 20:41:17 -08:00
|
|
|
|
"minidump/minidump_stream.h",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
"minidump/minidump_string_list_reader.cc",
|
|
|
|
|
"minidump/minidump_string_list_reader.h",
|
|
|
|
|
"minidump/minidump_string_reader.cc",
|
|
|
|
|
"minidump/minidump_string_reader.h",
|
|
|
|
|
"minidump/module_snapshot_minidump.cc",
|
|
|
|
|
"minidump/module_snapshot_minidump.h",
|
|
|
|
|
"minidump/process_snapshot_minidump.cc",
|
|
|
|
|
"minidump/process_snapshot_minidump.h",
|
2018-10-15 15:20:48 -07:00
|
|
|
|
"minidump/system_snapshot_minidump.cc",
|
|
|
|
|
"minidump/system_snapshot_minidump.h",
|
2018-10-12 13:12:01 -07:00
|
|
|
|
"minidump/thread_snapshot_minidump.cc",
|
|
|
|
|
"minidump/thread_snapshot_minidump.h",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
"module_snapshot.h",
|
|
|
|
|
"process_snapshot.h",
|
|
|
|
|
"snapshot_constants.h",
|
|
|
|
|
"system_snapshot.h",
|
|
|
|
|
"thread_snapshot.h",
|
|
|
|
|
"unloaded_module_snapshot.cc",
|
|
|
|
|
"unloaded_module_snapshot.h",
|
|
|
|
|
]
|
|
|
|
|
|
2018-04-04 15:12:50 -07:00
|
|
|
|
if (crashpad_is_posix || crashpad_is_fuchsia) {
|
2018-02-06 10:57:23 -08:00
|
|
|
|
sources += [
|
|
|
|
|
"posix/timezone.cc",
|
|
|
|
|
"posix/timezone.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_mac) {
|
2017-11-29 11:59:18 -08:00
|
|
|
|
sources += [
|
|
|
|
|
"mac/cpu_context_mac.cc",
|
|
|
|
|
"mac/cpu_context_mac.h",
|
|
|
|
|
"mac/exception_snapshot_mac.cc",
|
|
|
|
|
"mac/exception_snapshot_mac.h",
|
|
|
|
|
"mac/mach_o_image_annotations_reader.cc",
|
|
|
|
|
"mac/mach_o_image_annotations_reader.h",
|
|
|
|
|
"mac/mach_o_image_reader.cc",
|
|
|
|
|
"mac/mach_o_image_reader.h",
|
|
|
|
|
"mac/mach_o_image_segment_reader.cc",
|
|
|
|
|
"mac/mach_o_image_segment_reader.h",
|
|
|
|
|
"mac/mach_o_image_symbol_table_reader.cc",
|
|
|
|
|
"mac/mach_o_image_symbol_table_reader.h",
|
|
|
|
|
"mac/module_snapshot_mac.cc",
|
|
|
|
|
"mac/module_snapshot_mac.h",
|
2018-02-22 12:12:26 -08:00
|
|
|
|
"mac/process_reader_mac.cc",
|
|
|
|
|
"mac/process_reader_mac.h",
|
2017-11-29 11:59:18 -08:00
|
|
|
|
"mac/process_snapshot_mac.cc",
|
|
|
|
|
"mac/process_snapshot_mac.h",
|
|
|
|
|
"mac/process_types.cc",
|
|
|
|
|
"mac/process_types.h",
|
|
|
|
|
"mac/process_types/custom.cc",
|
|
|
|
|
"mac/process_types/flavors.h",
|
|
|
|
|
"mac/process_types/internal.h",
|
|
|
|
|
"mac/process_types/traits.h",
|
|
|
|
|
"mac/system_snapshot_mac.cc",
|
|
|
|
|
"mac/system_snapshot_mac.h",
|
|
|
|
|
"mac/thread_snapshot_mac.cc",
|
|
|
|
|
"mac/thread_snapshot_mac.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-04 15:19:46 -05:00
|
|
|
|
if (crashpad_is_ios) {
|
|
|
|
|
sources += [
|
2020-03-25 16:13:42 -04:00
|
|
|
|
"ios/exception_snapshot_ios.cc",
|
|
|
|
|
"ios/exception_snapshot_ios.h",
|
2020-03-20 10:37:01 -04:00
|
|
|
|
"ios/memory_snapshot_ios.cc",
|
|
|
|
|
"ios/memory_snapshot_ios.h",
|
2020-03-04 15:19:46 -05:00
|
|
|
|
"ios/module_snapshot_ios.cc",
|
|
|
|
|
"ios/module_snapshot_ios.h",
|
|
|
|
|
"ios/process_snapshot_ios.cc",
|
|
|
|
|
"ios/process_snapshot_ios.h",
|
2020-03-25 16:12:22 -04:00
|
|
|
|
"ios/system_snapshot_ios.cc",
|
|
|
|
|
"ios/system_snapshot_ios.h",
|
2020-03-20 10:37:01 -04:00
|
|
|
|
"ios/thread_snapshot_ios.cc",
|
|
|
|
|
"ios/thread_snapshot_ios.h",
|
|
|
|
|
"mac/cpu_context_mac.cc",
|
|
|
|
|
"mac/cpu_context_mac.h",
|
2020-03-04 15:19:46 -05:00
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-21 17:54:12 -05:00
|
|
|
|
if (crashpad_is_linux || crashpad_is_android) {
|
2017-12-19 14:21:14 -05:00
|
|
|
|
sources += [
|
|
|
|
|
"linux/cpu_context_linux.cc",
|
|
|
|
|
"linux/cpu_context_linux.h",
|
|
|
|
|
"linux/debug_rendezvous.cc",
|
|
|
|
|
"linux/debug_rendezvous.h",
|
|
|
|
|
"linux/exception_snapshot_linux.cc",
|
|
|
|
|
"linux/exception_snapshot_linux.h",
|
2018-02-22 12:12:26 -08:00
|
|
|
|
"linux/process_reader_linux.cc",
|
|
|
|
|
"linux/process_reader_linux.h",
|
2017-12-19 14:21:14 -05:00
|
|
|
|
"linux/process_snapshot_linux.cc",
|
|
|
|
|
"linux/process_snapshot_linux.h",
|
|
|
|
|
"linux/signal_context.h",
|
|
|
|
|
"linux/system_snapshot_linux.cc",
|
|
|
|
|
"linux/system_snapshot_linux.h",
|
|
|
|
|
"linux/thread_snapshot_linux.cc",
|
|
|
|
|
"linux/thread_snapshot_linux.h",
|
2018-06-11 09:38:24 -07:00
|
|
|
|
"sanitized/memory_snapshot_sanitized.cc",
|
|
|
|
|
"sanitized/memory_snapshot_sanitized.h",
|
|
|
|
|
"sanitized/module_snapshot_sanitized.cc",
|
|
|
|
|
"sanitized/module_snapshot_sanitized.h",
|
|
|
|
|
"sanitized/process_snapshot_sanitized.cc",
|
|
|
|
|
"sanitized/process_snapshot_sanitized.h",
|
2018-06-12 08:30:36 -07:00
|
|
|
|
"sanitized/sanitization_information.cc",
|
|
|
|
|
"sanitized/sanitization_information.h",
|
2018-06-11 09:38:24 -07:00
|
|
|
|
"sanitized/thread_snapshot_sanitized.cc",
|
|
|
|
|
"sanitized/thread_snapshot_sanitized.h",
|
2017-12-19 14:21:14 -05:00
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-21 13:42:51 -08:00
|
|
|
|
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia ||
|
|
|
|
|
crashpad_is_win) {
|
2018-01-18 14:34:41 -08:00
|
|
|
|
sources += [
|
|
|
|
|
"crashpad_types/crashpad_info_reader.cc",
|
|
|
|
|
"crashpad_types/crashpad_info_reader.h",
|
2018-12-21 13:42:51 -08:00
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
|
|
|
|
|
sources += [
|
2018-02-20 16:10:20 -08:00
|
|
|
|
"crashpad_types/image_annotation_reader.cc",
|
|
|
|
|
"crashpad_types/image_annotation_reader.h",
|
2018-01-19 14:03:34 -08:00
|
|
|
|
"elf/elf_dynamic_array_reader.cc",
|
|
|
|
|
"elf/elf_dynamic_array_reader.h",
|
|
|
|
|
"elf/elf_image_reader.cc",
|
|
|
|
|
"elf/elf_image_reader.h",
|
|
|
|
|
"elf/elf_symbol_table_reader.cc",
|
|
|
|
|
"elf/elf_symbol_table_reader.h",
|
2018-02-20 16:11:41 -08:00
|
|
|
|
"elf/module_snapshot_elf.cc",
|
|
|
|
|
"elf/module_snapshot_elf.h",
|
2018-01-18 14:34:41 -08:00
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_win) {
|
2017-11-29 11:59:18 -08:00
|
|
|
|
sources += [
|
|
|
|
|
"win/capture_memory_delegate_win.cc",
|
|
|
|
|
"win/capture_memory_delegate_win.h",
|
|
|
|
|
"win/cpu_context_win.cc",
|
|
|
|
|
"win/cpu_context_win.h",
|
|
|
|
|
"win/exception_snapshot_win.cc",
|
|
|
|
|
"win/exception_snapshot_win.h",
|
|
|
|
|
"win/memory_map_region_snapshot_win.cc",
|
|
|
|
|
"win/memory_map_region_snapshot_win.h",
|
|
|
|
|
"win/module_snapshot_win.cc",
|
|
|
|
|
"win/module_snapshot_win.h",
|
|
|
|
|
"win/pe_image_annotations_reader.cc",
|
|
|
|
|
"win/pe_image_annotations_reader.h",
|
|
|
|
|
"win/pe_image_reader.cc",
|
|
|
|
|
"win/pe_image_reader.h",
|
|
|
|
|
"win/pe_image_resource_reader.cc",
|
|
|
|
|
"win/pe_image_resource_reader.h",
|
|
|
|
|
"win/process_reader_win.cc",
|
|
|
|
|
"win/process_reader_win.h",
|
|
|
|
|
"win/process_snapshot_win.cc",
|
|
|
|
|
"win/process_snapshot_win.h",
|
|
|
|
|
"win/process_subrange_reader.cc",
|
|
|
|
|
"win/process_subrange_reader.h",
|
|
|
|
|
"win/system_snapshot_win.cc",
|
|
|
|
|
"win/system_snapshot_win.h",
|
|
|
|
|
"win/thread_snapshot_win.cc",
|
|
|
|
|
"win/thread_snapshot_win.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_fuchsia) {
|
2017-12-05 15:43:23 -08:00
|
|
|
|
sources += [
|
2018-04-12 14:16:10 -07:00
|
|
|
|
"fuchsia/cpu_context_fuchsia.cc",
|
|
|
|
|
"fuchsia/cpu_context_fuchsia.h",
|
2018-05-03 13:31:48 -07:00
|
|
|
|
"fuchsia/exception_snapshot_fuchsia.cc",
|
|
|
|
|
"fuchsia/exception_snapshot_fuchsia.h",
|
2018-04-30 12:57:03 -07:00
|
|
|
|
"fuchsia/memory_map_fuchsia.cc",
|
|
|
|
|
"fuchsia/memory_map_fuchsia.h",
|
2018-12-14 13:17:43 -08:00
|
|
|
|
"fuchsia/memory_map_region_snapshot_fuchsia.cc",
|
|
|
|
|
"fuchsia/memory_map_region_snapshot_fuchsia.h",
|
2018-02-22 12:12:26 -08:00
|
|
|
|
"fuchsia/process_reader_fuchsia.cc",
|
|
|
|
|
"fuchsia/process_reader_fuchsia.h",
|
2017-12-05 15:43:23 -08:00
|
|
|
|
"fuchsia/process_snapshot_fuchsia.cc",
|
|
|
|
|
"fuchsia/process_snapshot_fuchsia.h",
|
2018-04-10 15:34:33 -07:00
|
|
|
|
"fuchsia/system_snapshot_fuchsia.cc",
|
|
|
|
|
"fuchsia/system_snapshot_fuchsia.h",
|
2018-02-22 16:48:50 -08:00
|
|
|
|
"fuchsia/thread_snapshot_fuchsia.cc",
|
|
|
|
|
"fuchsia/thread_snapshot_fuchsia.h",
|
2017-12-05 15:43:23 -08:00
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-17 17:48:22 -08:00
|
|
|
|
if (target_cpu == "x86" || target_cpu == "x64") {
|
|
|
|
|
sources += [
|
|
|
|
|
"x86/cpuid_reader.cc",
|
|
|
|
|
"x86/cpuid_reader.h",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-28 10:31:13 -08:00
|
|
|
|
public_configs = [ "..:crashpad_config" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
2020-04-10 17:40:41 -04:00
|
|
|
|
public_deps = [ ":context" ]
|
|
|
|
|
|
2017-11-17 17:48:22 -08:00
|
|
|
|
deps = [
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
|
|
|
|
"../compat",
|
2020-04-10 17:40:41 -04:00
|
|
|
|
"../minidump:format",
|
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
|
|
|
|
]
|
|
|
|
|
|
2020-03-04 15:19:46 -05:00
|
|
|
|
if (crashpad_is_ios) {
|
|
|
|
|
deps -= [ "../client" ]
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
|
libs = [ "powrprof.lib" ]
|
|
|
|
|
}
|
2020-02-21 11:33:02 -08:00
|
|
|
|
|
|
|
|
|
configs += [ "..:disable_ubsan" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-10 17:40:41 -04:00
|
|
|
|
# :context is the only part of snapshot that minidump may depend on.
|
|
|
|
|
static_library("context") {
|
|
|
|
|
sources = [
|
|
|
|
|
"cpu_architecture.h",
|
|
|
|
|
"cpu_context.cc",
|
|
|
|
|
"cpu_context.h",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
public_configs = [ "..:crashpad_config" ]
|
|
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
|
"../third_party/mini_chromium:base",
|
|
|
|
|
"../util",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if (crashpad_is_win) {
|
|
|
|
|
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-06 12:01:34 -07:00
|
|
|
|
if (crashpad_is_linux) {
|
|
|
|
|
crashpad_fuzzer_test("elf_image_reader_fuzzer") {
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "elf/elf_image_reader_fuzzer.cc" ]
|
2018-06-04 16:16:19 -07:00
|
|
|
|
|
2019-05-06 12:01:34 -07:00
|
|
|
|
deps = [
|
|
|
|
|
":snapshot",
|
|
|
|
|
"../third_party/mini_chromium:base",
|
|
|
|
|
]
|
|
|
|
|
seed_corpus = "elf/elf_image_reader_fuzzer_corpus"
|
|
|
|
|
}
|
2018-06-04 16:16:19 -07:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-17 17:48:22 -08:00
|
|
|
|
static_library("test_support") {
|
|
|
|
|
testonly = true
|
|
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
|
"test/test_cpu_context.cc",
|
|
|
|
|
"test/test_cpu_context.h",
|
|
|
|
|
"test/test_exception_snapshot.cc",
|
|
|
|
|
"test/test_exception_snapshot.h",
|
|
|
|
|
"test/test_memory_map_region_snapshot.cc",
|
|
|
|
|
"test/test_memory_map_region_snapshot.h",
|
|
|
|
|
"test/test_memory_snapshot.cc",
|
|
|
|
|
"test/test_memory_snapshot.h",
|
|
|
|
|
"test/test_module_snapshot.cc",
|
|
|
|
|
"test/test_module_snapshot.h",
|
|
|
|
|
"test/test_process_snapshot.cc",
|
|
|
|
|
"test/test_process_snapshot.h",
|
|
|
|
|
"test/test_system_snapshot.cc",
|
|
|
|
|
"test/test_system_snapshot.h",
|
|
|
|
|
"test/test_thread_snapshot.cc",
|
|
|
|
|
"test/test_thread_snapshot.h",
|
|
|
|
|
]
|
|
|
|
|
|
2017-11-28 10:31:13 -08:00
|
|
|
|
public_configs = [ "..:crashpad_config" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
2020-01-23 08:00:33 -05:00
|
|
|
|
public_deps = [ ":snapshot" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
|
|
|
|
|
deps = [
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../compat",
|
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) {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-19 14:21:14 -05:00
|
|
|
|
config("snapshot_test_link") {
|
|
|
|
|
visibility = [ ":*" ]
|
2018-01-19 14:03:34 -08:00
|
|
|
|
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
|
2017-12-19 14:21:14 -05:00
|
|
|
|
# There’s no way to make the link depend on this file. “inputs” doesn’t have
|
|
|
|
|
# the intended effect in a config. https://crbug.com/781858,
|
|
|
|
|
# https://crbug.com/796187.
|
2020-01-23 08:00:33 -05:00
|
|
|
|
inputs = [ "elf/test_exported_symbols.sym" ]
|
2017-12-19 14:21:14 -05:00
|
|
|
|
ldflags = [ "-Wl,--dynamic-list," + rebase_path(inputs[0], root_build_dir) ]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-17 17:48:22 -08:00
|
|
|
|
source_set("snapshot_test") {
|
|
|
|
|
testonly = true
|
|
|
|
|
|
|
|
|
|
sources = [
|
|
|
|
|
"cpu_context_test.cc",
|
2018-02-01 15:54:56 -08:00
|
|
|
|
"memory_snapshot_test.cc",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
"minidump/process_snapshot_minidump_test.cc",
|
|
|
|
|
]
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_mac) {
|
2017-11-29 11:59:18 -08:00
|
|
|
|
sources += [
|
|
|
|
|
"mac/cpu_context_mac_test.cc",
|
|
|
|
|
"mac/mach_o_image_annotations_reader_test.cc",
|
|
|
|
|
"mac/mach_o_image_reader_test.cc",
|
|
|
|
|
"mac/mach_o_image_segment_reader_test.cc",
|
2018-02-22 12:12:26 -08:00
|
|
|
|
"mac/process_reader_mac_test.cc",
|
2017-11-29 11:59:18 -08:00
|
|
|
|
"mac/process_types_test.cc",
|
|
|
|
|
"mac/system_snapshot_mac_test.cc",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-21 17:54:12 -05:00
|
|
|
|
if (crashpad_is_linux || crashpad_is_android) {
|
2017-12-19 14:21:14 -05:00
|
|
|
|
sources += [
|
|
|
|
|
"linux/debug_rendezvous_test.cc",
|
|
|
|
|
"linux/exception_snapshot_linux_test.cc",
|
2018-02-22 12:12:26 -08:00
|
|
|
|
"linux/process_reader_linux_test.cc",
|
2017-12-19 14:21:14 -05:00
|
|
|
|
"linux/system_snapshot_linux_test.cc",
|
2018-06-11 09:38:24 -07:00
|
|
|
|
"sanitized/process_snapshot_sanitized_test.cc",
|
2018-06-12 08:30:36 -07:00
|
|
|
|
"sanitized/sanitization_information_test.cc",
|
2017-12-19 14:21:14 -05:00
|
|
|
|
]
|
2020-03-02 20:34:47 -05:00
|
|
|
|
} else if (!crashpad_is_ios) {
|
2017-12-19 14:21:14 -05:00
|
|
|
|
sources += [ "crashpad_info_client_options_test.cc" ]
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-21 13:42:51 -08:00
|
|
|
|
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia ||
|
|
|
|
|
crashpad_is_win) {
|
|
|
|
|
sources += [ "crashpad_types/crashpad_info_reader_test.cc" ]
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-18 14:34:41 -08:00
|
|
|
|
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
|
2018-01-19 14:03:34 -08:00
|
|
|
|
sources += [
|
2018-02-20 16:10:20 -08:00
|
|
|
|
"crashpad_types/image_annotation_reader_test.cc",
|
2018-01-19 14:03:34 -08:00
|
|
|
|
"elf/elf_image_reader_test.cc",
|
|
|
|
|
"elf/elf_image_reader_test_note.S",
|
|
|
|
|
]
|
2018-01-18 14:34:41 -08:00
|
|
|
|
}
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_win) {
|
2017-11-29 11:59:18 -08:00
|
|
|
|
sources += [
|
|
|
|
|
"win/cpu_context_win_test.cc",
|
|
|
|
|
"win/exception_snapshot_win_test.cc",
|
|
|
|
|
"win/extra_memory_ranges_test.cc",
|
2018-12-20 20:44:15 -08:00
|
|
|
|
"win/module_snapshot_win_test.cc",
|
2017-11-29 11:59:18 -08:00
|
|
|
|
"win/pe_image_reader_test.cc",
|
|
|
|
|
"win/process_reader_win_test.cc",
|
|
|
|
|
"win/process_snapshot_win_test.cc",
|
|
|
|
|
"win/system_snapshot_win_test.cc",
|
|
|
|
|
]
|
2018-02-16 09:48:15 -08:00
|
|
|
|
} else if (!crashpad_is_fuchsia) {
|
|
|
|
|
# Timezones are currently non-functional on Fuchsia:
|
|
|
|
|
# https://fuchsia.googlesource.com/zircon/+/master/third_party/ulib/musl/src/time/__tz.c#9
|
|
|
|
|
# https://crashpad.chromium.org/bug/196. Relevant upstream bugs are ZX-337
|
|
|
|
|
# and ZX-1731.
|
2017-11-17 17:48:22 -08:00
|
|
|
|
sources += [ "posix/timezone_test.cc" ]
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-22 11:06:35 -08:00
|
|
|
|
if (crashpad_is_fuchsia) {
|
2018-12-14 13:17:43 -08:00
|
|
|
|
sources += [
|
|
|
|
|
"fuchsia/process_reader_fuchsia_test.cc",
|
|
|
|
|
"fuchsia/process_snapshot_fuchsia_test.cc",
|
|
|
|
|
]
|
2018-02-22 11:06:35 -08:00
|
|
|
|
}
|
|
|
|
|
|
2017-12-19 14:21:14 -05:00
|
|
|
|
# public_configs isn’t quite right. snapshot_test_link sets ldflags, and
|
|
|
|
|
# what’s really needed is a way to push ldflags to dependent targets that
|
|
|
|
|
# produce linker output. Luckily in this case, all dependents do produce
|
|
|
|
|
# linker output. https://crbug.com/796183.
|
|
|
|
|
public_configs = [ ":snapshot_test_link" ]
|
|
|
|
|
|
2017-11-17 17:48:22 -08:00
|
|
|
|
deps = [
|
|
|
|
|
":test_support",
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
|
|
|
|
"../compat",
|
2020-04-10 17:40:41 -04:00
|
|
|
|
"../minidump:format",
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../test",
|
2017-12-18 14:35:55 -08:00
|
|
|
|
"../third_party/gtest:gtest",
|
|
|
|
|
"../third_party/mini_chromium:base",
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../util",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
data_deps = [
|
|
|
|
|
":crashpad_snapshot_test_module",
|
|
|
|
|
":crashpad_snapshot_test_module_large",
|
|
|
|
|
":crashpad_snapshot_test_module_small",
|
|
|
|
|
]
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_mac) {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
libs = [ "OpenCL.framework" ]
|
|
|
|
|
|
|
|
|
|
data_deps += [
|
|
|
|
|
":crashpad_snapshot_test_module_crashy_initializer",
|
|
|
|
|
":crashpad_snapshot_test_no_op",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-21 17:54:12 -05:00
|
|
|
|
if (crashpad_is_linux || crashpad_is_android) {
|
2017-12-19 14:21:14 -05:00
|
|
|
|
libs = [ "dl" ]
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-10 11:17:22 +02:00
|
|
|
|
if ((crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) &&
|
|
|
|
|
target_cpu != "mipsel" && target_cpu != "mips64el") {
|
2018-02-02 14:04:48 -08:00
|
|
|
|
data_deps += [ ":crashpad_snapshot_test_both_dt_hash_styles" ]
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
data_deps += [
|
|
|
|
|
":crashpad_snapshot_test_annotations",
|
|
|
|
|
":crashpad_snapshot_test_crashing_child",
|
|
|
|
|
":crashpad_snapshot_test_dump_without_crashing",
|
|
|
|
|
":crashpad_snapshot_test_extra_memory_ranges",
|
|
|
|
|
":crashpad_snapshot_test_image_reader",
|
|
|
|
|
":crashpad_snapshot_test_image_reader_module",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_loadable_module("crashpad_snapshot_test_module") {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
testonly = true
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "crashpad_info_client_options_test_module.cc" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
deps = [
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
2017-12-18 14:35:55 -08:00
|
|
|
|
"../third_party/mini_chromium:base",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_loadable_module("crashpad_snapshot_test_module_large") {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
testonly = true
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "crashpad_info_size_test_module.cc" ]
|
2018-02-16 09:55:34 -08:00
|
|
|
|
|
|
|
|
|
deps = []
|
|
|
|
|
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
|
|
|
|
|
sources += [ "crashpad_info_size_test_note.S" ]
|
|
|
|
|
deps += [ "../util" ]
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-17 17:48:22 -08:00
|
|
|
|
defines = [ "CRASHPAD_INFO_SIZE_TEST_MODULE_LARGE" ]
|
2018-02-16 09:55:34 -08:00
|
|
|
|
deps += [ "../third_party/mini_chromium:base" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_loadable_module("crashpad_snapshot_test_module_small") {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
testonly = true
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "crashpad_info_size_test_module.cc" ]
|
2018-02-16 09:55:34 -08:00
|
|
|
|
|
|
|
|
|
deps = []
|
|
|
|
|
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
|
|
|
|
|
sources += [ "crashpad_info_size_test_note.S" ]
|
|
|
|
|
deps += [ "../util" ]
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-17 17:48:22 -08:00
|
|
|
|
defines = [ "CRASHPAD_INFO_SIZE_TEST_MODULE_SMALL" ]
|
2018-02-16 09:55:34 -08:00
|
|
|
|
deps += [ "../third_party/mini_chromium:base" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
}
|
|
|
|
|
|
2018-07-10 11:17:22 +02:00
|
|
|
|
if ((crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) &&
|
|
|
|
|
target_cpu != "mipsel" && target_cpu != "mips64el") {
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_loadable_module("crashpad_snapshot_test_both_dt_hash_styles") {
|
Read either DT_HASH or DT_GNU_HASH to determine the size of DT_SYMTAB
Without the section headers for the symbol table, there's no direct way
to calculate the number of entries in the table.
DT_HASH and DT_GNU_HASH are auxiliary tables that are designed to make
symbol lookup faster. DT_HASH is the original and is theoretically
mandatory. DT_GNU_HASH is the new-and-improved, but is more complex.
In practice, however, an Android build (at least vs. API 16) has only
DT_HASH, and not DT_GNU_HASH, and a Fuchsia build has only DT_GNU_HASH
but not DT_HASH. So, both are tried.
This change does not actually use the data in these tables to improve
the speed of symbol lookup, but instead only uses them to correctly
terminate the linear search.
DT_HASH contains the total number of symbols in the symbol table fairly
directly because there is an entry for each symbol table entry in the
hash table, so the number is the same.
DT_GNU_HASH regrettably does not. Instead, it's necessary to walk the
buckets and chain structure to find the largest entry.
DT_GNU_HASH doesn't appear in any "real" documentation that I'm aware
of, other than the binutils code (at least as far as I know). Some
more-and-less-useful references:
- https://flapenguin.me/2017/04/24/elf-lookup-dt-hash/
- https://flapenguin.me/2017/05/10/elf-lookup-dt-gnu-hash/
- http://deroko.phearless.org/dt_gnu_hash.txt
- https://sourceware.org/ml/binutils/2006-10/msg00377.html
Change-Id: I7cfc4372f29efc37446f0931d22a1f790e44076f
Bug: crashpad:213, crashpad:196
Reviewed-on: https://chromium-review.googlesource.com/876879
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2018-01-30 14:30:50 -08:00
|
|
|
|
testonly = true
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "hash_types_test.cc" ]
|
Read either DT_HASH or DT_GNU_HASH to determine the size of DT_SYMTAB
Without the section headers for the symbol table, there's no direct way
to calculate the number of entries in the table.
DT_HASH and DT_GNU_HASH are auxiliary tables that are designed to make
symbol lookup faster. DT_HASH is the original and is theoretically
mandatory. DT_GNU_HASH is the new-and-improved, but is more complex.
In practice, however, an Android build (at least vs. API 16) has only
DT_HASH, and not DT_GNU_HASH, and a Fuchsia build has only DT_GNU_HASH
but not DT_HASH. So, both are tried.
This change does not actually use the data in these tables to improve
the speed of symbol lookup, but instead only uses them to correctly
terminate the linear search.
DT_HASH contains the total number of symbols in the symbol table fairly
directly because there is an entry for each symbol table entry in the
hash table, so the number is the same.
DT_GNU_HASH regrettably does not. Instead, it's necessary to walk the
buckets and chain structure to find the largest entry.
DT_GNU_HASH doesn't appear in any "real" documentation that I'm aware
of, other than the binutils code (at least as far as I know). Some
more-and-less-useful references:
- https://flapenguin.me/2017/04/24/elf-lookup-dt-hash/
- https://flapenguin.me/2017/05/10/elf-lookup-dt-gnu-hash/
- http://deroko.phearless.org/dt_gnu_hash.txt
- https://sourceware.org/ml/binutils/2006-10/msg00377.html
Change-Id: I7cfc4372f29efc37446f0931d22a1f790e44076f
Bug: crashpad:213, crashpad:196
Reviewed-on: https://chromium-review.googlesource.com/876879
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2018-01-30 14:30:50 -08:00
|
|
|
|
|
|
|
|
|
# This makes `ld` emit both .hash and .gnu.hash sections.
|
|
|
|
|
ldflags = [ "-Wl,--hash-style=both" ]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-19 15:31:04 -08:00
|
|
|
|
if (crashpad_is_mac) {
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_loadable_module("crashpad_snapshot_test_module_crashy_initializer") {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
testonly = true
|
|
|
|
|
sources = [
|
|
|
|
|
"mac/mach_o_image_annotations_reader_test_module_crashy_initializer.cc",
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("crashpad_snapshot_test_no_op") {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
testonly = true
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "mac/mach_o_image_annotations_reader_test_no_op.cc" ]
|
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_snapshot_test_annotations") {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
testonly = true
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/crashpad_snapshot_test_annotations.cc" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
deps = [
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
|
|
|
|
"../compat",
|
2017-12-18 14:35:55 -08:00
|
|
|
|
"../third_party/mini_chromium:base",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("crashpad_snapshot_test_crashing_child") {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
testonly = true
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/crashpad_snapshot_test_crashing_child.cc" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
deps = [
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
|
|
|
|
"../compat",
|
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
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("crashpad_snapshot_test_dump_without_crashing") {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
testonly = true
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/crashpad_snapshot_test_dump_without_crashing.cc" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
deps = [
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
|
|
|
|
"../compat",
|
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
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("crashpad_snapshot_test_extra_memory_ranges") {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
testonly = true
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/crashpad_snapshot_test_extra_memory_ranges.cc" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
deps = [
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
|
|
|
|
"../compat",
|
2017-12-18 14:35:55 -08:00
|
|
|
|
"../third_party/mini_chromium:base",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_executable("crashpad_snapshot_test_image_reader") {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
testonly = true
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/crashpad_snapshot_test_image_reader.cc" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
deps = [
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
|
|
|
|
"../compat",
|
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 17:15:10 -08:00
|
|
|
|
if (crashpad_is_in_chromium) {
|
|
|
|
|
if (symbol_level == 0) {
|
|
|
|
|
# The tests that use this executable rely on at least minimal debug
|
|
|
|
|
# info.
|
2018-03-26 19:54:26 -07:00
|
|
|
|
remove_configs = [ "//build/config/compiler:default_symbols" ]
|
|
|
|
|
configs = [ "//build/config/compiler:minimal_symbols" ]
|
2017-12-19 17:15:10 -08:00
|
|
|
|
}
|
2017-11-17 17:48:22 -08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-21 19:18:07 -07:00
|
|
|
|
crashpad_loadable_module("crashpad_snapshot_test_image_reader_module") {
|
2017-11-17 17:48:22 -08:00
|
|
|
|
testonly = true
|
2020-01-23 08:00:33 -05:00
|
|
|
|
sources = [ "win/crashpad_snapshot_test_image_reader_module.cc" ]
|
2017-11-17 17:48:22 -08:00
|
|
|
|
deps = [
|
2017-11-28 10:31:13 -08:00
|
|
|
|
"../client",
|
2017-12-18 14:35:55 -08:00
|
|
|
|
"../third_party/mini_chromium:base",
|
2017-11-17 17:48:22 -08:00
|
|
|
|
]
|
2017-12-19 17:15:10 -08:00
|
|
|
|
if (crashpad_is_in_chromium) {
|
|
|
|
|
if (symbol_level == 0) {
|
|
|
|
|
# The tests that use this module rely on at least minimal debug info.
|
2018-03-26 19:54:26 -07:00
|
|
|
|
remove_configs = [ "//build/config/compiler:default_symbols" ]
|
|
|
|
|
configs = [ "//build/config/compiler:minimal_symbols" ]
|
2017-12-19 17:15:10 -08:00
|
|
|
|
}
|
2017-11-17 17:48:22 -08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|