• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//base/hiviewdfx/faultloggerd/faultloggerd.gni")
15
16processdump_sources = [
17  "$faultloggerd_frameworks_path/unwinder/dfx_config.cpp",
18  "$faultloggerd_frameworks_path/unwinder/dfx_elf.cpp",
19  "$faultloggerd_frameworks_path/unwinder/dfx_frame_format.cpp",
20  "$faultloggerd_frameworks_path/unwinder/dfx_maps.cpp",
21  "$faultloggerd_frameworks_path/unwinder/dfx_memory.cpp",
22  "$faultloggerd_frameworks_path/unwinder/dfx_memory_file.cpp",
23  "$faultloggerd_frameworks_path/unwinder/dfx_regs.cpp",
24  "$faultloggerd_frameworks_path/unwinder/dfx_regs_arm.cpp",
25  "$faultloggerd_frameworks_path/unwinder/dfx_regs_arm64.cpp",
26  "$faultloggerd_frameworks_path/unwinder/dfx_regs_x86_64.cpp",
27  "$faultloggerd_frameworks_path/unwinder/dfx_signal.cpp",
28  "$faultloggerd_frameworks_path/unwinder/dfx_symbols.cpp",
29  "dfx_fault_stack.cpp",
30  "dfx_logger.cpp",
31  "dfx_process.cpp",
32  "dfx_ring_buffer_wrapper.cpp",
33  "dfx_thread.cpp",
34  "dfx_unwind_remote.cpp",
35  "printer.cpp",
36  "process_dumper.cpp",
37]
38
39if (defined(ohos_lite)) {
40  source_set("process_info_src") {
41    cflags = []
42
43    defines = [
44      "HAVE_CONFIG_H",
45      "HAVE_ELF_H",
46      "HAVE_LINK_H",
47    ]
48
49    visibility = [ "*:*" ]
50
51    include_dirs = [
52      ".",
53      "$c_utils_include_path",
54      "$faultloggerd_frameworks_path/unwinder/include",
55      "$faultloggerd_interfaces_path/common",
56      "$faultloggerd_path/common",
57      "$faultloggerd_path/common/dfxlog",
58      "$faultloggerd_path/common/dfxutil",
59      "$faultloggerd_path/interfaces/innerkits/faultloggerd_client/include",
60      "$faultloggerd_path/interfaces/innerkits/procinfo/include",
61      "$hilog_lite_include_path",
62    ]
63
64    sources = processdump_sources
65
66    deps = [
67      "$faultloggerd_path/common/dfxlog:static_common_log",
68      "$faultloggerd_path/common/dfxutil:dfx_util",
69      "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd",
70      "$faultloggerd_path/interfaces/innerkits/procinfo:libdfx_procinfo",
71      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
72      "//third_party/libunwind:libunwind",
73    ]
74  }
75
76  executable("processdump") {
77    visibility = [ "*:*" ]
78
79    include_dirs = [
80      ".",
81      "$c_utils_include_path",
82      "$faultloggerd_frameworks_path/unwinder/include",
83      "$faultloggerd_interfaces_path/common",
84      "$faultloggerd_path/common",
85      "$faultloggerd_path/common/dfxlog",
86      "$faultloggerd_path/common/dfxutil",
87      "$faultloggerd_path/interfaces/innerkits/faultloggerd_client/include",
88      "$faultloggerd_path/interfaces/innerkits/procinfo/include",
89      "$hilog_lite_include_path",
90    ]
91
92    defines = [
93      "HAVE_CONFIG_H",
94      "HAVE_ELF_H",
95      "HAVE_LINK_H",
96    ]
97
98    sources = processdump_sources
99    sources += [
100      "cppcrash_reporter.cpp",
101      "main.cpp",
102    ]
103
104    deps = [
105      "$faultloggerd_path/common/dfxlog:static_common_log",
106      "$faultloggerd_path/common/dfxutil:dfx_util",
107      "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd",
108      "$faultloggerd_path/interfaces/innerkits/procinfo:libdfx_procinfo",
109      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
110      "//third_party/libunwind:libunwind",
111    ]
112  }
113} else {
114  config("processdump_config") {
115    visibility = [ ":*" ]
116
117    include_dirs = [
118      ".",
119      "$faultloggerd_frameworks_path/unwinder/include",
120      "$faultloggerd_interfaces_path/common",
121      "$faultloggerd_path/common",
122      "$faultloggerd_path/interfaces/innerkits/signal_handler",
123    ]
124
125    cflags_cc = [ "-DRUSTC_DEMANGLE" ]
126  }
127
128  ohos_source_set("process_info_src") {
129    cflags = []
130
131    configs = [
132      ":processdump_config",
133      "$faultloggerd_path/common/build:coverage_flags",
134    ]
135    sources = processdump_sources
136
137    deps = [
138      "$faultloggerd_path/common/dfxlog:static_common_log",
139      "$faultloggerd_path/common/dfxutil:dfx_util",
140      "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd",
141      "$faultloggerd_path/interfaces/innerkits/procinfo:libdfx_procinfo",
142      "//third_party/libunwind:libunwind",
143    ]
144
145    external_deps = [
146      "c_utils:utils",
147      "hilog:libhilog",
148    ]
149
150    part_name = "faultloggerd"
151    subsystem_name = "hiviewdfx"
152  }
153
154  ohos_executable("processdump") {
155    install_enable = true
156    configs = [
157      ":processdump_config",
158      "$faultloggerd_path/common/build:coverage_flags",
159    ]
160    sources = processdump_sources
161    sources += [
162      "cppcrash_reporter.cpp",
163      "main.cpp",
164    ]
165
166    cflags_cc = [ "-DDEBUG_CRASH_LOCAL_HANDLER" ]
167
168    deps = [
169      "$faultloggerd_path/common/dfxlog:static_common_log",
170      "$faultloggerd_path/common/dfxutil:dfx_util",
171      "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd",
172      "$faultloggerd_path/interfaces/innerkits/procinfo:libdfx_procinfo",
173      "$faultloggerd_path/interfaces/innerkits/signal_handler:dfx_local_handler",
174      "//third_party/libunwind:libunwind",
175    ]
176
177    external_deps = [
178      "c_utils:utils",
179      "hilog:libhilog",
180    ]
181
182    install_images = [
183      "system",
184      "updater",
185    ]
186
187    part_name = "faultloggerd"
188    subsystem_name = "hiviewdfx"
189  }
190}
191