Unlock instant, AI-driven research and patent intelligence for your innovation.

Capacity-limited program stack space depth tracing method

A technology with limited space depth and capacity, applied in the computer field, can solve the problems of insufficient stack space, troublesome, inability to obtain the stack space depth, etc., and achieve good program optimization results.

Active Publication Date: 2021-03-05
JIANGNAN INST OF COMPUTING TECH
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The existing stack space depth calculation method has the following defects: first, the program needs to be recompiled for instrumentation, poor adaptability to legacy code, and needs to be pre-run to obtain the stack space depth, which is cumbersome; second, in the case of limited capacity In this case, the common situation is that the stack space is insufficient. In this case, the program cannot be executed normally due to the overflow of the stack space, and the correct depth of the stack space cannot be obtained; the third is that this technology can only obtain the The flow chart of the call relationship actually occurred in the process, but it is impossible to obtain all the function call relationship diagrams, because some function calls may not be executed in actual operation

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Capacity-limited program stack space depth tracing method
  • Capacity-limited program stack space depth tracing method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0016] Embodiment: a method for tracing the depth of program stack space with limited capacity, comprising the following steps:

[0017] S1. The linker obtains all the function symbol information, establishes the corresponding function information data structure, and forms a function call relationship flowchart between each function through a linked list;

[0018] S2. Install the name of the function, the PC value range, and the depth information of its own stack space into the function information structure established in S1, wherein the depth of its own stack space is retrieved according to the PC value range of each function by analyzing the eh_frame segment corresponding to the function. Locate the corresponding FDE record (Frame Description Entry) to obtain the stack space occupied by each function itself;

[0019] S3. Traverse all the relocation information of the program, determine the function call relationship according to the relocation information, update the linked...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a capacity limited program stack space depth tracing method, which comprises the following steps: S1, establishing a data structure of function information in a linker to forma function call relationship flow chart; s2, acquiring all function symbol information, establishing a corresponding function information data structure, and installing the name of the function, the PC value range and the stack space depth information of the function into the corresponding function information structure; s3, traversing all relocation information of the program, determining a function call relationship according to the relocation information, and updating a linked list pointer of each piece of function information according to an analysis result; and S4, performing depth-firsttraversal on the established function call relation graph, obtaining the stack space depths of the root node functions through accumulation calculation, sorting the stack space depths of all the rootnodes, and outputting the sorted stack space depths of all the root nodes. According to the invention, the stack space information is obtained through a static analysis method, recompilation is not needed, instrumentation does not need to be operated, and the method has a good guiding effect on program analysis, error positioning and program optimization.

Description

technical field [0001] The invention relates to a capacity-constrained program stack space depth tracing method, which belongs to the technical field of computers. Background technique [0002] For some thin processor cores with limited capacity, the depth of the function stack space is the key to affect the performance of the program. Since the stack space is dynamically applied for and used during the running of the program, its actual size is difficult to estimate. The current method of calculating the depth of the program stack space is generally to insert a statistical function that records the stack pointer at the beginning of each function during compilation. During the running of the program, the value change of the stack pointer in the function call process is recorded, so that by calculating the initial stack The difference between the pointer and the stack pointer when the value is the smallest is used to obtain the maximum stack space depth during program runnin...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F8/41
CPCG06F8/41
Inventor 肖谦王飞尉红梅沈莉钱宏管茂林朱琪周文浩
Owner JIANGNAN INST OF COMPUTING TECH