7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

Add missing sentry-native file

gitignore gone wrong
This commit is contained in:
Marek Roszko 2022-04-03 21:19:19 -04:00
parent aee5ff8935
commit 9a0fa460d1
69 changed files with 11417 additions and 0 deletions

View File

@ -0,0 +1,73 @@
# GitHub actions workflow.
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
name: Build+Test CI
on:
push:
branches: [main]
schedule:
# The GH mirroring from Google GoB does not trigger push actions.
# Fire it every other day to provide some coverage. This will run ~8 AM PT.
- cron: '39 3 */2 * *'
# Allow for manual triggers from the web.
workflow_dispatch:
jobs:
autotools:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cc: gcc
cxx: g++
- os: ubuntu-latest
cc: clang
cxx: clang++
- os: macos-latest
cc: clang
cxx: clang++
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- name: System settings
run: |
set -x
$CC --version
$CXX --version
getconf _NPROCESSORS_ONLN
getconf _NPROCESSORS_CONF
true
- name: Checkout depot_tools
run: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git ../depot_tools
- name: Checkout breakpad
run: |
set -xe
PATH+=:$PWD/../depot_tools
gclient config --unmanaged --name=src https://github.com/${{ github.repository }}
gclient sync --no-history --nohooks
# First build & test in-tree.
- run: ./configure --disable-silent-rules
working-directory: src
- run: make -j$(getconf _NPROCESSORS_CONF)
working-directory: src
- run: make -j$(getconf _NPROCESSORS_CONF) check VERBOSE=1
working-directory: src
- run: make -j$(getconf _NPROCESSORS_CONF) distclean
working-directory: src
# Then build & test out-of-tree.
- run: mkdir -p src/build/native
- run: ../../configure --disable-silent-rules
working-directory: src/build/native
- run: make -j$(getconf _NPROCESSORS_CONF) distcheck VERBOSE=1
working-directory: src/build/native

View File

@ -0,0 +1,41 @@
# Copyright 2014 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
'targets': [
{
'target_name': 'All',
'type': 'none',
'dependencies': [
'../common/common.gyp:*',
'../processor/processor.gyp:*',
'../tools/tools.gyp:*',
],
},
],
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,57 @@
# Copyright 2014 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
'target_conditions': [
['OS!="win"', {
'sources/': [
['exclude', '(^|/)windows/'],
],
}],
['OS!="linux"', {
'sources/': [
['exclude', '(^|/)linux/'],
],
}],
['OS!="mac"', {
'sources/': [
['exclude', '(^|/)mac/'],
],
}],
['OS!="android"', {
'sources/': [
['exclude', '(^|/)android/'],
],
}],
['OS!="solaris"', {
'sources/': [
['exclude', '(^|/)solaris/'],
],
}],
],
}

View File

@ -0,0 +1,67 @@
#!/usr/bin/env python
# Copyright 2014 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import os
import platform
import sys
script_dir = os.path.dirname(os.path.realpath(__file__))
breakpad_root = os.path.abspath(os.path.join(script_dir, os.pardir))
sys.path.insert(0, os.path.join(breakpad_root, 'tools', 'gyp', 'pylib'))
import gyp
def run_gyp(args):
rc = gyp.main(args)
if rc != 0:
print 'Error running GYP'
sys.exit(rc)
def main():
args = sys.argv[1:]
args.append(os.path.join(script_dir, 'all.gyp'))
args.append('-I')
args.append(os.path.join(breakpad_root, 'build', 'common.gypi'))
args.extend(['-D', 'gyp_output_dir=out'])
# Set the GYP DEPTH variable to the root of the project.
args.append('--depth=' + os.path.relpath(breakpad_root))
print 'Updating projects from gyp files...'
sys.stdout.flush()
run_gyp(args)
if __name__ == '__main__':
sys.exit(main())

View File

@ -0,0 +1,90 @@
# Copyright 2014 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
'targets': [
{
'target_name': 'gtest',
'type': 'static_library',
'sources': [
'../testing/googletest/src/gtest-all.cc',
],
'include_dirs': [
'../testing/googletest',
'../testing/googletest/include',
],
'direct_dependent_settings': {
'include_dirs': [
'../testing/googletest/include',
],
},
},
{
'target_name': 'gtest_main',
'type': 'static_library',
'dependencies': [
'gtest',
],
'sources': [
'../testing/googletest/src/gtest_main.cc',
],
},
{
'target_name': 'gmock',
'type': 'static_library',
'dependencies': [
'gtest',
],
'sources': [
'../testing/googlemock/src/gmock-all.cc',
],
'include_dirs': [
'../testing/googlemock',
'../testing/googlemock/include',
],
'direct_dependent_settings': {
'include_dirs': [
'../testing/googlemock/include',
],
},
'export_dependent_settings': [
'gtest',
],
},
{
'target_name': 'gmock_main',
'type': 'static_library',
'dependencies': [
'gmock',
],
'sources': [
'../testing/googlemock/src/gmock_main.cc',
],
},
],
}

View File

@ -0,0 +1,45 @@
name: Build
on:
push:
branches:
- getsentry
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Installing Linux Dependencies
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt update
sudo apt install zlib1g-dev libcurl4-openssl-dev libssl-dev libunwind-dev pkg-config
- name: Build crashpad
run: |
cmake -B cmake-build
cmake --build cmake-build --parallel
- name: Build crashpad with client-side stack traces
run: |
cmake -B cmake-build-stacks -D CRASHPAD_ENABLE_STACKTRACE=ON
cmake --build cmake-build-stacks --parallel
build-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"
- run: |
cmake -B crashpad-xcode -GXcode -DCMAKE_SYSTEM_NAME=iOS
xcodebuild build -project crashpad-xcode/crashpad.xcodeproj

View File

@ -0,0 +1,184 @@
# Copyright 2017 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.
import("build/crashpad_buildconfig.gni")
import("build/test.gni")
import("util/net/tls.gni")
config("crashpad_config") {
include_dirs = [ "." ]
}
if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
test("crashpad_tests") {
deps = [
"client:client_test",
"minidump:minidump_test",
"snapshot:snapshot_test",
"test:googlemock_main",
"test:test_test",
"util:util_test",
]
if (!crashpad_is_ios && !crashpad_is_fuchsia) {
deps += [ "handler:handler_test" ]
}
if (crashpad_is_in_fuchsia) {
# TODO(fuchsia:46559): Fix the leaks and remove this.
deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
}
if (crashpad_is_android) {
use_raw_android_executable = true
copy("crashpad_test_data") {
testonly = true
sources = [
"test/test_paths_test_data_root.txt",
"util/net/testdata/ascii_http_body.txt",
"util/net/testdata/binary_http_body.dat",
]
outputs = [ "$root_out_dir/crashpad_test_data/{{source}}" ]
}
deps += [ ":crashpad_test_data" ]
extra_dist_files = [
"$root_out_dir/crashpad_handler",
"$root_out_dir/crashpad_test_test_multiprocess_exec_test_child",
"$root_out_dir/crashpad_test_data",
]
}
}
if (crashpad_is_in_fuchsia) {
import("//build/components.gni")
fuchsia_test_component("crashpad-test-component") {
manifest = "test/fuchsia_crashpad_tests.cmx"
deps = [
":crashpad-test-resources",
":crashpad_tests",
"snapshot:crashpad_snapshot_test_both_dt_hash_styles",
"snapshot:crashpad_snapshot_test_module",
"snapshot:crashpad_snapshot_test_module_large",
"snapshot:crashpad_snapshot_test_module_small",
"test:crashpad_test_test_multiprocess_exec_test_child",
"util:http_transport_test_server",
]
}
fuchsia_test_package("crashpad-test") {
test_components = [ ":crashpad-test-component" ]
deps = [
"//src/connectivity/network/dns:component-legacy",
"//src/connectivity/network/netstack:component-legacy",
]
test_specs = {
log_settings = {
max_severity = "FATAL"
}
}
}
_resource_files = [
"test/test_paths_test_data_root.txt",
"util/net/testdata/ascii_http_body.txt",
"util/net/testdata/binary_http_body.dat",
]
if (crashpad_use_boringssl_for_http_transport_socket) {
_resource_files += [
"util/net/testdata/crashpad_util_test_cert.pem",
"util/net/testdata/crashpad_util_test_key.pem",
]
}
_resources = []
foreach(resource_file, _resource_files) {
_resource_file_target = string_replace(resource_file, "/", "_")
resource("${_resource_file_target}") {
sources = [ "${resource_file}" ]
outputs = [ "data/${resource_file}" ]
}
_resources += [ ":${_resource_file_target}" ]
}
group("crashpad-test-resources") {
deps = _resources
}
fuchsia_shell_package("crashpad-database-util") {
package_name = "crashpad_database_util"
deps = [ "tools:crashpad_database_util" ]
}
group("tests") {
testonly = true
deps = [ ":crashpad-test" ]
}
}
} else if (crashpad_is_standalone || crashpad_is_external) {
test("crashpad_client_test") {
deps = [
"client:client_test",
"test:googlemock_main",
]
}
test("crashpad_handler_test") {
deps = [
"handler:handler_test",
"test:googletest_main",
]
if (crashpad_is_ios || crashpad_is_fuchsia) {
deps -= [ "handler:handler_test" ]
}
}
test("crashpad_minidump_test") {
deps = [
"minidump:minidump_test",
"test:googletest_main",
]
}
test("crashpad_snapshot_test") {
deps = [
"snapshot:snapshot_test",
"test:googlemock_main",
]
}
test("crashpad_test_test") {
deps = [
"test:googlemock_main",
"test:test_test",
]
}
test("crashpad_util_test") {
deps = [
"test:googlemock_main",
"util:util_test",
]
}
}
if (crashpad_is_ios) {
group("ios_xcuitests") {
testonly = true
deps = [ "test/ios:all_tests" ]
}
}

View File

@ -0,0 +1,68 @@
# Copyright 2017 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.
# When building in Chromium, these configs is used to set #defines that indicate
# whether code is being built standalone, or in Chromium, or potentially in some
# other configutation.
import("crashpad_buildconfig.gni")
config("crashpad_is_in_chromium") {
if (crashpad_is_in_chromium) {
defines = [ "CRASHPAD_IS_IN_CHROMIUM" ]
}
}
config("crashpad_is_in_fuchsia") {
if (crashpad_is_in_fuchsia) {
defines = [ "CRASHPAD_IS_IN_FUCHSIA" ]
}
}
group("default_exe_manifest_win") {
if (crashpad_is_in_chromium) {
deps = [ "//build/win:default_exe_manifest" ]
}
}
config("crashpad_fuzzer_flags") {
cflags = [
"-fsanitize=address",
"-fsanitize-address-use-after-scope",
"-fsanitize=fuzzer",
]
ldflags = [ "-fsanitize=address" ]
}
if (crashpad_is_ios) {
group("ios_enable_arc") {
if (crashpad_is_in_chromium) {
public_configs = [ "//build/config/compiler:enable_arc" ]
} else if (crashpad_is_standalone) {
public_configs =
[ "//third_party/mini_chromium/mini_chromium/build/config:ios_enable_arc" ]
}
}
group("ios_xctest") {
if (crashpad_is_in_chromium) {
public_configs = [ "//build/config/ios:xctest_config" ]
} else if (crashpad_is_standalone) {
public_configs = [
"//third_party/mini_chromium/mini_chromium/build/ios:xctest_config",
]
}
}
}

View File

@ -0,0 +1,99 @@
# Copyright 2017 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.
# Intentionally very minimal, so that Crashpad can build in-tree in a variety of
# other projects, unrelated to the variables that are set in those projects'
# BUILDCONFIG.gn. Do not add more variables here. Instead, make them available
# in build/crashpad_buildconfig.gni if they must be globally available.
if (target_os == "") {
target_os = host_os
}
if (current_os == "") {
current_os = target_os
}
if (target_cpu == "") {
target_cpu = host_cpu
}
if (current_cpu == "") {
current_cpu = target_cpu
}
import("//build/crashpad_buildconfig.gni")
if (crashpad_is_standalone) {
_mini_chromium_dir = "//third_party/mini_chromium/mini_chromium"
} else if (crashpad_is_external) {
_mini_chromium_dir = "//../../mini_chromium/mini_chromium"
}
if (current_os == "win") {
set_default_toolchain(
"$_mini_chromium_dir/build/config:msvc_toolchain_$current_cpu")
} else {
set_default_toolchain("$_mini_chromium_dir/build/config:gcc_like_toolchain")
}
declare_args() {
# When true, enables the debug configuration, with additional run-time checks
# and logging. When false, enables the release configuration, with additional
# optimizations.
is_debug = false
# When true, build all code with -fsanitize=fuzzer, and enable various
# *_fuzzer targets.
crashpad_use_libfuzzer = false
}
_default_configs = [
"$_mini_chromium_dir/build/config:default",
"$_mini_chromium_dir/build/config:Wexit_time_destructors",
"$_mini_chromium_dir/build/config:Wimplicit_fallthrough",
]
if (crashpad_use_libfuzzer) {
_default_configs += [ "//build/config:crashpad_fuzzer_flags" ]
}
_default_executable_configs = _default_configs + [
"$_mini_chromium_dir/build/config:executable",
"$_mini_chromium_dir/build/config:win_console",
]
set_defaults("source_set") {
configs = _default_configs
}
set_defaults("static_library") {
configs = _default_configs
}
set_defaults("executable") {
configs = _default_executable_configs
}
set_defaults("loadable_module") {
configs = _default_configs
}
set_defaults("shared_library") {
configs = _default_configs
}
set_defaults("test") {
configs = _default_executable_configs
}

