| # Copyright 2016 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/package.gni") |
| import("//build/testing/environments.gni") |
| |
| # A collection of utilities useful to debuggers and similar programs. |
| |
| static_library("debugger_utils") { |
| sources = [ |
| "breakpoints.h", |
| "build_ids.cc", |
| "build_ids.h", |
| "byte_block.h", |
| "byte_block_file.cc", |
| "byte_block_file.h", |
| "elf_reader.cc", |
| "elf_reader.h", |
| "elf_symtab.cc", |
| "elf_symtab.h", |
| "ktrace_reader.cc", |
| "ktrace_reader.h", |
| "load_maps.cc", |
| "load_maps.h", |
| "util.cc", |
| "util.h", |
| ] |
| |
| if (is_fuchsia) { |
| sources += [ |
| "breakpoints.cc", |
| "dso_list.cc", |
| "dso_list.h", |
| "jobs.cc", |
| "jobs.h", |
| "registers.cc", |
| "registers.h", |
| "sysinfo.cc", |
| "sysinfo.h", |
| "threads.cc", |
| "threads.h", |
| "util_zx.cc", |
| ] |
| } |
| |
| if (current_cpu == "x64") { |
| sources += [ |
| "x86_cpuid.cc", |
| "x86_cpuid.h", |
| "x86_pt.cc", |
| "x86_pt.h", |
| ] |
| } |
| |
| public_deps = [ |
| "//garnet/public/lib/fxl", |
| "//zircon/public/lib/zircon-internal", |
| ] |
| |
| deps = [ |
| "//zircon/public/lib/fit", |
| ] |
| |
| if (is_fuchsia) { |
| public_deps += [ |
| "//zircon/public/fidl/fuchsia-sysinfo:fuchsia-sysinfo_c", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/zx", |
| ] |
| } else { |
| deps += [ "//zircon/system/public" ] |
| } |
| } |
| |
| executable("tests") { |
| testonly = true |
| output_name = "debugger_utils_tests" |
| |
| sources = [ |
| "jobs.cc", |
| "jobs.h", |
| "jobs_unittest.cc", |
| "run_all_unittests.cc", |
| "sysinfo.cc", |
| "sysinfo.h", |
| "threads.cc", |
| "threads.h", |
| "threads_unittest.cc", |
| "util.cc", |
| "util.h", |
| "util_unittest.cc", |
| "util_zx.cc", |
| "util_zx_unittest.cc", |
| ] |
| |
| deps = [ |
| ":debugger_utils", |
| "//garnet/public/lib/fxl", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/zx", |
| ] |
| |
| libs = [ "zircon" ] |
| } |
| |
| executable("test_helper") { |
| testonly = true |
| # US-142: This binary has a long name because it has to be unique within |
| # the entire system. |
| output_name = "debugger_utils_test_helper" |
| |
| sources = [ |
| "test_helper.cc", |
| ] |
| |
| deps = [ |
| ":debugger_utils", |
| "//zircon/public/lib/zx", |
| ] |
| |
| libs = [ "zircon" ] |
| } |
| |
| package("debugger_utils_tests") { |
| testonly = true |
| |
| deps = [ |
| ":test_helper", |
| ":tests", |
| ] |
| |
| binaries = [ |
| { |
| name = "debugger_utils_test_helper" |
| dest = "test_helper" |
| }, |
| ] |
| |
| tests = [ |
| { |
| name = "debugger_utils_tests" |
| environments = basic_envs |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/debugger_utils_tests.cmx") |
| dest = "debugger_utils_tests.cmx" |
| }, |
| ] |
| } |