blob: 62a3f6421d4ac5c1ba3d83bd770f89eca2708d0a [file] [log] [blame]
# 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")
executable("bin") {
# This is called debugserver and not gdbserver because it is not intended
# to be gdb specific. E.g., The GDB Remote Serial Protocol is used by other
# debuggers, e.g., lldb.
output_name = "debugserver"
sources = [
"cmd_handler.cc",
"cmd_handler.h",
"io_loop.cc",
"io_loop.h",
"main.cc",
"registers.cc",
"registers.h",
"server.cc",
"server.h",
"stop_reply_packet.cc",
"stop_reply_packet.h",
"thread_action_list.cc",
"thread_action_list.h",
"util.cc",
"util.h",
]
if (current_cpu == "x64") {
sources += [ "registers_x64.cc" ]
} else if (current_cpu == "arm64") {
sources += [ "registers_arm64.cc" ]
}
deps = [
"//garnet/lib/debugger_utils",
"//garnet/lib/inferior_control",
"//garnet/public/lib/fsl",
"//garnet/public/lib/svc/cpp",
"//sdk/lib/sys/cpp",
"//src/lib/fxl",
"//zircon/public/lib/async-loop-cpp",
"//zircon/public/lib/zx",
]
public_deps = [
"//zircon/public/lib/fit",
]
libs = [ "zircon" ]
}
group("tests") {
testonly = true
public_deps = [
":debugserver-unittests",
"test_apps",
]
}
executable("debugserver-unittests") {
testonly = true
sources = [
"run_all_unittests.cc",
"stop_reply_packet.cc",
"stop_reply_packet.h",
"stop_reply_packet_unittest.cc",
"thread_action_list.cc",
"thread_action_list.h",
"thread_action_list_unittest.cc",
"util.cc",
"util.h",
"util_unittest.cc",
]
deps = [
"//garnet/lib/debugger_utils",
"//src/lib/fxl",
"//third_party/googletest:gtest",
]
libs = [ "zircon" ]
}
package("debugserver") {
deps = [
":bin",
]
binaries = [
{
name = "debugserver"
shell = true
},
]
}
package("debugserver_tests") {
testonly = true
deps = [
":tests",
]
tests = [
{
name = "debugserver-unittests"
environments = basic_envs
},
]
# These have been very useful with interactive debugging/testing.
binaries = [
{
name = "exit-test"
},
{
name = "crash-test"
},
{
name = "loop-test"
},
{
name = "syscall-test"
},
{
name = "thread-test"
},
]
}