View File

@ -0,0 +1,160 @@
# Copyright 2017 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.
declare_args() {
# Determines various flavors of build configuration, and which concrete
# targets to use for dependencies. Valid values are "standalone", "chromium",
# "fuchsia", "dart" or "external".
crashpad_dependencies = "standalone"
if (defined(is_fuchsia_tree) && is_fuchsia_tree) {
crashpad_dependencies = "fuchsia"
}
}
assert(
crashpad_dependencies == "chromium" || crashpad_dependencies == "fuchsia" ||
crashpad_dependencies == "standalone" ||
crashpad_dependencies == "external" || crashpad_dependencies == "dart")
crashpad_is_in_chromium = crashpad_dependencies == "chromium"
crashpad_is_in_fuchsia = crashpad_dependencies == "fuchsia"
crashpad_is_in_dart = crashpad_dependencies == "dart"
crashpad_is_external = crashpad_dependencies == "external"
crashpad_is_standalone = crashpad_dependencies == "standalone"
# This is the parent directory that contains the mini_chromium source dir.
# This variable is not used when crashpad_is_in_chromium.
if (crashpad_is_in_fuchsia) {
mini_chromium_source_parent = "//third_party/crashpad/third_party/mini_chromium"
} else {
mini_chromium_source_parent = "../third_party/mini_chromium"
}
# This is the source directory of mini_chromium (what is checked out).
_mini_chromium_source_root = "$mini_chromium_source_parent/mini_chromium"
# This references the mini_chromium location for importing GN files.
if (crashpad_is_external || crashpad_is_in_dart) {
mini_chromium_import_root = "../../../$_mini_chromium_source_root"
} else if (crashpad_is_in_fuchsia) {
mini_chromium_import_root = "//third_party/mini_chromium"
} else {
mini_chromium_import_root = _mini_chromium_source_root
}
if (crashpad_is_in_chromium) {
crashpad_is_mac = is_mac
crashpad_is_ios = is_ios
crashpad_is_win = is_win
crashpad_is_linux = is_linux || is_chromeos
crashpad_is_android = is_android
crashpad_is_fuchsia = is_fuchsia
crashpad_is_posix = is_posix
crashpad_is_clang = is_clang
} else {
import("$mini_chromium_import_root/build/compiler.gni")
import("$mini_chromium_import_root/build/platform.gni")
crashpad_is_mac = mini_chromium_is_mac
crashpad_is_ios = mini_chromium_is_ios
crashpad_is_win = mini_chromium_is_win
crashpad_is_linux = mini_chromium_is_linux
crashpad_is_android = mini_chromium_is_android
crashpad_is_fuchsia = mini_chromium_is_fuchsia
crashpad_is_posix = mini_chromium_is_posix
crashpad_is_clang = mini_chromium_is_clang
}
template("crashpad_executable") {
executable(target_name) {
forward_variables_from(invoker,
"*",
[
"configs",
"remove_configs",
])
if (defined(invoker.remove_configs)) {
configs -= invoker.remove_configs
}
if (defined(invoker.configs)) {
configs += invoker.configs
}
if (crashpad_is_in_fuchsia) {
conversion_config = [ "//build/config:Wno-conversion" ]
if (configs + conversion_config - conversion_config == configs) {
# TODO(https://fxbug.dev/58162): Decide if these are worth enabling.
configs += conversion_config
}
}
}
}
template("crashpad_loadable_module") {
loadable_module(target_name) {
forward_variables_from(invoker,
"*",
[
"configs",
"remove_configs",
])
if (defined(invoker.remove_configs)) {
configs -= invoker.remove_configs
}
if (defined(invoker.configs)) {
configs += invoker.configs
}
if (crashpad_is_in_fuchsia) {
conversion_config = [ "//build/config:Wno-conversion" ]
if (configs + conversion_config - conversion_config == configs) {
# TODO(https://fxbug.dev/58162): Decide if these are worth enabling.
configs += conversion_config
}
}
}
}
template("crashpad_static_library") {
static_library(target_name) {
forward_variables_from(invoker,
"*",
[
"configs",
"remove_configs",
])
if (defined(invoker.remove_configs)) {
configs -= invoker.remove_configs
}
if (defined(invoker.configs)) {
configs += invoker.configs
}
if (crashpad_is_in_fuchsia) {
conversion_config = [ "//build/config:Wno-conversion" ]
if (configs + conversion_config - conversion_config == configs) {
# TODO(https://fxbug.dev/58162): Decide if these are worth enabling.
configs += conversion_config
}
}
}
}

View File

@ -0,0 +1,58 @@
# Copyright 2018 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.
import("crashpad_buildconfig.gni")
import("test.gni")
if (crashpad_is_in_chromium) {
import("//testing/libfuzzer/fuzzer_test.gni")
}
template("crashpad_fuzzer_test") {
if (crashpad_is_standalone && crashpad_use_libfuzzer) {
test(target_name) {
forward_variables_from(invoker,
[
"cflags",
"cflags_cc",
"check_includes",
"defines",
"include_dirs",
"sources",
])
configs += [ "..:crashpad_config" ]
if (defined(invoker.deps)) {
deps = invoker.deps
}
deps += [ "../third_party/libfuzzer" ]
if (!defined(invoker.cflags)) {
cflags = []
}
cflags += [ "-fsanitize=fuzzer" ]
}
if (defined(invoker.seed_corpus)) {
not_needed(invoker, [ "seed_corpus" ])
}
} else if (crashpad_is_in_chromium && use_fuzzing_engine) {
# Append "crashpad_" to the beginning of the fuzzer's name to make it easier
# in Chromium to recognize where fuzzer came from.
forward_variables_from(invoker, "*")
fuzzer_test("crashpad_" + target_name) {
}
} else {
not_needed(invoker, "*")
group(target_name) {
}
}
}

View File

@ -0,0 +1,74 @@
#!/usr/bin/env python3
# Copyright 2018 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.
# Various code adapted from:
# https://cs.chromium.org/chromium/src/build/linux/sysroot_scripts/install-sysroot.py
import os
import shutil
import subprocess
import sys
import urllib.request
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
# Sysroot revision from:
# https://cs.chromium.org/chromium/src/build/linux/sysroot_scripts/sysroots.json
SERVER = 'https://commondatastorage.googleapis.com'
PATH = 'chrome-linux-sysroot/toolchain'
REVISION = '43a87bbebccad99325fdcf34166295b121ee15c7'
FILENAME = 'debian_sid_amd64_sysroot.tar.xz'
def main():
url = '%s/%s/%s/%s' % (SERVER, PATH, REVISION, FILENAME)
sysroot = os.path.join(SCRIPT_DIR, os.pardir, 'third_party', 'linux',
'sysroot')
stamp = os.path.join(sysroot, '.stamp')
if os.path.exists(stamp):
with open(stamp) as s:
if s.read() == url:
return
print('Installing Debian root image from %s' % url)
if os.path.isdir(sysroot):
shutil.rmtree(sysroot)
os.mkdir(sysroot)
tarball = os.path.join(sysroot, FILENAME)
print('Downloading %s' % url)
for _ in range(3):
response = urllib.request.urlopen(url)
with open(tarball, 'wb') as f:
f.write(response.read())
break
else:
raise Exception('Failed to download %s' % url)
subprocess.check_call(['tar', 'xf', tarball, '-C', sysroot])
os.remove(tarball)
with open(stamp, 'w') as s:
s.write(url)
if __name__ == '__main__':
main()
sys.exit(0)

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>${IOS_BUNDLE_ID_PREFIX}.googletest.${GTEST_BUNDLE_ID_SUFFIX:rfc1034identifier}</string>
<key>UIApplicationDelegate</key>
<string>CrashpadUnitTestDelegate</string>
</dict>
</plist>

View File

