# Copyright (c) 2021-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/hiviewdfx/faultloggerd/faultloggerd.gni") processdump_sources = [ "dfx_fault_stack.cpp", "dfx_logger.cpp", "dfx_process.cpp", "dfx_ring_buffer_wrapper.cpp", "dfx_stack_info_formatter.cpp", "dfx_thread.cpp", "dfx_unwind_async_thread.cpp", "dfx_unwind_remote.cpp", "printer.cpp", "process_dumper.cpp", ] if (defined(ohos_lite)) { config("processdump_config") { visibility = [ "*:*" ] cflags = [] defines = [ "HAVE_CONFIG_H", "HAVE_ELF_H", "HAVE_LINK_H", "HISYSEVENT_DISABLE", "is_ohos_lite", ] include_dirs = [ ".", "$c_utils_include_path", "$faultloggerd_common_path/dfxlog", "$faultloggerd_common_path/dfxutil", "$faultloggerd_interfaces_path/common", "$faultloggerd_interfaces_path/innerkits/async_stack/include", "$faultloggerd_interfaces_path/innerkits/crash_exception", "$faultloggerd_interfaces_path/innerkits/faultloggerd_client/include", "$faultloggerd_interfaces_path/innerkits/procinfo/include", "$faultloggerd_interfaces_path/innerkits/unwinder/include", "$hilog_lite_include_path", ] } source_set("process_info_src") { sources = processdump_sources public_configs = [ ":processdump_config" ] deps = [ "$faultloggerd_common_path/dfxlog:dfx_hilog", "$faultloggerd_common_path/dfxutil:dfx_util", "$faultloggerd_interfaces_path/innerkits/async_stack:libasync_stack", "$faultloggerd_interfaces_path/innerkits/crash_exception", "$faultloggerd_interfaces_path/innerkits/faultloggerd_client:libfaultloggerd", "$faultloggerd_interfaces_path/innerkits/procinfo:libdfx_procinfo", "$faultloggerd_interfaces_path/innerkits/unwinder:libunwinder", "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", ] } executable("processdump") { sources = processdump_sources sources += [ "cppcrash_reporter.cpp", "main.cpp", ] public_configs = [ ":processdump_config" ] deps = [ "$faultloggerd_common_path/dfxlog:dfx_hilog", "$faultloggerd_common_path/dfxutil:dfx_util", "$faultloggerd_interfaces_path/innerkits/async_stack:libasync_stack", "$faultloggerd_interfaces_path/innerkits/crash_exception", "$faultloggerd_interfaces_path/innerkits/faultloggerd_client:libfaultloggerd", "$faultloggerd_interfaces_path/innerkits/procinfo:libdfx_procinfo", "$faultloggerd_interfaces_path/innerkits/unwinder:libunwinder", "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", ] } } else { config("processdump_config") { visibility = [ ":*" ] include_dirs = [ ".", "$faultloggerd_interfaces_path/common", "$faultloggerd_interfaces_path/innerkits/crash_exception", "$faultloggerd_interfaces_path/innerkits/procinfo/include", "$faultloggerd_interfaces_path/innerkits/signal_handler", "$faultloggerd_interfaces_path/innerkits/unwinder/include", "$faultloggerd_path/common", ] cflags_cc = [ "-DRUSTC_DEMANGLE" ] if (processdump_minidebuginfo_enable) { defines = [ "PROCESSDUMP_MINIDEBUGINFO" ] } } ohos_source_set("process_info_src") { sources = processdump_sources configs = [ ":processdump_config", "$faultloggerd_common_path/build:coverage_flags", ] deps = [ "$faultloggerd_common_path/dfxlog:dfx_hilog", "$faultloggerd_common_path/dfxutil:dfx_util", "$faultloggerd_interfaces_path/innerkits/async_stack:libasync_stack", "$faultloggerd_interfaces_path/innerkits/crash_exception", "$faultloggerd_interfaces_path/innerkits/faultloggerd_client:libfaultloggerd", "$faultloggerd_interfaces_path/innerkits/procinfo:libdfx_procinfo", "$faultloggerd_interfaces_path/innerkits/unwinder:libunwinder", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "init:libbegetutil", "jsoncpp:jsoncpp", ] part_name = "faultloggerd" subsystem_name = "hiviewdfx" } ohos_executable("processdump") { install_enable = true configs = [ ":processdump_config", "$faultloggerd_path/common/build:coverage_flags", ] sources = processdump_sources sources += [ "cppcrash_reporter.cpp", "main.cpp", ] cflags_cc = [ "-DDEBUG_CRASH_LOCAL_HANDLER" ] defines = [ "DFX_LOG_HILOG_BASE" ] deps = [ "$faultloggerd_common_path/dfxlog:dfx_hilog_base", "$faultloggerd_common_path/dfxutil:dfx_util", "$faultloggerd_frameworks_path/localhandler:dfx_local_handler_src", "$faultloggerd_interfaces_path/innerkits/async_stack:libasync_stack", "$faultloggerd_interfaces_path/innerkits/crash_exception", "$faultloggerd_interfaces_path/innerkits/faultloggerd_client:libfaultloggerd", "$faultloggerd_interfaces_path/innerkits/procinfo:libdfx_procinfo", "$faultloggerd_interfaces_path/innerkits/unwinder:libunwinder", ] external_deps = [ "c_utils:utils", "hilog:libhilog_base", "hisysevent:libhisysevent", "init:libbegetutil", "jsoncpp:jsoncpp", ] install_images = [ "system", "updater", ] part_name = "faultloggerd" subsystem_name = "hiviewdfx" } }