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,
|
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",
|
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",
|
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",
|
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: {
|
2017-09-01 20:17:16 +02:00
|
|
|
cflags: ["-O0", "-g"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
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
|
|
|
},
|
|
|
|
|
2017-01-20 05:08:48 +01:00
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
2017-06-28 23:51:54 +02:00
|
|
|
"liblzma",
|
2017-01-20 05:08:48 +01:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// Unit Tests
|
|
|
|
//-------------------------------------------------------------------------
|
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",
|
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",
|
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-01-20 05:08:48 +01:00
|
|
|
"tests/LogFake.cpp",
|
2017-07-01 02:18:16 +02:00
|
|
|
"tests/MapInfoGetElfTest.cpp",
|
2017-12-02 06:37:37 +01:00
|
|
|
"tests/MapInfoGetLoadBiasTest.cpp",
|
2017-04-05 22:25:04 +02:00
|
|
|
"tests/MapsTest.cpp",
|
2017-07-12 00:29:32 +02:00
|
|
|
"tests/MemoryBufferTest.cpp",
|
2017-01-20 05:08:48 +01:00
|
|
|
"tests/MemoryFake.cpp",
|
|
|
|
"tests/MemoryFileTest.cpp",
|
|
|
|
"tests/MemoryLocalTest.cpp",
|
|
|
|
"tests/MemoryRangeTest.cpp",
|
|
|
|
"tests/MemoryRemoteTest.cpp",
|
2017-07-07 21:18:16 +02:00
|
|
|
"tests/MemoryTest.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",
|
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",
|
2017-01-20 05:08:48 +01:00
|
|
|
],
|
|
|
|
|
2017-05-11 03:34:15 +02:00
|
|
|
static_libs: [
|
|
|
|
"libgmock",
|
|
|
|
],
|
|
|
|
|
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",
|
2017-11-29 04:14:54 +01:00
|
|
|
"tests/files/offline/straddle_arm32/*",
|
|
|
|
"tests/files/offline/straddle_arm64/*",
|
2017-06-28 23:51:54 +02:00
|
|
|
],
|
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
|
|
|
],
|
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
|
|
|
|
|
|
|
// 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",
|
|
|
|
],
|
|
|
|
}
|