f6d5431273
- Cleanup the blueprint file a bit. - Fix the formatting in DwarfMemoryTest.cpp. - Fix the misnamed test MemoryBuffer.cpp to MemoryBufferTest.cpp. - Add a function to find the location of the test files so it's not necessary to run the test in the same directory as the test files. Bug: 23762183 Test: Builds and unit tests pass. Change-Id: I5666972bd01f14b8ee47c518f1840f8aeb7fd08b
188 lines
4.2 KiB
Text
188 lines
4.2 KiB
Text
//
|
|
// 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",
|
|
],
|
|
|
|
target: {
|
|
darwin: {
|
|
enabled: false,
|
|
},
|
|
},
|
|
|
|
arch: {
|
|
mips: {
|
|
enabled: false,
|
|
},
|
|
mips64: {
|
|
enabled: false,
|
|
},
|
|
},
|
|
}
|
|
|
|
cc_library {
|
|
name: "libunwindstack",
|
|
defaults: ["libunwindstack_flags"],
|
|
|
|
srcs: [
|
|
"ArmExidx.cpp",
|
|
"DwarfCfa.cpp",
|
|
"DwarfDebugFrame.cpp",
|
|
"DwarfEhFrame.cpp",
|
|
"DwarfMemory.cpp",
|
|
"DwarfOp.cpp",
|
|
"DwarfSection.cpp",
|
|
"Elf.cpp",
|
|
"ElfInterface.cpp",
|
|
"ElfInterfaceArm.cpp",
|
|
"Log.cpp",
|
|
"MapInfo.cpp",
|
|
"Maps.cpp",
|
|
"Memory.cpp",
|
|
"Regs.cpp",
|
|
"Symbols.cpp",
|
|
],
|
|
|
|
arch: {
|
|
x86: {
|
|
srcs: ["AsmGetRegsX86.S"],
|
|
},
|
|
x86_64: {
|
|
srcs: ["AsmGetRegsX86_64.S"],
|
|
},
|
|
},
|
|
|
|
shared_libs: [
|
|
"libbase",
|
|
"liblog",
|
|
"liblzma",
|
|
],
|
|
}
|
|
|
|
//-------------------------------------------------------------------------
|
|
// Unit Tests
|
|
//-------------------------------------------------------------------------
|
|
cc_test {
|
|
name: "libunwindstack_test",
|
|
defaults: ["libunwindstack_flags"],
|
|
|
|
srcs: [
|
|
"tests/ArmExidxDecodeTest.cpp",
|
|
"tests/ArmExidxExtractTest.cpp",
|
|
"tests/DwarfCfaLogTest.cpp",
|
|
"tests/DwarfCfaTest.cpp",
|
|
"tests/DwarfDebugFrameTest.cpp",
|
|
"tests/DwarfEhFrameTest.cpp",
|
|
"tests/DwarfMemoryTest.cpp",
|
|
"tests/DwarfOpLogTest.cpp",
|
|
"tests/DwarfOpTest.cpp",
|
|
"tests/DwarfSectionTest.cpp",
|
|
"tests/DwarfSectionImplTest.cpp",
|
|
"tests/ElfInterfaceArmTest.cpp",
|
|
"tests/ElfInterfaceTest.cpp",
|
|
"tests/ElfTest.cpp",
|
|
"tests/ElfTestUtils.cpp",
|
|
"tests/LogFake.cpp",
|
|
"tests/MapInfoCreateMemoryTest.cpp",
|
|
"tests/MapInfoGetElfTest.cpp",
|
|
"tests/MapsTest.cpp",
|
|
"tests/MemoryBufferTest.cpp",
|
|
"tests/MemoryFake.cpp",
|
|
"tests/MemoryFileTest.cpp",
|
|
"tests/MemoryLocalTest.cpp",
|
|
"tests/MemoryRangeTest.cpp",
|
|
"tests/MemoryRemoteTest.cpp",
|
|
"tests/MemoryTest.cpp",
|
|
"tests/RegsTest.cpp",
|
|
"tests/SymbolsTest.cpp",
|
|
"tests/UnwindTest.cpp",
|
|
],
|
|
|
|
cflags: [
|
|
"-O0",
|
|
"-g",
|
|
],
|
|
|
|
shared_libs: [
|
|
"libbase",
|
|
"liblog",
|
|
"liblzma",
|
|
"libunwindstack",
|
|
],
|
|
|
|
static_libs: [
|
|
"libgmock",
|
|
],
|
|
|
|
target: {
|
|
linux: {
|
|
host_ldlibs: [
|
|
"-lrt",
|
|
],
|
|
},
|
|
},
|
|
|
|
data: [
|
|
"tests/files/elf32.xz",
|
|
"tests/files/elf64.xz",
|
|
],
|
|
}
|
|
|
|
//-------------------------------------------------------------------------
|
|
// Utility Executables
|
|
//-------------------------------------------------------------------------
|
|
cc_defaults {
|
|
name: "libunwindstack_executables",
|
|
defaults: ["libunwindstack_flags"],
|
|
|
|
shared_libs: [
|
|
"libunwindstack",
|
|
"libbase",
|
|
"liblzma",
|
|
],
|
|
|
|
static_libs: [
|
|
"liblog",
|
|
],
|
|
}
|
|
|
|
cc_binary {
|
|
name: "unwind_info",
|
|
defaults: ["libunwindstack_executables"],
|
|
|
|
srcs: [
|
|
"unwind_info.cpp",
|
|
],
|
|
}
|
|
|
|
// 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",
|
|
defaults: ["libunwindstack_flags"],
|
|
|
|
srcs: [
|
|
"tests/GenGnuDebugdata.cpp",
|
|
],
|
|
}
|