Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method, device and system for determining function call relationship

A function call relationship and function technology, applied in the computer field, can solve the problem of low accuracy of the return address and achieve the effect of improving accuracy

Inactive Publication Date: 2011-06-29
庞双英
View PDF4 Cites 22 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The values ​​of function parameters and local variables are unpredictable. Once their values ​​are in the code segment, the brute force method considers this a function return address, resulting in low accuracy in determining the return address of the function in the function call relationship.

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
  • Method, device and system for determining function call relationship
  • Method, device and system for determining function call relationship
  • Method, device and system for determining function call relationship

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0039] Such as figure 1 As shown, the embodiment of the present invention provides a method for determining a function call relationship, including:

[0040] 11. Search for instructions from the instruction address of the current code segment of the function to a higher address direction, and obtain the first SP (Stack Pointer, stack pointer) offset value of the function.

[0041] 12. Search for instructions from the instruction address of the code segment to the lower address direction, obtain the second SP offset value of the function, and obtain the offset value of the address storing the return address of the function relative to the stack frame of the function.

[0042] 13. Obtain the SP offset value of the function according to the first SP offset value and the second SP offset value, and when the SP offset value meets the preset requirements, the stack pointer of the function points to the For the stack frame of the function, the return address of the function is obtai...

Embodiment 2

[0126] Such as Figure 7 As shown, the embodiment of the present invention provides an apparatus for determining a function call relationship, including:

[0127] A forward search unit 71, configured to search for instructions from the current code segment instruction address of the function to the high address direction to obtain the first SP offset value of the function;

[0128] The backward search unit 72 is configured to search instructions from the instruction address of the code segment to the lower address direction, obtain the second SP offset value of the function, and obtain the stack frame of the address relative to the function that stores the return address of the function offset value;

[0129] A determining unit 73, configured to obtain the SP offset value of the function according to the first SP offset value and the second SP offset value, and when the SP offset value meets the preset requirements, the stack of the function The pointer points to the stack f...

Embodiment 3

[0160] Such as Figure 12 As shown, the embodiment of the present invention provides a system for determining a function call relationship, including the device 1 for determining a function call relationship provided in the above-mentioned embodiment and the user interface 2 .

[0161] The device for determining the function call relationship is used to receive the user's function call command through the user interface, and trace out the return address and SP value of the function by analyzing the process user state code segment instructions mapped to the memory.

[0162] The device for determining the function call relationship in the embodiment of the present invention and the functions of its constituent parts can be understood based on the above-mentioned device for determining the function call relationship in the embodiment of the present invention, and repeated descriptions are not repeated here.

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 embodiment of the invention relates to a method, device and system for determining the function call relationship. The method comprises the steps: searching an instruction from an instruction address of a current code segment of a function to the high address direction to obtain a first SP (stack pointer) offset of the function; searching an instruction from the instruction address of the code segment to the low address direction to obtain a second SP offset of the function so as to obtain the offset of a stack frame of an address relative function storing a function return address; and obtaining the SP offset of the function according to the first SP offset and the second SP offset, wherein the SP of the function points to the stack frame of the function when the SP offset meets the preset requirement; and the return address of the function can be obtained according to the stack frame and the offset of the function. By tracing the function call relationship in the high address direction and the low address direction, the method can improve the accuracy in tracing the function call relationship.

Description

technical field [0001] The invention relates to the field of computers, in particular to a method, device and system for determining a function calling relationship. Background technique [0002] When the program is abnormal or the program is debugged, the traditional method of tracing the function call relationship is to use the CPU hardware register (such as the frame register) and the stack to complete. Specifically, under the mips architecture (a CPU architecture), the frame register points to the stack frame (Frame Pointer, FP) of the current function, the return address of the current function is stored in the stack, and the address of the return address is stored relative to the stack of the current function The frame offset value is fixed. Then, according to the stack frame and the fixed offset value, the return address of the current function can be read out. In this cycle, the traceability of the function call relationship is completed. [0003] The terms involv...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/30G06F9/34
Inventor 李宁
Owner 庞双英
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products