blob: c5028ce8f675961c276aa998ee0163ed7d1b4002 [file] [log] [blame]
# Copyright 2017 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")
# Set manually to true to compile the zxdb_test_app.cc file for manual debugger
# testing of various conditions.
include_test_app = false
static_library("lib") {
sources = [
"arch.cc",
"arch.h",
"breakpoint.cc",
"breakpoint.h",
"debug_agent.cc",
"debug_agent.h",
"debugged_job.cc",
"debugged_job.h",
"debugged_process.cc",
"debugged_process.h",
"debugged_thread.cc",
"debugged_thread.h",
"launcher.cc",
"launcher.h",
"object_util.cc",
"object_util.h",
"process_breakpoint.cc",
"process_breakpoint.h",
"process_info.cc",
"process_info.h",
"process_memory_accessor.h",
"remote_api.h",
"remote_api_adapter.cc",
"remote_api_adapter.h",
"system_info.cc",
"system_info.h",
"unwind.cc",
"unwind.h",
]
if (current_cpu == "x64") {
sources += [
"arch_x64.cc",
"arch_x64.h",
"arch_x64_helpers.cc",
"arch_x64_helpers.h",
]
} else if (current_cpu == "arm64") {
sources += [
"arch_arm64.cc",
"arch_arm64.h",
]
} else {
assert(false)
}
public_deps = [
"//garnet/lib/debug_ipc:agent",
"//garnet/lib/debug_ipc/helper",
"//garnet/lib/process",
"//garnet/public/lib/fxl",
"//garnet/public/lib/svc/cpp",
"//zircon/public/fidl/fuchsia-sysinfo:fuchsia-sysinfo_c",
"//zircon/public/lib/ngunwind",
]
}
if (include_test_app) {
executable("zxdb_test_app") {
if (is_debug) {
# Force no optimization in debug builds.
configs -= [ "//build/config:debug" ]
cflags = [ "-O0" ]
}
sources = [
"zxdb_test_app.cc",
]
deps = [
"//zircon/public/lib/zx",
]
}
}
executable("bin") {
output_name = "debug_agent"
sources = [
"main.cc",
]
deps = [
":lib",
"//garnet/public/lib/component/cpp:environment_services",
]
}
package("debug_agent") {
deprecated_system_image = true
deps = [
":bin",
]
binaries = [
{
name = "debug_agent"
},
]
}
executable("unittests") {
testonly = true
output_name = "debug_agent_tests"
sources = [
"breakpoint_unittest.cc",
"debugged_job_unittest.cc",
"debugged_thread_unittest.cc",
"process_breakpoint_unittest.cc",
"process_info_unittests.cc",
"system_info_unittests.cc",
]
if (current_cpu == "x64") {
sources += [
"arch_x64_helpers_unittest.cc",
]
}
deps = [
":lib",
"//garnet/lib/debug_ipc:tests",
"//garnet/public/lib/fxl/test:gtest_main",
"//third_party/googletest:gtest",
]
}
package("debug_agent_tests") {
testonly = true
package_name = "debug_agent_tests"
deps = [
":unittests",
]
tests = [
{
name = "debug_agent_tests"
},
]
if (include_test_app) {
deps += [ ":zxdb_test_app" ]
tests += [
{
name = "zxdb_test_app"
},
]
}
}