1 /* 2 * Copyright (c) 2021-2023 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 16 #ifndef DFX_CRASHER_H 17 #define DFX_CRASHER_H 18 19 #include <stdint.h> 20 #include "dfx_test_func.h" 21 22 int RaiseAbort(void); 23 int Abort(void); 24 int RaiseBusError(void); 25 int RaiseFloatingPointException(void); 26 int RaiseIllegalInstructionException(void); 27 int IllegalInstructionException(void); 28 int RaiseSegmentFaultException(void); 29 int SegmentFaultException(void); 30 int RaiseTrapException(void); 31 int CrashTest(void); 32 33 34 void PrintUsage(void); 35 void *DoCrashInThread(void *inputArg); 36 void *SleepThread(void *argv); 37 38 uint64_t DoActionOnSubThread(const char *arg); 39 uint64_t ParseAndDoCrash(const char *arg); 40 int MaxStackDepth(void); 41 42 // 1 2 3 4 5 6 7 43 // 1234567890123456789012345678901234567890123456789012345678901234567890 44 int MaxMethodNameTest12345678901234567890123456789012345678901234567890ABC(void); 45 46 int TriggerSegmentFaultException(void); 47 int TriggerTrapException(void); 48 49 #endif // DFX_CRASHER_H 50