2017-01-20 04:08:48 +00: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 21:45:16 +00:00
|
|
|
|
|
|
|
target: {
|
|
|
|
darwin: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
2017-09-20 00:53:12 +00:00
|
|
|
linux_bionic: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
2017-01-30 21:45:16 +00:00
|
|
|
},
|
2017-01-20 04:08:48 +00:00
|
|
|
}
|
|
|
|
|
2017-07-11 22:29:32 +00:00
|
|
|
cc_library {
|
|
|
|
name: "libunwindstack",
|
2017-07-27 16:29:18 +00:00
|
|
|
vendor_available: true,
|
2017-08-04 08:33:54 +00:00
|
|
|
vndk: {
|
|
|
|
enabled: true,
|
|
|
|
support_system_process: true,
|
|
|
|
},
|
2017-01-20 04:08:48 +00:00
|
|
|
defaults: ["libunwindstack_flags"],
|
2017-07-14 17:37:19 +00:00
|
|
|
export_include_dirs: ["include"],
|
2017-01-20 04:08:48 +00:00
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"ArmExidx.cpp",
|
2017-04-24 18:14:39 +00:00
|
|
|
"DwarfCfa.cpp",
|
2017-11-03 21:50:27 +00:00
|
|
|
"DwarfEhFrameWithHdr.cpp",
|
2017-03-21 19:41:17 +00:00
|
|
|
"DwarfMemory.cpp",
|
2017-04-04 17:41:31 +00:00
|
|
|
"DwarfOp.cpp",
|
2017-05-11 01:34:15 +00:00
|
|
|
"DwarfSection.cpp",
|
2017-02-01 23:44:40 +00:00
|
|
|
"Elf.cpp",
|
|
|
|
"ElfInterface.cpp",
|
|
|
|
"ElfInterfaceArm.cpp",
|
2017-01-20 04:08:48 +00:00
|
|
|
"Log.cpp",
|
2017-04-19 22:42:19 +00:00
|
|
|
"MapInfo.cpp",
|
2017-04-05 20:25:04 +00:00
|
|
|
"Maps.cpp",
|
2017-02-01 23:44:40 +00:00
|
|
|
"Memory.cpp",
|
2017-06-28 21:51:54 +00:00
|
|
|
"Regs.cpp",
|
2017-12-01 02:56:01 +00:00
|
|
|
"RegsArm.cpp",
|
|
|
|
"RegsArm64.cpp",
|
|
|
|
"RegsX86.cpp",
|
|
|
|
"RegsX86_64.cpp",
|
2017-11-08 09:53:53 +00:00
|
|
|
"RegsMips.cpp",
|
|
|
|
"RegsMips64.cpp",
|
2017-09-20 20:37:24 +00:00
|
|
|
"Unwinder.cpp",
|
2017-04-04 21:06:58 +00:00
|
|
|
"Symbols.cpp",
|
2017-01-20 04:08:48 +00:00
|
|
|
],
|
|
|
|
|
2017-10-23 21:25:08 +00:00
|
|
|
cflags: [
|
|
|
|
"-Wexit-time-destructors",
|
|
|
|
],
|
|
|
|
|
2017-09-01 18:17:16 +00:00
|
|
|
target: {
|
|
|
|
// Always disable optimizations for host to make it easier to debug.
|
2017-10-02 17:29:02 +00:00
|
|
|
host: {
|
2017-09-01 18:17:16 +00:00
|
|
|
cflags: ["-O0", "-g"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2017-07-07 23:35:48 +00:00
|
|
|
arch: {
|
|
|
|
x86: {
|
|
|
|
srcs: ["AsmGetRegsX86.S"],
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
srcs: ["AsmGetRegsX86_64.S"],
|
|
|
|
},
|
2017-11-08 09:53:53 +00:00
|
|
|
mips: {
|
|
|
|
srcs: ["AsmGetRegsMips.S"],
|
|
|
|
},
|
|
|
|
mips64: {
|
|
|
|
srcs: ["AsmGetRegsMips64.S"],
|
|
|
|
},
|
2017-07-07 23:35:48 +00:00
|
|
|
},
|
|
|
|
|
2017-01-20 04:08:48 +00:00
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
2017-06-28 21:51:54 +00:00
|
|
|
"liblzma",
|
2017-01-20 04:08:48 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// Unit Tests
|
|
|
|
//-------------------------------------------------------------------------
|
2017-07-11 22:29:32 +00:00
|
|
|
cc_test {
|
|
|
|
name: "libunwindstack_test",
|
2017-01-20 04:08:48 +00:00
|
|
|
defaults: ["libunwindstack_flags"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"tests/ArmExidxDecodeTest.cpp",
|
|
|
|
"tests/ArmExidxExtractTest.cpp",
|
2017-04-24 18:14:39 +00:00
|
|
|
"tests/DwarfCfaLogTest.cpp",
|
|
|
|
"tests/DwarfCfaTest.cpp",
|
2017-06-13 02:14:20 +00:00
|
|
|
"tests/DwarfDebugFrameTest.cpp",
|
|
|
|
"tests/DwarfEhFrameTest.cpp",
|
2017-11-03 21:50:27 +00:00
|
|
|
"tests/DwarfEhFrameWithHdrTest.cpp",
|
2017-03-21 19:41:17 +00:00
|
|
|
"tests/DwarfMemoryTest.cpp",
|
2017-04-04 17:41:31 +00:00
|
|
|
"tests/DwarfOpLogTest.cpp",
|
|
|
|
"tests/DwarfOpTest.cpp",
|
2017-05-11 01:34:15 +00:00
|
|
|
"tests/DwarfSectionTest.cpp",
|
|
|
|
"tests/DwarfSectionImplTest.cpp",
|
2017-09-26 02:23:07 +00:00
|
|
|
"tests/ElfFake.cpp",
|
2017-02-01 23:44:40 +00:00
|
|
|
"tests/ElfInterfaceArmTest.cpp",
|
|
|
|
"tests/ElfInterfaceTest.cpp",
|
|
|
|
"tests/ElfTest.cpp",
|
2017-07-01 00:18:16 +00:00
|
|
|
"tests/ElfTestUtils.cpp",
|
2017-01-20 04:08:48 +00:00
|
|
|
"tests/LogFake.cpp",
|
2017-07-01 00:18:16 +00:00
|
|
|
"tests/MapInfoGetElfTest.cpp",
|
2017-12-02 05:37:37 +00:00
|
|
|
"tests/MapInfoGetLoadBiasTest.cpp",
|
2017-04-05 20:25:04 +00:00
|
|
|
"tests/MapsTest.cpp",
|
2017-07-11 22:29:32 +00:00
|
|
|
"tests/MemoryBufferTest.cpp",
|
2017-01-20 04:08:48 +00:00
|
|
|
"tests/MemoryFake.cpp",
|
|
|
|
"tests/MemoryFileTest.cpp",
|
|
|
|
"tests/MemoryLocalTest.cpp",
|
2017-11-14 00:16:27 +00:00
|
|
|
"tests/MemoryOfflineTest.cpp",
|
2017-01-20 04:08:48 +00:00
|
|
|
"tests/MemoryRangeTest.cpp",
|
|
|
|
"tests/MemoryRemoteTest.cpp",
|
2017-07-07 19:18:16 +00:00
|
|
|
"tests/MemoryTest.cpp",
|
2017-09-22 19:57:15 +00:00
|
|
|
"tests/RegsIterateTest.cpp",
|
2017-07-19 19:37:45 +00:00
|
|
|
"tests/RegsStepIfSignalHandlerTest.cpp",
|
2017-01-20 04:08:48 +00:00
|
|
|
"tests/RegsTest.cpp",
|
2017-04-04 21:06:58 +00:00
|
|
|
"tests/SymbolsTest.cpp",
|
2017-11-29 03:14:54 +00:00
|
|
|
"tests/UnwindOfflineTest.cpp",
|
2017-07-07 23:35:48 +00:00
|
|
|
"tests/UnwindTest.cpp",
|
2017-09-26 02:23:07 +00:00
|
|
|
"tests/UnwinderTest.cpp",
|
2017-01-20 04:08:48 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-O0",
|
|
|
|
"-g",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
2017-06-28 21:51:54 +00:00
|
|
|
"liblzma",
|
2017-07-11 22:29:32 +00:00
|
|
|
"libunwindstack",
|
2017-01-20 04:08:48 +00:00
|
|
|
],
|
|
|
|
|
2017-05-11 01:34:15 +00:00
|
|
|
static_libs: [
|
|
|
|
"libgmock",
|
|
|
|
],
|
|
|
|
|
2017-06-28 21:51:54 +00:00
|
|
|
data: [
|
2017-07-01 00:18:16 +00:00
|
|
|
"tests/files/elf32.xz",
|
|
|
|
"tests/files/elf64.xz",
|
2017-12-15 19:17:45 +00:00
|
|
|
"tests/files/offline/gnu_debugdata_arm32/*",
|
2017-11-29 03:14:54 +00:00
|
|
|
"tests/files/offline/straddle_arm32/*",
|
|
|
|
"tests/files/offline/straddle_arm64/*",
|
2017-06-28 21:51:54 +00:00
|
|
|
],
|
2017-01-20 04:08:48 +00:00
|
|
|
}
|
2017-02-01 23:44:40 +00:00
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
2017-07-12 22:40:52 +00:00
|
|
|
// Tools
|
2017-02-01 23:44:40 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
cc_defaults {
|
2017-07-12 22:40:52 +00:00
|
|
|
name: "libunwindstack_tools",
|
2017-02-01 23:44:40 +00:00
|
|
|
defaults: ["libunwindstack_flags"],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libunwindstack",
|
|
|
|
"libbase",
|
2017-06-28 21:51:54 +00:00
|
|
|
"liblzma",
|
2017-02-01 23:44:40 +00:00
|
|
|
],
|
2017-07-12 22:40:52 +00:00
|
|
|
}
|
2017-02-01 23:44:40 +00:00
|
|
|
|
2017-07-12 22:40:52 +00:00
|
|
|
cc_binary {
|
|
|
|
name: "unwind",
|
|
|
|
defaults: ["libunwindstack_tools"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"tools/unwind.cpp",
|
2017-02-01 23:44:40 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "unwind_info",
|
2017-07-12 22:40:52 +00:00
|
|
|
defaults: ["libunwindstack_tools"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"tools/unwind_info.cpp",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "unwind_symbols",
|
|
|
|
defaults: ["libunwindstack_tools"],
|
2017-02-01 23:44:40 +00:00
|
|
|
|
|
|
|
srcs: [
|
2017-07-12 22:40:52 +00:00
|
|
|
"tools/unwind_symbols.cpp",
|
2017-02-01 23:44:40 +00:00
|
|
|
],
|
|
|
|
}
|
2017-06-28 21:51:54 +00: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-11 22:29:32 +00:00
|
|
|
defaults: ["libunwindstack_flags"],
|
2017-06-28 21:51:54 +00:00
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"tests/GenGnuDebugdata.cpp",
|
|
|
|
],
|
|
|
|
}
|