| # Copyright 2021 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. |
| |
| static_library("unwinder") { |
| public = [ |
| "error.h", |
| "memory.h", |
| "registers.h", |
| "unwind.h", |
| ] |
| sources = [ |
| "dwarf_cfi.cc", |
| "dwarf_cfi.h", |
| "dwarf_cfi_parser.cc", |
| "dwarf_cfi_parser.h", |
| "dwarf_expr.cc", |
| "dwarf_expr.h", |
| "memory.cc", |
| "registers.cc", |
| "unwind.cc", |
| ] |
| public_deps = [ "//src/lib/fxl" ] |
| deps = [ "//sdk/lib/syslog/cpp" ] |
| |
| if (is_mac) { |
| deps += [ "//src/developer/debug/shared:elf_h_on_mac" ] |
| } else { |
| # UnwindLocal() is only available on ELF systems. |
| public += [ "unwind_local.h" ] |
| sources += [ |
| "third_party/libunwindstack/context.h", |
| "unwind_local.cc", |
| ] |
| if (current_cpu == "x64") { |
| sources += [ "third_party/libunwindstack/context_x86_64.S" ] |
| } |
| } |
| |
| if (is_fuchsia) { |
| public += [ "fuchsia.h" ] |
| sources += [ "fuchsia.cc" ] |
| } |
| } |
| |
| source_set("tests") { |
| testonly = true |
| |
| sources = [ "memory_unittest.cc" ] |
| if (!is_mac) { |
| sources += [ "unwind_local_unittest.cc" ] |
| } |
| |
| deps = [ |
| ":unwinder", |
| "//third_party/googletest:gtest", |
| ] |
| } |