@ -0,0 +1,361 @@
#!/usr/bin/env python
# Copyright 2020 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.
"""Convert GN Xcode projects to platform and configuration independent targets.
GN generates Xcode projects that build one configuration only. However, typical
iOS development involves using the Xcode IDE to toggle the platform and
configuration. This script replaces the 'gn' configuration with 'Debug',
'Release' and 'Profile', and changes the ninja invocation to honor these
configurations.
"""
import argparse
import collections
import copy
import filecmp
import json
import hashlib
import os
import re
import shutil
import subprocess
import sys
import tempfile
class XcodeProject(object):
def __init__(self, objects, counter = 0):
self.objects = objects
self.counter = 0
def AddObject(self, parent_name, obj):
while True:
self.counter += 1
str_id = "%s %s %d" % (parent_name, obj['isa'], self.counter)
new_id = hashlib.sha1(str_id.encode("utf-8")).hexdigest()[:24].upper()
# Make sure ID is unique. It's possible there could be an id conflict
# since this is run after GN runs.
if new_id not in self.objects:
self.objects[new_id] = obj
return new_id
def check_output(command):
"""Wrapper around subprocess.check_output that decode output as utf-8."""
return subprocess.check_output(command).decode('utf-8')
def CopyFileIfChanged(source_path, target_path):
"""Copy |source_path| to |target_path| if different."""
target_dir = os.path.dirname(target_path)
if not os.path.isdir(target_dir):
os.makedirs(target_dir)
if not os.path.exists(target_path) or \
not filecmp.cmp(source_path, target_path):
shutil.copyfile(source_path, target_path)
def CopyTreeIfChanged(source, target):
"""Copy |source| to |target| recursively; files are copied iff changed."""
if os.path.isfile(source):
return CopyFileIfChanged(source, target)
if not os.path.isdir(target):
os.makedirs(target)
for name in os.listdir(source):
CopyTreeIfChanged(
os.path.join(source, name),
os.path.join(target, name))
def LoadXcodeProjectAsJSON(project_dir):
"""Return Xcode project at |path| as a JSON string."""
return check_output([
'plutil', '-convert', 'json', '-o', '-',
os.path.join(project_dir, 'project.pbxproj')])
def WriteXcodeProject(output_path, json_string):
"""Save Xcode project to |output_path| as XML."""
with tempfile.NamedTemporaryFile() as temp_file:
temp_file.write(json_string.encode("utf-8"))
temp_file.flush()
subprocess.check_call(['plutil', '-convert', 'xml1', temp_file.name])
CopyFileIfChanged(
temp_file.name,
os.path.join(output_path, 'project.pbxproj'))
def UpdateXcodeProject(project_dir, configurations, root_dir):
"""Update inplace Xcode project to support multiple configurations.
Args:
project_dir: path to the input Xcode project
configurations: list of string corresponding to the configurations that
need to be supported by the tweaked Xcode projects, must contains at
least one value.
root_dir: path to the root directory used to find markdown files
"""
json_data = json.loads(LoadXcodeProjectAsJSON(project_dir))
project = XcodeProject(json_data['objects'])
objects_to_remove = []
for value in list(project.objects.values()):
isa = value['isa']
# Teach build shell script to look for the configuration and platform.
if isa == 'PBXShellScriptBuildPhase':
shell_path = value['shellPath']
if shell_path.endswith('/sh'):
value['shellScript'] = value['shellScript'].replace(
'ninja -C .',
'ninja -C "../${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}"')
elif re.search('[ /]python[23]?$', shell_path):
value['shellScript'] = value['shellScript'].replace(
'ninja_params = [ \'-C\', \'.\' ]',
'ninja_params = [ \'-C\', \'../\' + os.environ[\'CONFIGURATION\']'
' + os.environ[\'EFFECTIVE_PLATFORM_NAME\'] ]')
# Add new configuration, using the first one as default.
if isa == 'XCConfigurationList':
value['defaultConfigurationName'] = configurations[0]
objects_to_remove.extend(value['buildConfigurations'])
build_config_template = project.objects[value['buildConfigurations'][0]]
build_config_template['buildSettings']['CONFIGURATION_BUILD_DIR'] = \
'$(PROJECT_DIR)/../$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)'
value['buildConfigurations'] = []
for configuration in configurations:
new_build_config = copy.copy(build_config_template)
new_build_config['name'] = configuration
value['buildConfigurations'].append(
project.AddObject('products', new_build_config))
for object_id in objects_to_remove:
del project.objects[object_id]
source = GetOrCreateRootGroup(project, json_data['rootObject'], 'Source')
AddMarkdownToProject(project, root_dir, source)
SortFileReferencesByName(project, source)
objects = collections.OrderedDict(sorted(project.objects.items()))
WriteXcodeProject(project_dir, json.dumps(json_data))
def CreateGroup(project, parent_group, group_name, path=None):
group_object = {
'children': [],
'isa': 'PBXGroup',
'name': group_name,
'sourceTree': '<group>',
}
if path is not None:
group_object['path'] = path
parent_group_name = parent_group.get('name', '')
group_object_key = project.AddObject(parent_group_name, group_object)
parent_group['children'].append(group_object_key)
return group_object
def GetOrCreateRootGroup(project, root_object, group_name):
main_group = project.objects[project.objects[root_object]['mainGroup']]
for child_key in main_group['children']:
child = project.objects[child_key]
if child['name'] == group_name:
return child
return CreateGroup(project, main_group, group_name, path='../..')
class ObjectKey(object):
"""Wrapper around PBXFileReference and PBXGroup for sorting.
A PBXGroup represents a "directory" containing a list of files in an
Xcode project; it can contain references to a list of directories or
files.
A PBXFileReference represents a "file".
The type is stored in the object "isa" property as a string. Since we
want to sort all directories before all files, the < and > operators
are defined so that if "isa" is different, they are sorted in the
reverse of alphabetic ordering, otherwise the name (or path) property
is checked and compared in alphabetic order.
"""
def __init__(self, obj):
self.isa = obj['isa']
if 'name' in obj:
self.name = obj['name']
else:
self.name = obj['path']
def __lt__(self, other):
if self.isa != other.isa:
return self.isa > other.isa
return self.name < other.name
def __gt__(self, other):
if self.isa != other.isa:
return self.isa < other.isa
return self.name > other.name
def __eq__(self, other):
return self.isa == other.isa and self.name == other.name
def SortFileReferencesByName(project, group_object):
SortFileReferencesByNameWithSortKey(
project, group_object, lambda ref: ObjectKey(project.objects[ref]))
def SortFileReferencesByNameWithSortKey(project, group_object, sort_key):
group_object['children'].sort(key=sort_key)
for key in group_object['children']:
child = project.objects[key]
if child['isa'] == 'PBXGroup':
SortFileReferencesByNameWithSortKey(project, child, sort_key)
def AddMarkdownToProject(project, root_dir, group_object):
list_files_cmd = ['git', '-C', root_dir, 'ls-files', '*.md']
paths = check_output(list_files_cmd).splitlines()
ios_internal_dir = os.path.join(root_dir, 'ios_internal')
if os.path.exists(ios_internal_dir):
list_files_cmd = ['git', '-C', ios_internal_dir, 'ls-files', '*.md']
ios_paths = check_output(list_files_cmd).splitlines()
paths.extend([os.path.join("ios_internal", path) for path in ios_paths])
for path in paths:
new_markdown_entry = {
"fileEncoding": "4",
"isa": "PBXFileReference",
"lastKnownFileType": "net.daringfireball.markdown",
"name": os.path.basename(path),
"path": path,
"sourceTree": "<group>"
}
new_markdown_entry_id = project.AddObject('sources', new_markdown_entry)
folder = GetFolderForPath(project, group_object, os.path.dirname(path))
folder['children'].append(new_markdown_entry_id)
def GetFolderForPath(project, group_object, path):
objects = project.objects
if not path:
return group_object
for folder in path.split('/'):
children = group_object['children']
new_root = None
for child in children:
if objects[child]['isa'] == 'PBXGroup' and \
objects[child]['name'] == folder:
new_root = objects[child]
break
if not new_root:
# If the folder isn't found we could just cram it into the leaf existing
# folder, but that leads to folders with tons of README.md inside.
new_root = CreateGroup(project, group_object, folder)
group_object = new_root
return group_object
def ConvertGnXcodeProject(root_dir, input_dir, output_dir, configurations):
'''Tweak the Xcode project generated by gn to support multiple configurations.
The Xcode projects generated by "gn gen --ide" only supports a single
platform and configuration (as the platform and configuration are set
per output directory). This method takes as input such projects and
add support for multiple configurations and platforms (to allow devs
to select them in Xcode).
Args:
input_dir: directory containing the XCode projects created by "gn gen --ide"
output_dir: directory where the tweaked Xcode projects will be saved
configurations: list of string corresponding to the configurations that
need to be supported by the tweaked Xcode projects, must contains at
least one value.
'''
# Update the project (supports legacy name "products.xcodeproj" or the new
# project name "all.xcodeproj").
for project_name in ('all.xcodeproj', 'products.xcodeproj'):
if os.path.exists(os.path.join(input_dir, project_name)):
UpdateXcodeProject(
os.path.join(input_dir, project_name),
configurations, root_dir)
CopyTreeIfChanged(os.path.join(input_dir, project_name),
os.path.join(output_dir, project_name))
else:
shutil.rmtree(os.path.join(output_dir, project_name), ignore_errors=True)
# Copy all.xcworkspace if it exists (will be removed in a future gn version).
workspace_name = 'all.xcworkspace'
if os.path.exists(os.path.join(input_dir, workspace_name)):
CopyTreeIfChanged(os.path.join(input_dir, workspace_name),
os.path.join(output_dir, workspace_name))
else:
shutil.rmtree(os.path.join(output_dir, workspace_name), ignore_errors=True)
def Main(args):
parser = argparse.ArgumentParser(
description='Convert GN Xcode projects for iOS.')
parser.add_argument(
'input',
help='directory containing [product|all] Xcode projects.')
parser.add_argument(
'output',
help='directory where to generate the iOS configuration.')
parser.add_argument(
'--add-config', dest='configurations', default=[], action='append',
help='configuration to add to the Xcode project')
parser.add_argument(
'--root', type=os.path.abspath, required=True,
help='root directory of the project')
args = parser.parse_args(args)
if not os.path.isdir(args.input):
sys.stderr.write('Input directory does not exists.\n')
return 1
# Depending on the version of "gn", there should be either one project file
# named "all.xcodeproj" or a project file named "products.xcodeproj" and a
# workspace named "all.xcworkspace".
required_files_sets = [
set(("all.xcodeproj",)),
set(("products.xcodeproj", "all.xcworkspace")),
]
for required_files in required_files_sets:
if required_files.issubset(os.listdir(args.input)):
break
else:
sys.stderr.write(
'Input directory does not contain all necessary Xcode projects.\n')
return 1
if not args.configurations:
sys.stderr.write('At least one configuration required, see --add-config.\n')
return 1
ConvertGnXcodeProject(args.root, args.input, args.output, args.configurations)
if __name__ == '__main__':
sys.exit(Main(sys.argv[1:]))

View File

@ -0,0 +1,39 @@
# Copyright 2020 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.
[goma]
# Controls whether goma is enabled or not. If you generally use goma but
# want to disable goma for a single build, consider using the environment
# variable GOMA_DISABLED.
enabled = False
install = "$GOMA_DIR"
[xcode]
# Controls settings for the generated Xcode project. If jobs is non-zero
# it will be passed to the ninja invocation in Xcode project.
jobs = 0
[build]
# Controls the build output. The only supported values are "64-bit", "32-bit"
# and "fat" (for a fat binary supporting both "32-bit" and "64-bit" cpus).
arch = "64-bit"
[gn_args]
# Values in that section will be copied verbatim in the generated args.gn file.
target_os = "ios"
[filters]
# List of target files to pass to --filters argument of gn gen when generating
# the Xcode project. By default, list all targets from ios/ and ios_internal/
# and the targets corresponding to the unit tests run on the bots.

View File

