1 /*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 #include <stddef.h>
16 #include <stdint.h>
17
18 #ifndef weak_alias
19 #define weak_alias(old, new) \
20 extern __typeof(old) new __attribute__((__weak__, __alias__(#old)))
21 #endif // !weak_alias
22
__SetAsyncStackCallbackFunc(void * func)23 void __SetAsyncStackCallbackFunc(void* func) {}
24 weak_alias(__SetAsyncStackCallbackFunc, SetAsyncStackCallbackFunc);
25
__DFX_SetAppRunningUniqueId(const char * appRunningId,size_t len)26 int __DFX_SetAppRunningUniqueId(const char* appRunningId, size_t len) { return 0; }
27 weak_alias(__DFX_SetAppRunningUniqueId, DFX_SetAppRunningUniqueId);
28
29 /**
30 * @brief set crash object which is measurement information of crash
31 *
32 * @param type type of object, using enum CrashObjType
33 * @param addr addr of object
34 * @return return crash Object which set up last time
35 */
__DFX_SetCrashObj(uint8_t type,uintptr_t addr)36 uintptr_t __DFX_SetCrashObj(uint8_t type, uintptr_t addr) { return 0; }
37 weak_alias(__DFX_SetCrashObj, DFX_SetCrashObj);
38
39 /**
40 * @brief reset crash object
41 *
42 * @param crashObj return of DFX_SetCrashObj
43 */
__DFX_ResetCrashObj(uintptr_t crashObj)44 void __DFX_ResetCrashObj(uintptr_t crashObj) {}
45 weak_alias(__DFX_ResetCrashObj, DFX_ResetCrashObj);
46
47 /**
48 * @brief set crash log config through HiAppEvent
49 *
50 * @param type type of config attribute, using enum CrashLogConfigType
51 * @param value value of config attribute
52 * @return if succeed return 0, otherwise return -1. The reason for the failure can be found in 'errno'
53 * @warning this interface is non-thread safety and signal safety
54 */
__DFX_SetCrashLogConfig(uint8_t type,uint32_t value)55 int __DFX_SetCrashLogConfig(uint8_t type, uint32_t value) { return 0; }
56 weak_alias(__DFX_SetCrashLogConfig, DFX_SetCrashLogConfig);
57