blob: 84fbc556d355c4ab34002ce1942292008065e712 [file]
# Copyright 2026 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.
load("//build/bazel/platforms:constraints.bzl", "HOST_OS_CONSTRAINTS")
load("//build/bazel/rules/cc:fx_cc_library.bzl", "fx_cc_library")
package(default_applicable_licenses = ["//:license"])
fx_cc_library(
name = "expr",
srcs = [
"abi_arm64.cc",
"abi_riscv64.cc",
"abi_x64.cc",
"bitfield.cc",
"builtin_types.cc",
"cast.cc",
"eval_context.cc",
"eval_context_impl.cc",
"eval_dwarf_expr.cc",
"eval_operators.cc",
"expr.cc",
"expr_language.cc",
"expr_node.cc",
"expr_number_utils.cc",
"expr_parser.cc",
"expr_token_type.cc",
"expr_tokenizer.cc",
"expr_value.cc",
"expr_value_source.cc",
"find_name.cc",
"format.cc",
"format_node.cc",
"found_member.cc",
"found_name.cc",
"identifier_glob.cc",
"index_walker.cc",
"keywords.cc",
"number_parser.cc",
"operator_keyword.cc",
"parse_special_identifier.cc",
"parse_string.cc",
"parsed_identifier.cc",
"permissive_input_location.cc",
"pretty_rust_tuple.cc",
"pretty_std_string.cc",
"pretty_type.cc",
"pretty_type_manager.cc",
"register_utils.cc",
"resolve_array.cc",
"resolve_base.cc",
"resolve_collection.cc",
"resolve_const_value.cc",
"resolve_function.cc",
"resolve_ptr_ref.cc",
"resolve_type.cc",
"resolve_variant.cc",
"return_value.cc",
"template_type_extractor.cc",
"variable_decl.cc",
"vector_register_format.cc",
"vm_exec.cc",
"vm_op.cc",
"vm_op_type.cc",
"vm_stream.cc",
],
hdrs = [
"abi.h",
"abi_arm64.h",
"abi_null.h",
"abi_riscv64.h",
"abi_x64.h",
"bitfield.h",
"builtin_types.h",
"cast.h",
"eval_callback.h",
"eval_context.h",
"eval_context_impl.h",
"eval_dwarf_expr.h",
"eval_operators.h",
"expr.h",
"expr_language.h",
"expr_node.h",
"expr_number_utils.h",
"expr_parser.h",
"expr_token.h",
"expr_token_type.h",
"expr_tokenizer.h",
"expr_value.h",
"expr_value_source.h",
"find_name.h",
"format.h",
"format_node.h",
"format_options.h",
"found_member.h",
"found_name.h",
"identifier_glob.h",
"index_walker.h",
"keywords.h",
"local_expr_value.h",
"number_parser.h",
"operator_keyword.h",
"parse_special_identifier.h",
"parse_string.h",
"parsed_identifier.h",
"permissive_input_location.h",
"pretty_rust_tuple.h",
"pretty_std_string.h",
"pretty_type.h",
"pretty_type_manager.h",
"register_utils.h",
"resolve_array.h",
"resolve_base.h",
"resolve_collection.h",
"resolve_const_value.h",
"resolve_function.h",
"resolve_ptr_ref.h",
"resolve_type.h",
"resolve_variant.h",
"return_value.h",
"template_type_extractor.h",
"variable_decl.h",
"vector_register_format.h",
"vm_exec.h",
"vm_op.h",
"vm_op_type.h",
"vm_stream.h",
],
# Host-only in Bazel (depends on host-only //src/developer/debug/zxdb/symbols);
# keep unguarded in BUILD.gn.
# @bazel2gn:skip
target_compatible_with = HOST_OS_CONSTRAINTS,
visibility = [
"//src/developer/debug/zxdb/client:__pkg__",
"//src/developer/debug/zxdb/console:__pkg__",
"//src/developer/debug/zxdb/format:__pkg__",
],
deps = [
"//sdk/lib/fit",
"//src/developer/debug/zxdb/common",
"//src/developer/debug/zxdb/symbols",
"//src/lib/fxl",
"@double-conversion//:double-conversion",
],
)
fx_cc_library(
name = "test_support",
testonly = True,
srcs = ["mock_eval_context.cc"],
hdrs = [
"mock_eval_context.h",
"test_eval_context_impl.h",
],
# Host-only in Bazel (depends on host-only :expr and zxdb/symbols:test_support);
# keep unguarded in BUILD.gn.
# @bazel2gn:skip
target_compatible_with = HOST_OS_CONSTRAINTS,
visibility = [
"//src/developer/debug/zxdb/client:__pkg__",
"//src/developer/debug/zxdb/console:__pkg__",
"//src/developer/debug/zxdb/format:__pkg__",
],
deps = [
":expr",
"//src/developer/debug/zxdb/symbols:test_support",
],
alwayslink = True,
)
fx_cc_library(
name = "tests",
testonly = True,
srcs = [
"bitfield_unittest.cc",
"builtin_types_unittest.cc",
"cast_unittest.cc",
"eval_context_impl_unittest.cc",
"eval_dwarf_expr_unittest.cc",
"eval_operators_unittest.cc",
"eval_test_support.cc",
"eval_test_support.h",
"expr_language_unittest.cc",
"expr_node_unittest.cc",
"expr_parser_unittest.cc",
"expr_tokenizer_unittest.cc",
"expr_unittest.cc",
"expr_value_source_unittest.cc",
"expr_value_unittest.cc",
"find_name_unittest.cc",
"format_test_support.cc",
"format_test_support.h",
"format_unittest.cc",
"identifier_glob_unittest.cc",
"index_walker_unittest.cc",
"mock_expr_node.cc",
"mock_expr_node.h",
"number_parser_unittest.cc",
"operator_keyword_unittest.cc",
"parse_special_identifier_unittest.cc",
"parse_string_unittest.cc",
"parsed_identifier_unittest.cc",
"permissive_input_location_unittest.cc",
"pretty_rust_tuple_unittest.cc",
"pretty_std_string_unittest.cc",
"pretty_type_manager_unittest.cc",
"pretty_type_unittest.cc",
"resolve_array_unittest.cc",
"resolve_base_unittest.cc",
"resolve_collection_unittest.cc",
"resolve_ptr_ref_unittest.cc",
"resolve_type_unittest.cc",
"resolve_variant_unittest.cc",
"return_value_unittest.cc",
"template_type_extractor_unittest.cc",
"variable_decl_unittest.cc",
"vector_register_format_unittest.cc",
"virtual_base_test_setup.cc",
"virtual_base_test_setup.h",
"virtual_inheritance_test_setup.cc",
"virtual_inheritance_test_setup.h",
"vm_exec_unittest.cc",
"vm_stream_unittest.cc",
],
# Note: this should not depend on client/ or console/ libraries, including
# their test_support.
implementation_deps = [
":expr",
":test_support",
"//src/developer/debug/zxdb/common:test_support",
"//src/developer/debug/zxdb/symbols:test_support",
"//src/lib/llvm/host:LLVMBinaryFormat",
"@com_google_googletest//:gtest",
],
# Host-only in Bazel (depends on host-only :expr and LLVMBinaryFormat);
# keep unguarded in BUILD.gn.
# @bazel2gn:skip
target_compatible_with = HOST_OS_CONSTRAINTS,
alwayslink = True,
)