@ -0,0 +1,348 @@
#!/usr/bin/env python
# Copyright 2020 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.
import argparse
import convert_gn_xcodeproj
import errno
import os
import re
import shutil
import subprocess
import sys
import tempfile
try:
import configparser
except ImportError:
import ConfigParser as configparser
try:
import StringIO as io
except ImportError:
import io
SUPPORTED_TARGETS = ('iphoneos', 'iphonesimulator')
SUPPORTED_CONFIGS = ('Debug', 'Release', 'Profile', 'Official', 'Coverage')
class ConfigParserWithStringInterpolation(configparser.SafeConfigParser):
'''A .ini file parser that supports strings and environment variables.'''
ENV_VAR_PATTERN = re.compile(r'\$([A-Za-z0-9_]+)')
def values(self, section):
return map(lambda kv: self._UnquoteString(self._ExpandEnvVar(kv[1])),
configparser.ConfigParser.items(self, section))
def getstring(self, section, option):
return self._UnquoteString(self._ExpandEnvVar(self.get(section,
option)))
def _UnquoteString(self, string):
if not string or string[0] != '"' or string[-1] != '"':
return string
return string[1:-1]
def _ExpandEnvVar(self, value):
match = self.ENV_VAR_PATTERN.search(value)
if not match:
return value
name, (begin, end) = match.group(1), match.span(0)
prefix, suffix = value[:begin], self._ExpandEnvVar(value[end:])
return prefix + os.environ.get(name, '') + suffix
class GnGenerator(object):
'''Holds configuration for a build and method to generate gn default
files.'''
FAT_BUILD_DEFAULT_ARCH = '64-bit'
TARGET_CPU_VALUES = {
'iphoneos': {
'32-bit': '"arm"',
'64-bit': '"arm64"',
},
'iphonesimulator': {
'32-bit': '"x86"',
'64-bit': '"x64"',
}
}
def __init__(self, settings, config, target):
assert target in SUPPORTED_TARGETS
assert config in SUPPORTED_CONFIGS
self._settings = settings
self._config = config
self._target = target
def _GetGnArgs(self):
"""Build the list of arguments to pass to gn.
Returns:
A list of tuple containing gn variable names and variable values (it
is not a dictionary as the order needs to be preserved).
"""
args = []
args.append(('is_debug', self._config in ('Debug', 'Coverage')))
if os.environ.get('FORCE_MAC_TOOLCHAIN', '0') == '1':
args.append(('use_system_xcode', False))
cpu_values = self.TARGET_CPU_VALUES[self._target]
build_arch = self._settings.getstring('build', 'arch')
if build_arch == 'fat':
target_cpu = cpu_values[self.FAT_BUILD_DEFAULT_ARCH]
args.append(('target_cpu', target_cpu))
args.append(
('additional_target_cpus',
[cpu for cpu in cpu_values.itervalues() if cpu != target_cpu]))
else:
args.append(('target_cpu', cpu_values[build_arch]))
# Add user overrides after the other configurations so that they can
# refer to them and override them.
args.extend(self._settings.items('gn_args'))
return args
def Generate(self, gn_path, root_path, out_path):
buf = io.StringIO()
self.WriteArgsGn(buf)
WriteToFileIfChanged(os.path.join(out_path, 'args.gn'),
buf.getvalue(),
overwrite=True)
subprocess.check_call(
self.GetGnCommand(gn_path, root_path, out_path, True))
def CreateGnRules(self, gn_path, root_path, out_path):
buf = io.StringIO()
self.WriteArgsGn(buf)
WriteToFileIfChanged(os.path.join(out_path, 'args.gn'),
buf.getvalue(),
overwrite=True)
buf = io.StringIO()
gn_command = self.GetGnCommand(gn_path, root_path, out_path, False)
self.WriteBuildNinja(buf, gn_command)
WriteToFileIfChanged(os.path.join(out_path, 'build.ninja'),
buf.getvalue(),
overwrite=False)
buf = io.StringIO()
self.WriteBuildNinjaDeps(buf)
WriteToFileIfChanged(os.path.join(out_path, 'build.ninja.d'),
buf.getvalue(),
overwrite=False)
def WriteArgsGn(self, stream):
stream.write('# This file was generated by setup-gn.py. Do not edit\n')
stream.write('# but instead use ~/.setup-gn or $repo/.setup-gn files\n')
stream.write('# to configure settings.\n')
stream.write('\n')
if self._settings.has_section('$imports$'):
for import_rule in self._settings.values('$imports$'):
stream.write('import("%s")\n' % import_rule)
stream.write('\n')
gn_args = self._GetGnArgs()
for name, value in gn_args:
if isinstance(value, bool):
stream.write('%s = %s\n' % (name, str(value).lower()))
elif isinstance(value, list):
stream.write('%s = [%s' %
(name, '\n' if len(value) > 1 else ''))
if len(value) == 1:
prefix = ' '
suffix = ' '
else:
prefix = ' '
suffix = ',\n'
for item in value:
if isinstance(item, bool):
stream.write('%s%s%s' %
(prefix, str(item).lower(), suffix))
else:
stream.write('%s%s%s' % (prefix, item, suffix))
stream.write(']\n')
else:
stream.write('%s = %s\n' % (name, value))
def WriteBuildNinja(self, stream, gn_command):
stream.write('rule gn\n')
stream.write(' command = %s\n' % NinjaEscapeCommand(gn_command))
stream.write(' description = Regenerating ninja files\n')
stream.write('\n')
stream.write('build build.ninja: gn\n')
stream.write(' generator = 1\n')
stream.write(' depfile = build.ninja.d\n')
def WriteBuildNinjaDeps(self, stream):
stream.write('build.ninja: nonexistant_file.gn\n')
def GetGnCommand(self, gn_path, src_path, out_path, generate_xcode_project):
gn_command = [gn_path, '--root=%s' % os.path.realpath(src_path), '-q']
if generate_xcode_project:
gn_command.append('--ide=xcode')
gn_command.append('--ninja-executable=autoninja')
if self._settings.has_section('filters'):
target_filters = self._settings.values('filters')
if target_filters:
gn_command.append('--filters=%s' % ';'.join(target_filters))
else:
gn_command.append('--check')
gn_command.append('gen')
gn_command.append('//%s' % os.path.relpath(os.path.abspath(out_path),
os.path.abspath(src_path)))
return gn_command
def WriteToFileIfChanged(filename, content, overwrite):
'''Write |content| to |filename| if different. If |overwrite| is False
and the file already exists it is left untouched.'''
if os.path.exists(filename):
if not overwrite:
return
with open(filename) as file:
if file.read() == content:
return
if not os.path.isdir(os.path.dirname(filename)):
os.makedirs(os.path.dirname(filename))
with open(filename, 'w') as file:
file.write(content)
def NinjaNeedEscape(arg):
'''Returns True if |arg| needs to be escaped when written to .ninja file.'''
return ':' in arg or '*' in arg or ';' in arg
def NinjaEscapeCommand(command):
'''Escapes |command| in order to write it to .ninja file.'''
result = []
for arg in command:
if NinjaNeedEscape(arg):
arg = arg.replace(':', '$:')
arg = arg.replace(';', '\\;')
arg = arg.replace('*', '\\*')
else:
result.append(arg)
return ' '.join(result)
def FindGn():
'''Returns absolute path to gn binary looking at the PATH env variable.'''
for path in os.environ['PATH'].split(os.path.pathsep):
gn_path = os.path.join(path, 'gn')
if os.path.isfile(gn_path) and os.access(gn_path, os.X_OK):
return gn_path
return None
def GenerateXcodeProject(gn_path, root_dir, out_dir, settings):
'''Convert GN generated Xcode project into multi-configuration Xcode
project.'''
temp_path = tempfile.mkdtemp(
prefix=os.path.abspath(os.path.join(out_dir, '_temp')))
try:
generator = GnGenerator(settings, 'Debug', 'iphonesimulator')
generator.Generate(gn_path, root_dir, temp_path)
convert_gn_xcodeproj.ConvertGnXcodeProject(
root_dir, os.path.join(temp_path), os.path.join(out_dir, 'build'),
SUPPORTED_CONFIGS)
finally:
if os.path.exists(temp_path):
shutil.rmtree(temp_path)
def GenerateGnBuildRules(gn_path, root_dir, out_dir, settings):
'''Generates all template configurations for gn.'''
for config in SUPPORTED_CONFIGS:
for target in SUPPORTED_TARGETS:
build_dir = os.path.join(out_dir, '%s-%s' % (config, target))
generator = GnGenerator(settings, config, target)
generator.CreateGnRules(gn_path, root_dir, build_dir)
def Main(args):
default_root = os.path.normpath(
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
parser = argparse.ArgumentParser(
description='Generate build directories for use with gn.')
parser.add_argument(
'root',
default=default_root,
nargs='?',
help='root directory where to generate multiple out configurations')
parser.add_argument('--import',
action='append',
dest='import_rules',
default=[],
help='path to file defining default gn variables')
parser.add_argument('--gn-path',
default=None,
help='path to gn binary (default: look up in $PATH)')
parser.add_argument(
'--build-dir',
default='out',
help='path where the build should be created (default: %(default)s)')
args = parser.parse_args(args)
# Load configuration (first global and then any user overrides).
settings = ConfigParserWithStringInterpolation()
settings.read([
os.path.splitext(__file__)[0] + '.config',
os.path.expanduser('~/.setup-gn'),
])
# Add private sections corresponding to --import argument.
if args.import_rules:
settings.add_section('$imports$')
for i, import_rule in enumerate(args.import_rules):
if not import_rule.startswith('//'):
import_rule = '//%s' % os.path.relpath(
os.path.abspath(import_rule), os.path.abspath(args.root))
settings.set('$imports$', '$rule%d$' % i, import_rule)
# Validate settings.
if settings.getstring('build', 'arch') not in ('64-bit', '32-bit', 'fat'):
sys.stderr.write('ERROR: invalid value for build.arch: %s\n' %
settings.getstring('build', 'arch'))
sys.exit(1)
# Find path to gn binary either from command-line or in PATH.
if args.gn_path:
gn_path = args.gn_path
else:
gn_path = FindGn()
if gn_path is None:
sys.stderr.write('ERROR: cannot find gn in PATH\n')
sys.exit(1)
out_dir = os.path.join(args.root, args.build_dir)
if not os.path.isdir(out_dir):
os.makedirs(out_dir)
GenerateXcodeProject(gn_path, args.root, out_dir, settings)
GenerateGnBuildRules(gn_path, args.root, out_dir, settings)
if __name__ == '__main__':
sys.exit(Main(sys.argv[1:]))

View File

@ -0,0 +1,479 @@
#!/usr/bin/env python
# coding: utf-8
# Copyright 2014 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.
from __future__ import print_function
import argparse
import os
import pipes
import posixpath
import re
import subprocess
import sys
import tempfile
import uuid
CRASHPAD_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
os.pardir)
IS_WINDOWS_HOST = sys.platform.startswith('win')
def _FindGNFromBinaryDir(binary_dir):
"""Attempts to determine the path to a GN binary used to generate the build
files in the given binary_dir. This is necessary because `gn` might not be
in the path or might be in a non-standard location, particularly on build
machines."""
build_ninja = os.path.join(binary_dir, 'build.ninja')
if os.path.isfile(build_ninja):
with open(build_ninja, 'rb') as f:
# Look for the always-generated regeneration rule of the form:
#
# rule gn
# command = <gn binary> ... arguments ...
#
# to extract the gn binary's full path.
found_rule_gn = False
for line in f:
if line.strip() == 'rule gn':
found_rule_gn = True
continue
if found_rule_gn:
if len(line) == 0 or line[0] != ' ':
return None
if line.startswith(' command = '):
gn_command_line_parts = line.strip().split(' ')
if len(gn_command_line_parts) > 2:
return os.path.join(binary_dir,
gn_command_line_parts[2])
return None
def _BinaryDirTargetOS(binary_dir):
"""Returns the apparent target OS of binary_dir, or None if none appear to
be explicitly specified."""
gn_path = _FindGNFromBinaryDir(binary_dir)
if gn_path:
# Look for a GN “target_os”.
popen = subprocess.Popen([
gn_path, '--root=' + CRASHPAD_DIR, 'args', binary_dir,
'--list=target_os', '--short'
],
shell=IS_WINDOWS_HOST,
stdout=subprocess.PIPE,
stderr=open(os.devnull))
value = popen.communicate()[0]
if popen.returncode == 0:
match = re.match('target_os = "(.*)"$', value.decode('utf-8'))
if match:
return match.group(1)
# For GYP with Ninja, look for the appearance of “linux-android” in the path
# to ar. This path is configured by gyp_crashpad_android.py.
build_ninja_path = os.path.join(binary_dir, 'build.ninja')
if os.path.exists(build_ninja_path):
with open(build_ninja_path) as build_ninja_file:
build_ninja_content = build_ninja_file.read()
match = re.search('-linux-android(eabi)?-ar$', build_ninja_content,
re.MULTILINE)
if match:
return 'android'
return None
def _EnableVTProcessingOnWindowsConsole():
"""Enables virtual terminal processing for ANSI/VT100-style escape sequences
on a Windows console attached to standard output. Returns True on success.
Returns False if standard output is not a console or if virtual terminal
processing is not supported. The feature was introduced in Windows 10.
"""
import pywintypes
import win32console
import winerror
stdout_console = win32console.GetStdHandle(win32console.STD_OUTPUT_HANDLE)
try:
console_mode = stdout_console.GetConsoleMode()
except pywintypes.error as e:
if e.winerror == winerror.ERROR_INVALID_HANDLE:
# Standard output is not a console.
return False
raise
try:
# From <wincon.h>. This would be
# win32console.ENABLE_VIRTUAL_TERMINAL_PROCESSING, but its too new to
# be defined there.
ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004
stdout_console.SetConsoleMode(console_mode |
ENABLE_VIRTUAL_TERMINAL_PROCESSING)
except pywintypes.error as e:
if e.winerror == winerror.ERROR_INVALID_PARAMETER:
# ANSI/VT100-style escape sequence processing isnt supported before
# Windows 10.
return False
raise
return True
def _RunOnAndroidTarget(binary_dir, test, android_device, extra_command_line):
local_test_path = os.path.join(binary_dir, test)
MAYBE_UNSUPPORTED_TESTS = (
'crashpad_client_test',
'crashpad_handler_test',
'crashpad_minidump_test',
'crashpad_snapshot_test',
)
if not os.path.exists(local_test_path) and test in MAYBE_UNSUPPORTED_TESTS:
print('This test is not present and may not be supported, skipping')
return
def _adb(*args):
# Flush all of this scripts own buffered stdout output before running
# adb, which will likely produce its own output on stdout.
sys.stdout.flush()
adb_command = ['adb', '-s', android_device]
adb_command.extend(args)
subprocess.check_call(adb_command, shell=IS_WINDOWS_HOST)
def _adb_push(sources, destination):
args = list(sources)
args.append(destination)
_adb('push', *args)
def _adb_shell(command_args, env={}):
# Build a command to execute via “sh -c” instead of invoking it
# directly. Heres why:
#
# /system/bin/env isnt normally present prior to Android 6.0 (M), where
# toybox was introduced (Android platform/manifest 9a2c01e8450b).
# Instead, set environment variables by using the shells internal
# “export” command.
#
# adbd prior to Android 7.0 (N), and the adb client prior to SDK
# platform-tools version 24, dont know how to communicate a shell
# commands exit status. This was added in Android platform/system/core
# 606835ae5c4b). With older adb servers and clients, adb will “exit 0”
# indicating success even if the command failed on the device. This
# makes subprocess.check_call() semantics difficult to implement
# directly. As a workaround, have the device send the commands exit
# status over stdout and pick it back up in this function.
#
# Both workarounds are implemented by giving the device a simple script,
# which adbd will run as an “sh -c” argument.
adb_command = ['adb', '-s', android_device, 'shell']
script_commands = []
for k, v in env.items():
script_commands.append('export %s=%s' %
(pipes.quote(k), pipes.quote(v)))
script_commands.extend([
' '.join(pipes.quote(x) for x in command_args), 'status=${?}',
'echo "status=${status}"', 'exit ${status}'
])
adb_command.append('; '.join(script_commands))
child = subprocess.Popen(adb_command,
shell=IS_WINDOWS_HOST,
stdin=open(os.devnull),
stdout=subprocess.PIPE)
FINAL_LINE_RE = re.compile('status=(\d+)$')
final_line = None
while True:
# Use readline so that the test output appears “live” when running.
data = child.stdout.readline().decode('utf-8')
if data == '':
break
if final_line is not None:
# It wasnt really the final line.
print(final_line, end='')
final_line = None
if FINAL_LINE_RE.match(data.rstrip()):
final_line = data
else:
print(data, end='')
if final_line is None:
# Maybe there was some stderr output after the end of stdout. Old
# versions of adb, prior to when the exit status could be
# communicated, smush the two together.
raise subprocess.CalledProcessError(-1, adb_command)
status = int(FINAL_LINE_RE.match(final_line.rstrip()).group(1))
if status != 0:
raise subprocess.CalledProcessError(status, adb_command)
child.wait()
if child.returncode != 0:
raise subprocess.CalledProcessError(subprocess.returncode,
adb_command)
# /system/bin/mktemp isnt normally present prior to Android 6.0 (M), where
# toybox was introduced (Android platform/manifest 9a2c01e8450b). Fake it
# with a host-generated name. This wont retry if the name is in use, but
# with 122 bits of randomness, it should be OK. This uses “mkdir” instead of
# “mkdir -p”because the latter will not indicate failure if the directory
# already exists.
device_temp_dir = '/data/local/tmp/%s.%s' % (test, uuid.uuid4().hex)
_adb_shell(['mkdir', device_temp_dir])
try:
# Specify test dependencies that must be pushed to the device. This
# could be determined automatically in a GN build, following the example
# used for Fuchsia. Since nothing like that exists for GYP, hard-code it
# for supported tests.
test_build_artifacts = [test, 'crashpad_handler']
test_data = ['test/test_paths_test_data_root.txt']
if test == 'crashpad_test_test':
test_build_artifacts.append(
'crashpad_test_test_multiprocess_exec_test_child')
elif test == 'crashpad_util_test':
test_data.append('util/net/testdata/')
# Establish the directory structure on the device.
device_out_dir = posixpath.join(device_temp_dir, 'out')
device_mkdirs = [device_out_dir]
for source_path in test_data:
# A trailing slash could reasonably mean to copy an entire
# directory, but will interfere with whats needed from the path
# split. All parent directories of any source_path need to be be
# represented in device_mkdirs, but its important that no
# source_path itself wind up in device_mkdirs, even if source_path
# names a directory, because that would cause the “adb push” of the
# directory below to behave incorrectly.
if source_path.endswith(posixpath.sep):
source_path = source_path[:-1]
device_source_path = posixpath.join(device_temp_dir, source_path)
device_mkdir = posixpath.split(device_source_path)[0]
if device_mkdir not in device_mkdirs:
device_mkdirs.append(device_mkdir)
adb_mkdir_command = ['mkdir', '-p']
adb_mkdir_command.extend(device_mkdirs)
_adb_shell(adb_mkdir_command)
# Push the test binary and any other build output to the device.
local_test_build_artifacts = []
for artifact in test_build_artifacts:
local_test_build_artifacts.append(os.path.join(
binary_dir, artifact))
_adb_push(local_test_build_artifacts, device_out_dir)
# Push test data to the device.
for source_path in test_data:
_adb_push([os.path.join(CRASHPAD_DIR, source_path)],
posixpath.join(device_temp_dir, source_path))
# Run the test on the device. Pass the test data root in the
# environment.
#
# Because the test will not run with its standard output attached to a
# pseudo-terminal device, Google Test will not normally enable colored
# output, so mimic Google Tests own logic for deciding whether to
# enable color by checking this scripts own standard output connection.
# The list of TERM values comes from Google Tests
# googletest/src/gtest.cc testing::internal::ShouldUseColor().
env = {'CRASHPAD_TEST_DATA_ROOT': device_temp_dir}
gtest_color = os.environ.get('GTEST_COLOR')
if gtest_color in ('auto', None):
if (sys.stdout.isatty() and
(os.environ.get('TERM')
in ('xterm', 'xterm-color', 'xterm-256color', 'screen',
'screen-256color', 'tmux', 'tmux-256color', 'rxvt-unicode',
'rxvt-unicode-256color', 'linux', 'cygwin') or
(IS_WINDOWS_HOST and _EnableVTProcessingOnWindowsConsole()))):
gtest_color = 'yes'
else:
gtest_color = 'no'
env['GTEST_COLOR'] = gtest_color
_adb_shell([posixpath.join(device_out_dir, test)] + extra_command_line,
env)
finally:
_adb_shell(['rm', '-rf', device_temp_dir])
def _RunOnIOSTarget(binary_dir, test, is_xcuitest=False):
"""Runs the given iOS |test| app on iPhone 8 with the default OS version."""
def xctest(binary_dir, test):
"""Returns a dict containing the xctestrun data needed to run an
XCTest-based test app."""
test_path = os.path.join(CRASHPAD_DIR, binary_dir)
module_data = {
'TestBundlePath': os.path.join(test_path, test + '_module.xctest'),
'TestHostPath': os.path.join(test_path, test + '.app'),
'TestingEnvironmentVariables': {
'DYLD_FRAMEWORK_PATH': '__TESTROOT__/Debug-iphonesimulator:',
'DYLD_INSERT_LIBRARIES':
('__PLATFORMS__/iPhoneSimulator.platform/Developer/'
'usr/lib/libXCTestBundleInject.dylib'),
'DYLD_LIBRARY_PATH': '__TESTROOT__/Debug-iphonesimulator',
'IDEiPhoneInternalTestBundleName': test + '.app',
'XCInjectBundleInto': '__TESTHOST__/' + test,
}
}
return {test: module_data}
def xcuitest(binary_dir, test):
"""Returns a dict containing the xctestrun data needed to run an
XCUITest-based test app."""
test_path = os.path.join(CRASHPAD_DIR, binary_dir)
runner_path = os.path.join(test_path, test + '_module-Runner.app')
bundle_path = os.path.join(runner_path, 'PlugIns',
test + '_module.xctest')
target_app_path = os.path.join(test_path, test + '.app')
module_data = {
'IsUITestBundle': True,
'IsXCTRunnerHostedTestBundle': True,
'TestBundlePath': bundle_path,
'TestHostPath': runner_path,
'UITargetAppPath': target_app_path,
'DependentProductPaths': [
bundle_path, runner_path, target_app_path
],
'TestingEnvironmentVariables': {
'DYLD_FRAMEWORK_PATH': '__TESTROOT__/Debug-iphonesimulator:',
'DYLD_INSERT_LIBRARIES':
('__PLATFORMS__/iPhoneSimulator.platform/Developer/'
'usr/lib/libXCTestBundleInject.dylib'),
'DYLD_LIBRARY_PATH': '__TESTROOT__/Debug-iphonesimulator',
'XCInjectBundleInto': '__TESTHOST__/' + test + '_module-Runner',
},
}
return {test: module_data}
with tempfile.NamedTemporaryFile() as f:
import plistlib
xctestrun_path = f.name
print(xctestrun_path)
if is_xcuitest:
plistlib.writePlist(xcuitest(binary_dir, test), xctestrun_path)
else:
plistlib.writePlist(xctest(binary_dir, test), xctestrun_path)
subprocess.check_call([
'xcodebuild', 'test-without-building', '-xctestrun', xctestrun_path,
'-destination', 'platform=iOS Simulator,name=iPhone 8'
])
# This script is primarily used from the waterfall so that the list of tests
# that are run is maintained in-tree, rather than in a separate infrastructure
# location in the recipe.
def main(args):
parser = argparse.ArgumentParser(description='Run Crashpad unittests.')
parser.add_argument('binary_dir', help='Root of build dir')
parser.add_argument('test', nargs='*', help='Specific test(s) to run.')
parser.add_argument(
'--gtest_filter',
help='Google Test filter applied to Google Test binary runs.')
args = parser.parse_args()
# Tell 64-bit Windows tests where to find 32-bit test executables, for
# cross-bitted testing. This relies on the fact that the GYP build by
# default uses {Debug,Release} for the 32-bit build and {Debug,Release}_x64
# for the 64-bit build. This is not a universally valid assumption, and if
# its not met, 64-bit tests that require 32-bit build output will disable
# themselves dynamically.
if (sys.platform == 'win32' and args.binary_dir.endswith('_x64') and
'CRASHPAD_TEST_32_BIT_OUTPUT' not in os.environ):
binary_dir_32 = args.binary_dir[:-4]
if os.path.isdir(binary_dir_32):
os.environ['CRASHPAD_TEST_32_BIT_OUTPUT'] = binary_dir_32
target_os = _BinaryDirTargetOS(args.binary_dir)
is_android = target_os == 'android'
is_ios = target_os == 'ios'
tests = [
'crashpad_client_test',
'crashpad_handler_test',
'crashpad_minidump_test',
'crashpad_snapshot_test',
'crashpad_test_test',
'crashpad_util_test',
]
if is_android:
android_device = os.environ.get('ANDROID_DEVICE')
if not android_device:
adb_devices = subprocess.check_output(['adb', 'devices'],
shell=IS_WINDOWS_HOST)
devices = []
for line in adb_devices.splitlines():
line = line.decode('utf-8')
if (line == 'List of devices attached' or
re.match('^\* daemon .+ \*$', line) or line == ''):
continue
(device, ignore) = line.split('\t')
devices.append(device)
if len(devices) != 1:
print("Please set ANDROID_DEVICE to your device's id",
file=sys.stderr)
return 2
android_device = devices[0]
print('Using autodetected Android device:', android_device)
elif is_ios:
tests.append('ios_crash_xcuitests')
elif IS_WINDOWS_HOST:
tests.append('snapshot/win/end_to_end_test.py')
if args.test:
for t in args.test:
if t not in tests:
print('Unrecognized test:', t, file=sys.stderr)
return 3
tests = args.test
for test in tests:
print('-' * 80)
print(test)
print('-' * 80)
if test.endswith('.py'):
subprocess.check_call([
sys.executable,
os.path.join(CRASHPAD_DIR, test), args.binary_dir
])
else:
extra_command_line = []
if args.gtest_filter:
extra_command_line.append('--gtest_filter=' + args.gtest_filter)
if is_android:
_RunOnAndroidTarget(args.binary_dir, test, android_device,
extra_command_line)
elif is_ios:
_RunOnIOSTarget(args.binary_dir,
test,
is_xcuitest=test.startswith('ios'))
else:
subprocess.check_call([os.path.join(args.binary_dir, test)] +
extra_command_line)
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))

