The application discloses a
stack overflow elimination method based on intelligent calculation of a task stack on a spaceborne computer, and is used for solving the program safety problem caused by
stack overflow of a spaceborne electronic
system, and also improves the
utilization rate of spaceborne storage resources because the stack memory can be accurately allocated.The application is based on the instructions of using stack space such as function calling and stack pressing of a Cortex-M7 core and the specific process of function calling in the Cortex-M7 core, and uses a cross-
compiler tool chain to disassemble an ELF file to generate a
text file, uses C language on a clion platform to track the instruction flow in the disassembled text, analyzes the positioning points of function calling relations, analyzes the required task stack size of each level function by using the recursive thought, and thus the required function stack space of a specified task function is obtained.The application can effectively give all function calling relations of a specified function and the corresponding actually occupied stack space size, is an effective and convenient memory resource optimization auxiliary tool, and will produce good effects in practical application.