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-01-20 05:08:48 +01:00
|
|
|
}
|
|
|
|
|
2017-07-12 00:29:32 +02:00
|
|
|
cc_library {
|
|
|
|
name: "libunwindstack",
|
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-06-13 04:14:20 +02:00
|
|
|
"DwarfDebugFrame.cpp",
|
|
|
|
"DwarfEhFrame.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-04-04 23:06:58 +02:00
|
|
|
"Symbols.cpp",
|
2017-01-20 05:08:48 +01:00
|
|
|
],
|
|
|
|
|
2017-07-08 01:35:48 +02:00
|
|
|
arch: {
|
|
|
|
x86: {
|
|
|
|
srcs: ["AsmGetRegsX86.S"],
|
|
|
|
},
|
|
|
|
x86_64: {
|
|
|
|
srcs: ["AsmGetRegsX86_64.S"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
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-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-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/MapInfoCreateMemoryTest.cpp",
|
|
|
|
"tests/MapInfoGetElfTest.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-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-07-08 01:35:48 +02:00
|
|
|
"tests/UnwindTest.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-01-20 05:08:48 +01:00
|
|
|
target: {
|
|
|
|
linux: {
|
|
|
|
host_ldlibs: [
|
|
|
|
"-lrt",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
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-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
|
|
|
],
|
2017-07-13 00:40:52 +02:00
|
|
|
|
|
|
|
target: {
|
|
|
|
linux: {
|
|
|
|
host_ldlibs: [
|
|
|
|
"-lrt",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
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",
|
|
|
|
],
|
|
|
|
}
|