View File

@ -0,0 +1,49 @@
# Copyright 2017 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.
import("crashpad_buildconfig.gni")
if (crashpad_is_in_chromium) {
import("//testing/test.gni")
} else {
template("test") {
if (crashpad_is_ios) {
import("//third_party/mini_chromium/mini_chromium/build/ios/rules.gni")
_launch_image_bundle_target = target_name + "_launch_image"
bundle_data(_launch_image_bundle_target) {
forward_variables_from(invoker, [ "testonly" ])
sources = [ "//build/ios/Default.png" ]
outputs = [ "{{bundle_contents_dir}}/{{source_file_part}}" ]
}
ios_xctest_test(target_name) {
testonly = true
xctest_module_target = "//test/ios:google_test_runner"
info_plist = "//build/ios/Unittest-Info.plist"
extra_substitutions = [ "GTEST_BUNDLE_ID_SUFFIX=$target_name" ]
forward_variables_from(invoker, "*")
if (!defined(deps)) {
deps = []
}
deps += [ ":$_launch_image_bundle_target" ]
}
} else {
executable(target_name) {
testonly = true
forward_variables_from(invoker, "*")
}
}
}
}

View File

@ -0,0 +1,208 @@
# 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.
import("../build/crashpad_buildconfig.gni")
crashpad_static_library("client") {
sources = [
"crashpad_client.h",
"prune_crash_reports.cc",
"prune_crash_reports.h",
"simulate_crash.h",
]
if (crashpad_is_mac) {
sources += [
"crashpad_client_mac.cc",
"simulate_crash_mac.cc",
"simulate_crash_mac.h",
]
}
if (crashpad_is_ios) {
sources += [
"crashpad_client_ios.cc",
"ios_handler/exception_processor.h",
"ios_handler/exception_processor.mm",
"ios_handler/in_process_handler.cc",
"ios_handler/in_process_handler.h",
"ios_handler/in_process_intermediate_dump_handler.cc",
"ios_handler/in_process_intermediate_dump_handler.h",
"ios_handler/prune_intermediate_dumps_and_crash_reports_thread.cc",
"ios_handler/prune_intermediate_dumps_and_crash_reports_thread.h",
"simulate_crash_ios.h",
]
}
if (crashpad_is_linux || crashpad_is_android) {
sources += [
"crashpad_client_linux.cc",
"simulate_crash_linux.h",
]
}
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
sources += [
"client_argv_handling.cc",
"client_argv_handling.h",
]
}
if (crashpad_is_win) {
sources += [
"crashpad_client_win.cc",
"simulate_crash_win.h",
]
}
if (crashpad_is_fuchsia) {
sources += [ "crashpad_client_fuchsia.cc" ]
}
public_configs = [ "..:crashpad_config" ]
public_deps = [
":common",
"$mini_chromium_source_parent:base",
"../util",
]
deps = [
":common",
"$mini_chromium_source_parent:chromeos_buildflags",
]
if (crashpad_is_win) {
libs = [ "rpcrt4.lib" ]
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
}
if (crashpad_is_ios) {
deps += [
"../handler:common",
"../minidump",
"../snapshot",
]
}
if (crashpad_is_linux || crashpad_is_android) {
deps += [ "../third_party/lss" ]
}
if (crashpad_is_fuchsia) {
deps += [ "../third_party/fuchsia" ]
if (crashpad_is_in_fuchsia) {
deps += [ "//sdk/lib/fdio" ]
}
}
}
static_library("common") {
sources = [
"annotation.cc",
"annotation.h",
"annotation_list.cc",
"annotation_list.h",
"crash_report_database.cc",
"crash_report_database.h",
"crashpad_info.cc",
"crashpad_info.h",
"settings.cc",
"settings.h",
"simple_address_range_bag.h",
"simple_string_dictionary.h",
]
if (crashpad_is_mac || crashpad_is_ios) {
sources += [ "crash_report_database_mac.mm" ]
}
if (crashpad_is_win) {
sources += [ "crash_report_database_win.cc" ]
}
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
sources += [
"crash_report_database_generic.cc",
"crashpad_info_note.S",
]
}
public_configs = [ "..:crashpad_config" ]
public_deps = [
"$mini_chromium_source_parent:base",
"../util",
]
deps = [ "../util" ]
}
source_set("client_test") {
testonly = true
sources = [
"annotation_list_test.cc",
"annotation_test.cc",
"crash_report_database_test.cc",
"prune_crash_reports_test.cc",
"settings_test.cc",
"simple_address_range_bag_test.cc",
"simple_string_dictionary_test.cc",
]
if (crashpad_is_mac) {
sources += [ "simulate_crash_mac_test.cc" ]
}
if (crashpad_is_win) {
sources += [ "crashpad_client_win_test.cc" ]
}
if (crashpad_is_ios) {
sources += [
"crashpad_client_ios_test.mm",
"ios_handler/exception_processor_test.mm",
"ios_handler/in_process_handler_test.cc",
"ios_handler/in_process_intermediate_dump_handler_test.cc",
]
}
if (crashpad_is_linux || crashpad_is_android) {
sources += [ "crashpad_client_linux_test.cc" ]
}
deps = [
":client",
"$mini_chromium_source_parent:base",
"../compat",
"../snapshot",
"../test",
"../third_party/googletest:googlemock",
"../third_party/googletest:googletest",
"../util",
]
if (!crashpad_is_ios && !crashpad_is_fuchsia) {
data_deps = [ "../handler:crashpad_handler" ]
}
if (crashpad_is_win) {
data_deps += [ "../handler:crashpad_handler_console" ]
}
}
if (crashpad_is_linux || crashpad_is_android) {
source_set("pthread_create") {
sources = [ "pthread_create_linux.cc" ]
deps = [ ":client" ]
}
}

