2017-01-20 05:08:48 +01:00
|
|
|
//
|
|
|
|
// Copyright (C) 2017 The Android Open Source Project
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
|
|
|
|
cc_defaults {
|
|
|
|
name: "libunwindstack_flags",
|
|
|
|
|
|
|
|
host_supported: true,
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
"-Wextra",
|
|
|
|
],
|
2017-01-30 22:45:16 +01:00
|
|
|
|
|
|
|
target: {
|
|
|
|
darwin: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
2017-09-20 02:53:12 +02:00
|
|
|
linux_bionic: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2017-01-30 22:45:16 +01:00
|
|
|
},
|
2017-01-20 05:08:48 +01:00
|
|
|
}
|
|
|
|
|
2017-07-12 00:29:32 +02:00
|
|
|
cc_library {
|
|
|
|
name: "libunwindstack",
|
2017-07-27 18:29:18 +02:00
|
|
|
vendor_available: true,
|
2018-05-24 07:11:00 +02:00
|
|
|
recovery_available: true,
|
2017-08-04 10:33:54 +02:00
|
|
|
vndk: {
|
|
|
|
enabled: true,
|
|
|
|
support_system_process: true,
|
|
|
|
},
|
2017-01-20 05:08:48 +01:00
|
|
|
defaults: ["libunwindstack_flags"],
|
2017-07-14 19:37:19 +02:00
|
|
|
export_include_dirs: ["include"],
|
2017-01-20 05:08:48 +01:00
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"ArmExidx.cpp",
|
2018-03-12 20:54:22 +01:00
|
|
|
"DexFile.cpp",
|
|
|
|
"DexFiles.cpp",
|
2017-04-24 20:14:39 +02:00
|
|
|
"DwarfCfa.cpp",
|
2017-11-03 22:50:27 +01:00
|
|
|
"DwarfEhFrameWithHdr.cpp",
|
2017-03-21 20:41:17 +01:00
|
|
|
"DwarfMemory.cpp",
|
2017-04-04 19:41:31 +02:00
|
|
|
"DwarfOp.cpp",
|
2017-05-11 03:34:15 +02:00
|
|
|
"DwarfSection.cpp",
|
2017-02-02 00:44:40 +01:00
|
|
|
"Elf.cpp",
|
|
|
|
"ElfInterface.cpp",
|
|
|
|
"ElfInterfaceArm.cpp",
|
2018-10-17 19:57:53 +02:00
|
|
|
"Global.cpp",
|
2017-12-21 03:49:01 +01:00
|
|
|
"JitDebug.cpp",
|
2017-01-20 05:08:48 +01:00
|
|
|
"Log.cpp",
|
2017-04-20 00:42:19 +02:00
|
|
|
"MapInfo.cpp",
|
2017-04-05 22:25:04 +02:00
|
|
|
"Maps.cpp",
|
2017-02-02 00:44:40 +01:00
|
|
|
"Memory.cpp",
|
2018-04-05 20:15:00 +02:00
|
|
|
"LocalUnwinder.cpp",
|
2017-06-28 23:51:54 +02:00
|
|
|
"Regs.cpp",
|
2017-12-01 03:56:01 +01:00
|
|
|
"RegsArm.cpp",
|
|
|
|
"RegsArm64.cpp",
|
|
|
|
"RegsX86.cpp",
|
|
|
|
"RegsX86_64.cpp",
|
2017-11-08 10:53:53 +01:00
|
|
|
"RegsMips.cpp",
|
|
|
|
"RegsMips64.cpp",
|
2017-09-20 22:37:24 +02:00
|
|
|
"Unwinder.cpp",
|
2017-04-04 23:06:58 +02:00
|
|
|
"Symbols.cpp",
|
2017-01-20 05:08:48 +01:00
|
|
|
],
|
|
|
|
|
2017-10-23 23:25:08 +02:00
|
|
|
cflags: [
|
|
|
|
"-Wexit-time-destructors",
|
|
|
|
],
|
|
|
|
|
2017-09-01 20:17:16 +02:00
|
|
|
target: {
|
|
|
|
// Always disable optimizations for host to make it easier to debug.
|
2017-10-02 19:29:02 +02:00
|
|
|
host: {
|
2018-02-17 02:58:14 +01:00
|
|
|
cflags: [
|
|
|
|
"-O0",
|
|
|
|
"-g",
|
|
|
|
],
|
2017-09-01 20:17:16 +02:00
|
|
|
},
|
2018-01-31 04:47:24 +01:00
|
|
|
vendor: {
|
|
|
|
cflags: ["-DNO_LIBDEXFILE_SUPPORT"],
|
2018-03-12 20:54:22 +01:00
|
|
|
exclude_srcs: [
|
|
|
|
"DexFile.cpp",
|
|
|
|
"DexFiles.cpp",
|
|
|
|
],
|
2018-12-19 15:28:33 +01:00
|
|
|
exclude_shared_libs: [
|
|
|
|
"libdexfile_support",
|
|
|
|
],
|
2018-01-31 04:47:24 +01:00
|
|
|
},
|
2018-05-24 07:11:00 +02:00
|
|
|
recovery: {
|
|
|
|
cflags: ["-DNO_LIBDEXFILE_SUPPORT"],
|
2018-03-12 20:54:22 +01:00
|
|
|
exclude_srcs: [
|
|
|
|
"DexFile.cpp",
|
|
|
|
"DexFiles.cpp",
|
|
|
|
],
|
2018-12-19 15:28:33 +01:00
|
|
|
exclude_shared_libs: [
|
|
|
|
"libdexfile_support",
|
|
|
|
],
|
2018-01-31 04:47:24 +01:00
|
|
|
},
|
2017-09-01 20:17:16 +02:00
|
|
|
},
|
|
|
|
|
2017-07-08 01:35:48 +02:00
|
|
|
arch: {
|
|
|
|
x86: {
|
|
|
|
srcs: ["AsmGetRegsX86.S"],
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
srcs: ["AsmGetRegsX86_64.S"],
|
|
|
|
},
|
2017-11-08 10:53:53 +01:00
|
|
|
mips: {
|
|
|
|
srcs: ["AsmGetRegsMips.S"],
|
|
|
|
},
|
|
|
|
mips64: {
|
|
|
|
srcs: ["AsmGetRegsMips64.S"],
|
|
|
|
},
|
2017-07-08 01:35:48 +02:00
|
|
|
},
|
|
|
|
|
2018-12-06 00:57:02 +01:00
|
|
|
whole_static_libs: [
|
|
|
|
"libdemangle"
|
|
|
|
],
|
|
|
|
|
2018-05-11 02:19:12 +02:00
|
|
|
static_libs: [
|
|
|
|
"libprocinfo",
|
|
|
|
],
|
|
|
|
|
2017-01-20 05:08:48 +01:00
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
2018-12-19 15:28:33 +01:00
|
|
|
"libdexfile_support",
|
2017-01-20 05:08:48 +01:00
|
|
|
"liblog",
|
2017-06-28 23:51:54 +02:00
|
|
|
"liblzma",
|
2017-01-20 05:08:48 +01:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// Unit Tests
|
|
|
|
//-------------------------------------------------------------------------
|
2018-04-05 20:15:00 +02:00
|
|
|
cc_test_library {
|
|
|
|
name: "libunwindstack_local",
|
|
|
|
defaults: ["libunwindstack_flags"],
|
|
|
|
srcs: ["tests/TestLocal.cpp"],
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-O0",
|
|
|
|
"-g",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libunwindstack",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2017-07-12 00:29:32 +02:00
|
|
|
cc_test {
|
|
|
|
name: "libunwindstack_test",
|
2017-01-20 05:08:48 +01:00
|
|
|
defaults: ["libunwindstack_flags"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"tests/ArmExidxDecodeTest.cpp",
|
|
|
|
"tests/ArmExidxExtractTest.cpp",
|
2018-03-12 20:54:22 +01:00
|
|
|
"tests/DexFileTest.cpp",
|
|
|
|
"tests/DexFilesTest.cpp",
|
2017-04-24 20:14:39 +02:00
|
|
|
"tests/DwarfCfaLogTest.cpp",
|
|
|
|
"tests/DwarfCfaTest.cpp",
|
2017-06-13 04:14:20 +02:00
|
|
|
"tests/DwarfDebugFrameTest.cpp",
|
|
|
|
"tests/DwarfEhFrameTest.cpp",
|
2017-11-03 22:50:27 +01:00
|
|
|
"tests/DwarfEhFrameWithHdrTest.cpp",
|
2017-03-21 20:41:17 +01:00
|
|
|
"tests/DwarfMemoryTest.cpp",
|
2017-04-04 19:41:31 +02:00
|
|
|
"tests/DwarfOpLogTest.cpp",
|
|
|
|
"tests/DwarfOpTest.cpp",
|
2017-05-11 03:34:15 +02:00
|
|
|
"tests/DwarfSectionTest.cpp",
|
|
|
|
"tests/DwarfSectionImplTest.cpp",
|
2018-01-25 21:15:56 +01:00
|
|
|
"tests/ElfCacheTest.cpp",
|
2017-09-26 04:23:07 +02:00
|
|
|
"tests/ElfFake.cpp",
|
2017-02-02 00:44:40 +01:00
|
|
|
"tests/ElfInterfaceArmTest.cpp",
|
|
|
|
"tests/ElfInterfaceTest.cpp",
|
|
|
|
"tests/ElfTest.cpp",
|
2017-07-01 02:18:16 +02:00
|
|
|
"tests/ElfTestUtils.cpp",
|
2017-12-21 03:49:01 +01:00
|
|
|
"tests/JitDebugTest.cpp",
|
2018-04-05 20:15:00 +02:00
|
|
|
"tests/LocalUnwinderTest.cpp",
|
2017-01-20 05:08:48 +01:00
|
|
|
"tests/LogFake.cpp",
|
2018-10-02 06:01:09 +02:00
|
|
|
"tests/MapInfoCreateMemoryTest.cpp",
|
2019-01-17 02:23:39 +01:00
|
|
|
"tests/MapInfoGetBuildIDTest.cpp",
|
2017-07-01 02:18:16 +02:00
|
|
|
"tests/MapInfoGetElfTest.cpp",
|
2017-12-02 06:37:37 +01:00
|
|
|
"tests/MapInfoGetLoadBiasTest.cpp",
|
2018-12-06 00:57:02 +01:00
|
|
|
"tests/MapInfoTest.cpp",
|
2017-04-05 22:25:04 +02:00
|
|
|
"tests/MapsTest.cpp",
|
2017-07-12 00:29:32 +02:00
|
|
|
"tests/MemoryBufferTest.cpp",
|
2018-11-15 00:36:45 +01:00
|
|
|
"tests/MemoryCacheTest.cpp",
|
2017-01-20 05:08:48 +01:00
|
|
|
"tests/MemoryFake.cpp",
|
|
|
|
"tests/MemoryFileTest.cpp",
|
|
|
|
"tests/MemoryLocalTest.cpp",
|
2018-04-04 01:03:28 +02:00
|
|
|
"tests/MemoryOfflineBufferTest.cpp",
|
2017-11-14 01:16:27 +01:00
|
|
|
"tests/MemoryOfflineTest.cpp",
|
2017-01-20 05:08:48 +01:00
|
|
|
"tests/MemoryRangeTest.cpp",
|
2018-10-02 06:01:09 +02:00
|
|
|
"tests/MemoryRangesTest.cpp",
|
2017-01-20 05:08:48 +01:00
|
|
|
"tests/MemoryRemoteTest.cpp",
|
2017-07-07 21:18:16 +02:00
|
|
|
"tests/MemoryTest.cpp",
|
2018-08-03 00:21:37 +02:00
|
|
|
"tests/RegsInfoTest.cpp",
|
2017-09-22 21:57:15 +02:00
|
|
|
"tests/RegsIterateTest.cpp",
|
2017-07-19 21:37:45 +02:00
|
|
|
"tests/RegsStepIfSignalHandlerTest.cpp",
|
2017-01-20 05:08:48 +01:00
|
|
|
"tests/RegsTest.cpp",
|
2017-04-04 23:06:58 +02:00
|
|
|
"tests/SymbolsTest.cpp",
|
2019-01-24 21:22:03 +01:00
|
|
|
"tests/TestUtils.cpp",
|
2017-11-29 04:14:54 +01:00
|
|
|
"tests/UnwindOfflineTest.cpp",
|
2017-07-08 01:35:48 +02:00
|
|
|
"tests/UnwindTest.cpp",
|
2017-09-26 04:23:07 +02:00
|
|
|
"tests/UnwinderTest.cpp",
|
2017-01-20 05:08:48 +01:00
|
|
|
],
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-O0",
|
|
|
|
"-g",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
2017-06-28 23:51:54 +02:00
|
|
|
"liblzma",
|
2017-07-12 00:29:32 +02:00
|
|
|
"libunwindstack",
|
2018-12-19 15:28:33 +01:00
|
|
|
"libdexfile_support",
|
2017-01-20 05:08:48 +01:00
|
|
|
],
|
|
|
|
|
2017-05-11 03:34:15 +02:00
|
|
|
static_libs: [
|
|
|
|
"libgmock",
|
|
|
|
],
|
|
|
|
|
2018-04-28 01:12:06 +02:00
|
|
|
test_suites: ["device-tests"],
|
2017-06-28 23:51:54 +02:00
|
|
|
data: [
|
2017-07-01 02:18:16 +02:00
|
|
|
"tests/files/elf32.xz",
|
|
|
|
"tests/files/elf64.xz",
|
2018-03-15 02:16:22 +01:00
|
|
|
"tests/files/offline/art_quick_osr_stub_arm/*",
|
2018-01-24 17:52:47 +01:00
|
|
|
"tests/files/offline/bad_eh_frame_hdr_arm64/*",
|
|
|
|
"tests/files/offline/debug_frame_first_x86/*",
|
2018-06-06 23:47:31 +02:00
|
|
|
"tests/files/offline/debug_frame_load_bias_arm/*",
|
2018-02-10 00:57:39 +01:00
|
|
|
"tests/files/offline/eh_frame_hdr_begin_x86_64/*",
|
2018-02-05 22:07:06 +01:00
|
|
|
"tests/files/offline/jit_debug_arm/*",
|
|
|
|
"tests/files/offline/jit_debug_x86/*",
|
2018-02-23 02:11:31 +01:00
|
|
|
"tests/files/offline/jit_map_arm/*",
|
2018-02-05 22:07:06 +01:00
|
|
|
"tests/files/offline/gnu_debugdata_arm/*",
|
2018-05-18 03:37:38 +02:00
|
|
|
"tests/files/offline/offset_arm/*",
|
2018-12-10 20:13:23 +01:00
|
|
|
"tests/files/offline/shared_lib_in_apk_arm64/*",
|
|
|
|
"tests/files/offline/shared_lib_in_apk_memory_only_arm64/*",
|
2019-03-12 23:17:36 +01:00
|
|
|
"tests/files/offline/shared_lib_in_apk_single_map_arm64/*",
|
2018-02-05 22:07:06 +01:00
|
|
|
"tests/files/offline/straddle_arm/*",
|
2017-11-29 04:14:54 +01:00
|
|
|
"tests/files/offline/straddle_arm64/*",
|
2017-06-28 23:51:54 +02:00
|
|
|
],
|
2018-06-06 19:48:41 +02:00
|
|
|
required: [
|
|
|
|
"libunwindstack_local",
|
|
|
|
],
|
2017-01-20 05:08:48 +01:00
|
|
|
}
|
2017-02-02 00:44:40 +01:00
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
2017-07-13 00:40:52 +02:00
|
|
|
// Tools
|
2017-02-02 00:44:40 +01:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
cc_defaults {
|
2017-07-13 00:40:52 +02:00
|
|
|
name: "libunwindstack_tools",
|
2017-02-02 00:44:40 +01:00
|
|
|
defaults: ["libunwindstack_flags"],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libunwindstack",
|
|
|
|
"libbase",
|
2017-06-28 23:51:54 +02:00
|
|
|
"liblzma",
|
2017-02-02 00:44:40 +01:00
|
|
|
],
|
2018-05-21 17:24:20 +02:00
|
|
|
target: {
|
|
|
|
// Always disable optimizations for host to make it easier to debug.
|
|
|
|
host: {
|
|
|
|
cflags: [
|
|
|
|
"-O0",
|
|
|
|
"-g",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2017-07-13 00:40:52 +02:00
|
|
|
}
|
2017-02-02 00:44:40 +01:00
|
|
|
|
2017-07-13 00:40:52 +02:00
|
|
|
cc_binary {
|
|
|
|
name: "unwind",
|
|
|
|
defaults: ["libunwindstack_tools"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"tools/unwind.cpp",
|
2017-02-02 00:44:40 +01:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "unwind_info",
|
2017-07-13 00:40:52 +02:00
|
|
|
defaults: ["libunwindstack_tools"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"tools/unwind_info.cpp",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "unwind_symbols",
|
|
|
|
defaults: ["libunwindstack_tools"],
|
2017-02-02 00:44:40 +01:00
|
|
|
|
|
|
|
srcs: [
|
2017-07-13 00:40:52 +02:00
|
|
|
"tools/unwind_symbols.cpp",
|
2017-02-02 00:44:40 +01:00
|
|
|
],
|
|
|
|
}
|
2017-06-28 23:51:54 +02:00
|
|
|
|
2017-12-16 05:00:59 +01:00
|
|
|
cc_binary {
|
|
|
|
name: "unwind_for_offline",
|
|
|
|
defaults: ["libunwindstack_tools"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"tools/unwind_for_offline.cpp",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2018-02-10 00:57:39 +01:00
|
|
|
cc_binary {
|
|
|
|
name: "unwind_reg_info",
|
|
|
|
defaults: ["libunwindstack_tools"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"tools/unwind_reg_info.cpp",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2018-11-15 00:36:45 +01:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// Benchmarks
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
cc_benchmark {
|
|
|
|
name: "unwind_benchmarks",
|
|
|
|
host_supported: true,
|
|
|
|
defaults: ["libunwindstack_flags"],
|
|
|
|
|
|
|
|
// Disable optimizations so that all of the calls are not optimized away.
|
|
|
|
cflags: [
|
|
|
|
"-O0",
|
|
|
|
],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"benchmarks/unwind_benchmarks.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
2019-01-17 02:23:39 +01:00
|
|
|
"libbase",
|
2018-11-15 00:36:45 +01:00
|
|
|
"libunwindstack",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2017-06-28 23:51:54 +02:00
|
|
|
// Generates the elf data for use in the tests for .gnu_debugdata frames.
|
|
|
|
// Once these files are generated, use the xz command to compress the data.
|
|
|
|
cc_binary_host {
|
|
|
|
name: "gen_gnudebugdata",
|
2017-07-12 00:29:32 +02:00
|
|
|
defaults: ["libunwindstack_flags"],
|
2017-06-28 23:51:54 +02:00
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"tests/GenGnuDebugdata.cpp",
|
|
|
|
],
|
|
|
|
}
|