View File

@ -0,0 +1,156 @@
# 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.
import("../build/crashpad_buildconfig.gni")
config("compat_config") {
include_dirs = []
if (crashpad_is_mac || crashpad_is_ios) {
include_dirs += [ "mac" ]
}
if (crashpad_is_ios) {
include_dirs += [ "ios" ]
}
if (crashpad_is_linux || crashpad_is_android) {
include_dirs += [ "linux" ]
}
if (crashpad_is_android) {
include_dirs += [ "android" ]
}
if (crashpad_is_win) {
include_dirs += [ "win" ]
} else {
include_dirs += [ "non_win" ]
}
}
template("compat_target") {
if (crashpad_is_mac || crashpad_is_ios) {
# There are no sources to compile, which doesnt mix will with a
# static_library.
group(target_name) {
forward_variables_from(invoker, "*")
not_needed([ "configs" ])
}
} else {
crashpad_static_library(target_name) {
forward_variables_from(invoker, "*", [ "configs" ])
if (!defined(configs)) {
configs = []
}
if (defined(invoker.configs)) {
configs += invoker.configs
}
}
}
}
compat_target("compat") {
sources = []
if (crashpad_is_mac || crashpad_is_ios) {
sources += [
"mac/Availability.h",
"mac/AvailabilityVersions.h",
"mac/kern/exc_resource.h",
"mac/mach-o/loader.h",
"mac/mach/i386/thread_state.h",
"mac/mach/mach.h",
"mac/sys/resource.h",
]
} else {
sources += [ "non_mac/mach/mach.h" ]
}
if (crashpad_is_ios) {
sources += [
"ios/mach/exc.defs",
"ios/mach/mach_exc.defs",
"ios/mach/mach_types.defs",
"ios/mach/machine/machine_types.defs",
"ios/mach/std_types.defs",
]
}
if (crashpad_is_linux || crashpad_is_android) {
sources += [
"linux/signal.h",
"linux/sys/mman.h",
"linux/sys/mman_memfd_create.cc",
"linux/sys/ptrace.h",
"linux/sys/user.h",
]
}
if (crashpad_is_android) {
sources += [
"android/dlfcn_internal.cc",
"android/dlfcn_internal.h",
"android/elf.h",
"android/linux/elf.h",
"android/linux/prctl.h",
"android/linux/ptrace.h",
"android/sched.h",
"android/sys/epoll.cc",
"android/sys/epoll.h",
"android/sys/mman.h",
"android/sys/mman_mmap.cc",
"android/sys/syscall.h",
"android/sys/user.h",
]
}
if (crashpad_is_win) {
sources += [
"win/getopt.h",
"win/strings.cc",
"win/strings.h",
"win/sys/types.h",
"win/time.cc",
"win/time.h",
"win/winbase.h",
"win/winnt.h",
"win/winternl.h",
]
} else {
sources += [
"non_win/dbghelp.h",
"non_win/minwinbase.h",
"non_win/timezoneapi.h",
"non_win/verrsrc.h",
"non_win/windows.h",
"non_win/winnt.h",
]
}
public_configs = [
":compat_config",
"..:crashpad_config",
]
if (!crashpad_is_win) {
public_deps = [ "$mini_chromium_source_parent:base" ]
}
deps = [ "../util:no_cfi_icall" ]
if (crashpad_is_win) {
deps += [ "../third_party/getopt" ]
}
}

View File

@ -0,0 +1,356 @@
# 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.
import("../build/crashpad_buildconfig.gni")
static_library("handler") {
sources = [
"handler_main.cc",
"handler_main.h",
"prune_crash_reports_thread.cc",
"prune_crash_reports_thread.h",
"user_stream_data_source.cc",
"user_stream_data_source.h",
]
if (crashpad_is_mac) {
sources += [
"mac/crash_report_exception_handler.cc",
"mac/crash_report_exception_handler.h",
"mac/exception_handler_server.cc",
"mac/exception_handler_server.h",
]
}
if (crashpad_is_linux || crashpad_is_android) {
sources += [
"linux/capture_snapshot.cc",
"linux/capture_snapshot.h",
"linux/crash_report_exception_handler.cc",
"linux/crash_report_exception_handler.h",
"linux/exception_handler_server.cc",
"linux/exception_handler_server.h",
]
}
if (crashpad_is_linux) {
sources += [
"linux/cros_crash_report_exception_handler.cc",
"linux/cros_crash_report_exception_handler.h",
]
}
if (crashpad_is_win) {
sources += [
"win/crash_report_exception_handler.cc",
"win/crash_report_exception_handler.h",
]
}
public_configs = [ "..:crashpad_config" ]
public_deps = [
":common",
"../client",
"../third_party/mini_chromium:base",
"../util",
]
deps = [
":common",
"../minidump",
"../snapshot",
"../third_party/mini_chromium:chromeos_buildflags",
"../tools:tool_support",
]
if (crashpad_is_win) {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
}
}
if (crashpad_is_android) {
# CrashpadHandlerMain is defined in a separate target so that it can be
# overriden by implementers
source_set("crashpad_handler_main") {
sources = [ "crashpad_handler_main.cc" ]
deps = [ ":handler" ]
}
}
static_library("common") {
sources = [
"crash_report_upload_thread.cc",
"crash_report_upload_thread.h",
"minidump_to_upload_parameters.cc",
"minidump_to_upload_parameters.h",
]
if (crashpad_is_mac || crashpad_is_ios) {
sources += [
"mac/file_limit_annotation.cc",
"mac/file_limit_annotation.h",
]
}
public_configs = [ "..:crashpad_config" ]
public_deps = [
"../third_party/mini_chromium:base",
"../util",
]
deps = [
"../client:common",
"../snapshot",
"../util",
"../util:net",
]
if (crashpad_is_win) {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
}
}
source_set("handler_test") {
testonly = true
sources = [ "minidump_to_upload_parameters_test.cc" ]
if (crashpad_is_linux || crashpad_is_android) {
sources += [ "linux/exception_handler_server_test.cc" ]
}
if (crashpad_is_win) {
sources += [ "crashpad_handler_test.cc" ]
}
deps = [
":handler",
"../client",
"../compat",
"../snapshot",
"../snapshot:test_support",
"../test",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
"../util",
]
if (crashpad_is_win) {
deps += [ "../minidump:test_support" ]
data_deps = [
":crashpad_handler_test_extended_handler",
":fake_handler_that_crashes_at_startup",
]
}
}
if (!crashpad_is_ios) {
crashpad_executable("crashpad_handler") {
sources = [ "main.cc" ]
deps = [
":handler",
"../build:default_exe_manifest_win",
"../compat",
"../third_party/mini_chromium:base",
"../tools:tool_support",
]
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 if (crashpad_is_external) {
remove_configs =
[ "//../../mini_chromium/mini_chromium/build/config:win_console" ]
configs =
[ "//../../mini_chromium/mini_chromium/build/config:win_windowed" ]
} else {
remove_configs = [
"//third_party/mini_chromium/mini_chromium/build/config:win_console",
]
configs = [
"//third_party/mini_chromium/mini_chromium/build/config:win_windowed",
]
}
}
if (crashpad_is_linux) {
deps += [ "../client:pthread_create" ]
}
}
}
# 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) {
copy("crashpad_handler_named_as_so") {
deps = [ ":crashpad_handler" ]
sources = [ "$root_out_dir/crashpad_handler" ]
outputs = [ "$root_out_dir/libcrashpad_handler.so" ]
}
crashpad_executable("crashpad_handler_trampoline") {
output_name = "libcrashpad_handler_trampoline.so"
sources = [ "linux/handler_trampoline.cc" ]
deps = [ "../util:no_cfi_icall" ]
libs = [ "log" ]
if (crashpad_is_in_chromium) {
# Chromium's sanitizer runtime libraries do not include an unwinder,
# so add Chromium's standard dependencies to link against the in-tree
# libunwind.
import("//build/config/sanitizers/sanitizers.gni")
no_default_deps = !using_sanitizer
remove_configs =
[ "//build/config/android:default_orderfile_instrumentation" ]
}
}
}
if (!crashpad_is_ios) {
crashpad_executable("crashpad_handler_test_extended_handler") {
testonly = true
sources = [ "crashpad_handler_test_extended_handler.cc" ]
deps = [
":handler",
"../build:default_exe_manifest_win",
"../compat",
"../minidump:test_support",
"../third_party/mini_chromium:base",
"../tools:tool_support",
]
}
}
if (crashpad_is_win) {
crashpad_executable("crashpad_handler_com") {
sources = [ "main.cc" ]
# Avoid .exp, .ilk, and .lib file collisions with crashpad_handler.exe by
# having this target produce crashpad_handler_com.com. Dont use this target
# directly. Instead, use crashpad_handler_console.
output_extension = "com"
deps = [
":handler",
"../build:default_exe_manifest_win",
"../compat",
"../third_party/mini_chromium:base",
"../tools:tool_support",
]
}
copy("crashpad_handler_console") {
deps = [ ":crashpad_handler_com" ]
sources = [ "$root_out_dir/crashpad_handler_com.com" ]
outputs = [ "$root_out_dir/crashpad_handler.com" ]
}
crashpad_executable("crash_other_program") {
testonly = true
sources = [ "win/crash_other_program.cc" ]
deps = [
"../client",
"../test",
"../third_party/googletest:googletest",
"../third_party/mini_chromium:base",
]
}
crashpad_executable("crashy_program") {
testonly = true
sources = [ "win/crashy_test_program.cc" ]
deps = [
"../client",
"../third_party/mini_chromium:base",
]
}
crashpad_executable("crashy_signal") {
testonly = true
sources = [ "win/crashy_signal.cc" ]
cflags = [ "/wd4702" ] # Unreachable code.
deps = [
"../client",
"../third_party/mini_chromium:base",
]
}
crashpad_executable("fake_handler_that_crashes_at_startup") {
testonly = true
sources = [ "win/fake_handler_that_crashes_at_startup.cc" ]
}
crashpad_executable("hanging_program") {
testonly = true
sources = [ "win/hanging_program.cc" ]
deps = [
"../client",
"../third_party/mini_chromium:base",
]
}
crashpad_loadable_module("loader_lock_dll") {
testonly = true
sources = [ "win/loader_lock_dll.cc" ]
}
crashpad_executable("self_destroying_program") {
testonly = true
sources = [ "win/self_destroying_test_program.cc" ]
deps = [
"../client",
"../compat",
"../snapshot",
"../third_party/mini_chromium:base",
]
}
if (current_cpu == "x86") {
# Cannot create an x64 DLL with embedded debug info.
crashpad_executable("crashy_z7_loader") {
testonly = true
sources = [ "win/crashy_test_z7_loader.cc" ]
deps = [
"../client",
"../test",
"../third_party/mini_chromium:base",
]
}
}
}

View File

@ -0,0 +1,168 @@
.. _BuildingLibunwind:
==================
Building libunwind
==================
.. contents::
:local:
.. _build instructions:
Getting Started
===============
On Mac OS, the easiest way to get this library is to link with -lSystem.
However if you want to build tip-of-trunk from here (getting the bleeding
edge), read on.
The basic steps needed to build libc++ are:
#. Checkout LLVM, libunwind, and related projects:
* ``cd where-you-want-llvm-to-live``
* ``git clone https://github.com/llvm/llvm-project.git``
#. Configure and build libunwind:
CMake is the only supported configuration system.
Clang is the preferred compiler when building and using libunwind.
* ``cd where you want to build llvm``
* ``mkdir build``
* ``cd build``
* ``cmake -G <generator> -DLLVM_ENABLE_PROJECTS=libunwind [options] <path to llvm sources>``
For more information about configuring libunwind see :ref:`CMake Options`.
* ``make unwind`` --- will build libunwind.
* ``make check-unwind`` --- will run the test suite.
Shared and static libraries for libunwind should now be present in llvm/build/lib.
#. **Optional**: Install libunwind
If your system already provides an unwinder, it is important to be careful
not to replace it. Remember Use the CMake option ``CMAKE_INSTALL_PREFIX`` to
select a safe place to install libunwind.
* ``make install-unwind`` --- Will install the libraries and the headers
It is sometimes beneficial to build outside of the LLVM tree. An out-of-tree
build would look like this:
.. code-block:: bash
$ cd where-you-want-libunwind-to-live
$ # Check out llvm, and libunwind
$ ``svn co https://llvm.org/svn/llvm-project/llvm/trunk llvm``
$ ``svn co https://llvm.org/svn/llvm-project/libunwind/trunk libunwind``
$ cd where-you-want-to-build
$ mkdir build && cd build
$ export CC=clang CXX=clang++
$ cmake -DLLVM_PATH=path/to/llvm \
path/to/libunwind
$ make
.. _CMake Options:
CMake Options
=============
Here are some of the CMake variables that are used often, along with a
brief explanation and LLVM-specific notes. For full documentation, check the
CMake docs or execute ``cmake --help-variable VARIABLE_NAME``.
**CMAKE_BUILD_TYPE**:STRING
Sets the build type for ``make`` based generators. Possible values are
Release, Debug, RelWithDebInfo and MinSizeRel. On systems like Visual Studio
the user sets the build type with the IDE settings.
**CMAKE_INSTALL_PREFIX**:PATH
Path where LLVM will be installed if "make install" is invoked or the
"INSTALL" target is built.
**CMAKE_CXX_COMPILER**:STRING
The C++ compiler to use when building and testing libunwind.
.. _libunwind-specific options:
libunwind specific options
--------------------------
.. option:: LIBUNWIND_BUILD_32_BITS:BOOL
**Default**: Same as LLVM_BUILD_32_BITS
Toggle whether libunwind should be built with -m32.
.. option:: LIBUNWIND_ENABLE_ASSERTIONS:BOOL
**Default**: ``ON``
Toggle assertions independent of the build mode.
.. option:: LIBUNWIND_ENABLE_PEDANTIC:BOOL
**Default**: ``ON``
Compile with -Wpedantic.
.. option:: LIBUNWIND_ENABLE_WERROR:BOOL
**Default**: ``ON``
Compile with -Werror
.. option:: LIBUNWIND_ENABLE_SHARED:BOOL
**Default**: ``ON``
Build libunwind as a shared library.
.. option:: LIBUNWIND_ENABLE_STATIC:BOOL
**Default**: ``ON``
Build libunwind as a static archive.
.. option:: LIBUNWIND_ENABLE_CROSS_UNWINDING:BOOL
**Default**: ``OFF``
Enable cross-platform unwinding support.
.. option:: LIBUNWIND_ENABLE_ARM_WMMX:BOOL
**Default**: ``OFF``
Enable unwinding support for ARM WMMX registers.
.. option:: LIBUNWIND_ENABLE_THREADS:BOOL
**Default**: ``ON``
Build libunwind with threading support.
.. option:: LIBUNWIND_TARGET_TRIPLE:STRING
Target triple for cross compiling
.. option:: LIBUNWIND_GCC_TOOLCHAIN:PATH
GCC toolchain for cross compiling
.. option:: LIBUNWIND_SYSROOT
Sysroot for cross compiling
.. option:: LIBUNWIND_INSTALL_LIBRARY_DIR:PATH
**Default**: ``lib${LIBUNWIND_LIBDIR_SUFFIX}``
Path where built libunwind libraries should be installed. If a relative path,
relative to ``CMAKE_INSTALL_PREFIX``.

View File

@ -0,0 +1,189 @@
# 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.
import("../build/crashpad_buildconfig.gni")
crashpad_static_library("minidump") {
sources = [
"minidump_annotation_writer.cc",
"minidump_annotation_writer.h",
"minidump_byte_array_writer.cc",
"minidump_byte_array_writer.h",
"minidump_context_writer.cc",
"minidump_context_writer.h",
"minidump_crashpad_info_writer.cc",
"minidump_crashpad_info_writer.h",
"minidump_exception_writer.cc",
"minidump_exception_writer.h",
"minidump_file_writer.cc",
"minidump_file_writer.h",
"minidump_handle_writer.cc",
"minidump_handle_writer.h",
"minidump_memory_info_writer.cc",
"minidump_memory_info_writer.h",
"minidump_memory_writer.cc",
"minidump_memory_writer.h",
"minidump_misc_info_writer.cc",
"minidump_misc_info_writer.h",
"minidump_module_crashpad_info_writer.cc",
"minidump_module_crashpad_info_writer.h",
"minidump_module_writer.cc",
"minidump_module_writer.h",
"minidump_rva_list_writer.cc",
"minidump_rva_list_writer.h",
"minidump_simple_string_dictionary_writer.cc",
"minidump_simple_string_dictionary_writer.h",
"minidump_stream_writer.cc",
"minidump_stream_writer.h",
"minidump_string_writer.cc",
"minidump_string_writer.h",
"minidump_system_info_writer.cc",
"minidump_system_info_writer.h",
"minidump_thread_id_map.cc",
"minidump_thread_id_map.h",
"minidump_thread_writer.cc",
"minidump_thread_writer.h",
"minidump_unloaded_module_writer.cc",
"minidump_unloaded_module_writer.h",
"minidump_user_extension_stream_data_source.cc",
"minidump_user_extension_stream_data_source.h",
"minidump_user_stream_writer.cc",
"minidump_user_stream_writer.h",
"minidump_writable.cc",
"minidump_writable.h",
"minidump_writer_util.cc",
"minidump_writer_util.h",
]
public_configs = [ "..:crashpad_config" ]
public_deps = [
":format",
"../compat",
]
deps = [
"../snapshot",
"$mini_chromium_source_parent:base",
"../util",
]
if (crashpad_is_win) {
cflags = [
"/wd4201", # nonstandard extension used : nameless struct/union
"/wd4324", # 'struct' : structure was padded due to __declspec(align())
]
}
}
# :format is the only part of minidump that snapshot may depend on.
static_library("format") {
sources = [
"minidump_context.h",
"minidump_extensions.cc",
"minidump_extensions.h",
]
public_configs = [ "..:crashpad_config" ]
public_deps = [ "../compat" ]
deps = [
"../snapshot:context",
"$mini_chromium_source_parent:base",
"../util",
]
}
static_library("test_support") {
testonly = true
sources = [
"test/minidump_byte_array_writer_test_util.cc",
"test/minidump_byte_array_writer_test_util.h",
"test/minidump_context_test_util.cc",
"test/minidump_context_test_util.h",
"test/minidump_file_writer_test_util.cc",
"test/minidump_file_writer_test_util.h",
"test/minidump_memory_writer_test_util.cc",
"test/minidump_memory_writer_test_util.h",
"test/minidump_rva_list_test_util.cc",
"test/minidump_rva_list_test_util.h",
"test/minidump_string_writer_test_util.cc",
"test/minidump_string_writer_test_util.h",
"test/minidump_user_extension_stream_util.cc",
"test/minidump_user_extension_stream_util.h",
"test/minidump_writable_test_util.cc",
"test/minidump_writable_test_util.h",
]
public_configs = [ "..:crashpad_config" ]
public_deps = [ ":minidump" ]
deps = [
"../snapshot:test_support",
"../test",
"../third_party/googletest:googletest",
"$mini_chromium_source_parent:base",
"../util",
]
if (crashpad_is_win) {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
}
}
source_set("minidump_test") {
testonly = true
sources = [
"minidump_annotation_writer_test.cc",
"minidump_byte_array_writer_test.cc",
"minidump_context_writer_test.cc",
"minidump_crashpad_info_writer_test.cc",
"minidump_exception_writer_test.cc",
"minidump_file_writer_test.cc",
"minidump_handle_writer_test.cc",
"minidump_memory_info_writer_test.cc",
"minidump_memory_writer_test.cc",
"minidump_misc_info_writer_test.cc",
"minidump_module_crashpad_info_writer_test.cc",
"minidump_module_writer_test.cc",
"minidump_rva_list_writer_test.cc",
"minidump_simple_string_dictionary_writer_test.cc",
"minidump_string_writer_test.cc",
"minidump_system_info_writer_test.cc",
"minidump_thread_id_map_test.cc",
"minidump_thread_writer_test.cc",
"minidump_unloaded_module_writer_test.cc",
"minidump_user_stream_writer_test.cc",
"minidump_writable_test.cc",
]
configs += [ "../build:crashpad_is_in_fuchsia" ]
deps = [
":test_support",
"../snapshot:test_support",
"../test",
"../third_party/googletest:googletest",
"$mini_chromium_source_parent:base",
"../util",
]
if (crashpad_is_win) {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
}
}

View File

@ -0,0 +1,643 @@
# 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.
import("../build/crashpad_buildconfig.gni")
import("../build/crashpad_fuzzer_test.gni")
if (crashpad_is_in_chromium) {
import("//build/config/compiler/compiler.gni")
}
crashpad_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",
"memory_snapshot.cc",
"memory_snapshot.h",
"memory_snapshot_generic.h",
"minidump/exception_snapshot_minidump.cc",
"minidump/exception_snapshot_minidump.h",
"minidump/memory_snapshot_minidump.cc",
"minidump/memory_snapshot_minidump.h",
"minidump/minidump_annotation_reader.cc",
"minidump/minidump_annotation_reader.h",
"minidump/minidump_context_converter.cc",
"minidump/minidump_context_converter.h",
"minidump/minidump_simple_string_dictionary_reader.cc",
"minidump/minidump_simple_string_dictionary_reader.h",
"minidump/minidump_stream.h",
"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",
"minidump/system_snapshot_minidump.cc",
"minidump/system_snapshot_minidump.h",
"minidump/thread_snapshot_minidump.cc",
"minidump/thread_snapshot_minidump.h",
"module_snapshot.h",
"process_snapshot.h",
"snapshot_constants.h",
"system_snapshot.h",
"thread_snapshot.h",
"unloaded_module_snapshot.cc",
"unloaded_module_snapshot.h",
]
if (crashpad_is_posix || crashpad_is_fuchsia) {
sources += [
"posix/timezone.cc",
"posix/timezone.h",
]
}
if (crashpad_is_mac) {
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",
"mac/process_reader_mac.cc",
"mac/process_reader_mac.h",
"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",
]
}
if (crashpad_is_ios) {
sources += [
"ios/exception_snapshot_ios_intermediate_dump.cc",
"ios/exception_snapshot_ios_intermediate_dump.h",
"ios/intermediate_dump_reader_util.cc",
"ios/intermediate_dump_reader_util.h",
"ios/memory_snapshot_ios_intermediate_dump.cc",
"ios/memory_snapshot_ios_intermediate_dump.h",
"ios/module_snapshot_ios_intermediate_dump.cc",
"ios/module_snapshot_ios_intermediate_dump.h",
"ios/process_snapshot_ios_intermediate_dump.cc",
"ios/process_snapshot_ios_intermediate_dump.h",
"ios/system_snapshot_ios_intermediate_dump.cc",
"ios/system_snapshot_ios_intermediate_dump.h",
"ios/thread_snapshot_ios_intermediate_dump.cc",
"ios/thread_snapshot_ios_intermediate_dump.h",
"mac/cpu_context_mac.cc",
"mac/cpu_context_mac.h",
]
}
if (crashpad_is_linux || crashpad_is_android) {
sources += [
"linux/capture_memory_delegate_linux.cc",
"linux/capture_memory_delegate_linux.h",
"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",
"linux/process_reader_linux.cc",
"linux/process_reader_linux.h",
"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",
"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",
"sanitized/sanitization_information.cc",
"sanitized/sanitization_information.h",
"sanitized/thread_snapshot_sanitized.cc",
"sanitized/thread_snapshot_sanitized.h",
]
}
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia ||
crashpad_is_win) {
sources += [
"crashpad_types/crashpad_info_reader.cc",
"crashpad_types/crashpad_info_reader.h",
]
}
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
sources += [
"crashpad_types/image_annotation_reader.cc",
"crashpad_types/image_annotation_reader.h",
"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",
"elf/module_snapshot_elf.cc",
"elf/module_snapshot_elf.h",
]
}
if (crashpad_is_win) {
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",
]
}
if (crashpad_is_fuchsia) {
sources += [
"fuchsia/cpu_context_fuchsia.cc",
"fuchsia/cpu_context_fuchsia.h",
"fuchsia/exception_snapshot_fuchsia.cc",
"fuchsia/exception_snapshot_fuchsia.h",
"fuchsia/memory_map_fuchsia.cc",
"fuchsia/memory_map_fuchsia.h",
"fuchsia/memory_map_region_snapshot_fuchsia.cc",
"fuchsia/memory_map_region_snapshot_fuchsia.h",
"fuchsia/process_reader_fuchsia.cc",
"fuchsia/process_reader_fuchsia.h",
"fuchsia/process_snapshot_fuchsia.cc",
"fuchsia/process_snapshot_fuchsia.h",
"fuchsia/system_snapshot_fuchsia.cc",
"fuchsia/system_snapshot_fuchsia.h",
"fuchsia/thread_snapshot_fuchsia.cc",
"fuchsia/thread_snapshot_fuchsia.h",
]
}
if (current_cpu == "x86" || current_cpu == "x64" ||
(crashpad_is_mac && current_cpu == "mac_universal")) {
sources += [
"x86/cpuid_reader.cc",
"x86/cpuid_reader.h",
]
}
public_configs = [ "..:crashpad_config" ]
public_deps = [ ":context" ]
deps = [
"$mini_chromium_source_parent:base",
"../client:common",
"../compat",
"../minidump:format",
"../util",
]
if (crashpad_is_win) {
deps += [ "../client" ]
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
libs = [ "powrprof.lib" ]
}
}
# :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 = [
"$mini_chromium_source_parent:base",
"../util",
]
if (crashpad_is_win) {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
}
}
if (crashpad_is_linux) {
crashpad_fuzzer_test("elf_image_reader_fuzzer") {
sources = [ "elf/elf_image_reader_fuzzer.cc" ]
deps = [
":snapshot",
"$mini_chromium_source_parent:base",
"../util:util",
]
seed_corpus = "elf/elf_image_reader_fuzzer_corpus"
}
}
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",
]
public_configs = [ "..:crashpad_config" ]
public_deps = [ ":snapshot" ]
deps = [
"$mini_chromium_source_parent:base",
"../compat",
"../util",
]
if (crashpad_is_win) {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
}
}
config("snapshot_test_link") {
visibility = [ ":*" ]
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
# Theres no way to make the link depend on this file. “inputs” doesnt have
# the intended effect in a config. https://crbug.com/781858,
# https://crbug.com/796187.
inputs = [ "elf/test_exported_symbols.sym" ]
ldflags = [ "-Wl,--dynamic-list," + rebase_path(inputs[0], root_build_dir) ]
}
}
source_set("snapshot_test") {
testonly = true
sources = [
"cpu_context_test.cc",
"memory_snapshot_test.cc",
"minidump/process_snapshot_minidump_test.cc",
]
if (crashpad_is_mac) {
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",
"mac/process_reader_mac_test.cc",
"mac/process_types_test.cc",
"mac/system_snapshot_mac_test.cc",
]
}
if (crashpad_is_ios) {
sources += [
"ios/process_snapshot_ios_intermediate_dump_test.cc",
"mac/cpu_context_mac_test.cc",
]
}
if (crashpad_is_linux || crashpad_is_android) {
sources += [
"linux/debug_rendezvous_test.cc",
"linux/exception_snapshot_linux_test.cc",
"linux/process_reader_linux_test.cc",
"linux/system_snapshot_linux_test.cc",
"linux/test_modules.cc",
"linux/test_modules.h",
"sanitized/process_snapshot_sanitized_test.cc",
"sanitized/sanitization_information_test.cc",
]
} else if (!crashpad_is_ios) {
sources += [ "crashpad_info_client_options_test.cc" ]
}
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia ||
crashpad_is_win) {
sources += [ "crashpad_types/crashpad_info_reader_test.cc" ]
}
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
sources += [
"crashpad_types/image_annotation_reader_test.cc",
"elf/elf_image_reader_test.cc",
"elf/elf_image_reader_test_note.S",
]
}
if (crashpad_is_win) {
sources += [
"win/cpu_context_win_test.cc",
"win/exception_snapshot_win_test.cc",
"win/extra_memory_ranges_test.cc",
"win/module_snapshot_win_test.cc",
"win/pe_image_reader_test.cc",
"win/process_reader_win_test.cc",
"win/process_snapshot_win_test.cc",
"win/system_snapshot_win_test.cc",
]
} 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.
sources += [ "posix/timezone_test.cc" ]
}
if (crashpad_is_fuchsia) {
sources += [
"fuchsia/process_reader_fuchsia_test.cc",
"fuchsia/process_snapshot_fuchsia_test.cc",
]
}
# public_configs isnt quite right. snapshot_test_link sets ldflags, and
# whats 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" ]
deps = [
":test_support",
"$mini_chromium_source_parent:base",
"../client:common",
"../compat",
"../minidump:format",
"../test",
"../third_party/googletest:googlemock",
"../third_party/googletest:googletest",
"../util",
]
if (crashpad_is_win) {
deps += [ "../client" ]
}
if (crashpad_is_ios) {
deps += [
":snapshot_test_ios_data",
"../minidump",
]
}
data_deps = [
":crashpad_snapshot_test_module",
":crashpad_snapshot_test_module_large",
":crashpad_snapshot_test_module_small",
]
if (crashpad_is_mac) {
frameworks = [ "OpenCL.framework" ]
data_deps += [
":crashpad_snapshot_test_module_crashy_initializer",
":crashpad_snapshot_test_no_op",
]
}
if (crashpad_is_linux || crashpad_is_android) {
libs = [ "dl" ]
}
if ((crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) &&
target_cpu != "mipsel" && target_cpu != "mips64el") {
data_deps += [ ":crashpad_snapshot_test_both_dt_hash_styles" ]
}
if (crashpad_is_win) {
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",
]
}
}
bundle_data("snapshot_test_ios_data") {
testonly = true
sources = [
"ios/testdata/crash-1fa088dda0adb41459d063078a0f384a0bb8eefa",
"ios/testdata/crash-5726011582644224",
]
outputs = [ "{{bundle_resources_dir}}/crashpad_test_data/" +
"{{source_root_relative_dir}}/{{source_file_part}}" ]
}
crashpad_loadable_module("crashpad_snapshot_test_module") {
testonly = true
sources = [ "crashpad_info_client_options_test_module.cc" ]
deps = [
"$mini_chromium_source_parent:base",
"../client",
]
}
crashpad_loadable_module("crashpad_snapshot_test_module_large") {
testonly = true
sources = [ "crashpad_info_size_test_module.cc" ]
deps = []
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
sources += [ "crashpad_info_size_test_note.S" ]
deps += [ "../util" ]
}
defines = [ "CRASHPAD_INFO_SIZE_TEST_MODULE_LARGE" ]
deps += [ "$mini_chromium_source_parent:base" ]
}
crashpad_loadable_module("crashpad_snapshot_test_module_small") {
testonly = true
sources = [ "crashpad_info_size_test_module.cc" ]
deps = []
if (crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) {
sources += [ "crashpad_info_size_test_note.S" ]
deps += [ "../util" ]
}
defines = [ "CRASHPAD_INFO_SIZE_TEST_MODULE_SMALL" ]
deps += [ "$mini_chromium_source_parent:base" ]
}
if ((crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) &&
target_cpu != "mipsel" && target_cpu != "mips64el") {
crashpad_loadable_module("crashpad_snapshot_test_both_dt_hash_styles") {
testonly = true
sources = [ "hash_types_test.cc" ]
# This makes `ld` emit both .hash and .gnu.hash sections.
ldflags = [ "-Wl,--hash-style=both" ]
}
}
if (crashpad_is_mac || crashpad_is_ios) {
crashpad_loadable_module("crashpad_snapshot_test_module_crashy_initializer") {
testonly = true
sources = [
"mac/mach_o_image_annotations_reader_test_module_crashy_initializer.cc",
]
}
crashpad_executable("crashpad_snapshot_test_no_op") {
testonly = true
sources = [ "mac/mach_o_image_annotations_reader_test_no_op.cc" ]
}
}
if (crashpad_is_win) {
crashpad_executable("crashpad_snapshot_test_annotations") {
testonly = true
sources = [ "win/crashpad_snapshot_test_annotations.cc" ]
deps = [
"$mini_chromium_source_parent:base",
"../client",
"../compat",
]
}
crashpad_executable("crashpad_snapshot_test_crashing_child") {
testonly = true
sources = [ "win/crashpad_snapshot_test_crashing_child.cc" ]
deps = [
"$mini_chromium_source_parent:base",
"../client",
"../compat",
"../util",
]
}
crashpad_executable("crashpad_snapshot_test_dump_without_crashing") {
testonly = true
sources = [ "win/crashpad_snapshot_test_dump_without_crashing.cc" ]
deps = [
"$mini_chromium_source_parent:base",
"../client",
"../compat",
"../util",
]
}
crashpad_executable("crashpad_snapshot_test_extra_memory_ranges") {
testonly = true
sources = [ "win/crashpad_snapshot_test_extra_memory_ranges.cc" ]
deps = [
"$mini_chromium_source_parent:base",
"../client",
"../compat",
]
}
crashpad_executable("crashpad_snapshot_test_image_reader") {
testonly = true
sources = [ "win/crashpad_snapshot_test_image_reader.cc" ]
deps = [
"$mini_chromium_source_parent:base",
"../client",
"../compat",
"../util",
]
if (crashpad_is_in_chromium) {
if (symbol_level == 0) {
# The tests that use this executable rely on at least minimal debug
# info.
remove_configs = [ "//build/config/compiler:default_symbols" ]
configs = [ "//build/config/compiler:minimal_symbols" ]
}
}
}
crashpad_loadable_module("crashpad_snapshot_test_image_reader_module") {
testonly = true
sources = [ "win/crashpad_snapshot_test_image_reader_module.cc" ]
deps = [
"$mini_chromium_source_parent:base",
"../client",
]
if (crashpad_is_in_chromium) {
if (symbol_level == 0) {
# The tests that use this module rely on at least minimal debug info.
remove_configs = [ "//build/config/compiler:default_symbols" ]
configs = [ "//build/config/compiler:minimal_symbols" ]
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More