Function call information obtaining method and apparatus, and test device

A technology of function calling and obtaining methods, which is applied in the field of communication and can solve problems such as crashes, technical solutions that cannot be applied to complex projects, and solutions that have not been proposed

Active Publication Date: 2017-05-10
TENCENT TECH (SHENZHEN) CO LTD
View PDF4 Cites 24 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In the actual project, the inventor found that using the above technical solution to record the call of the managed code function will cause occasional crashes, which d

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
  • Function call information obtaining method and apparatus, and test device
  • Function call information obtaining method and apparatus, and test device
  • Function call information obtaining method and apparatus, and test device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0037] According to an embodiment of the present invention, an embodiment of a method for obtaining a function calling situation is provided. As an optional embodiment, the method for obtaining the function call status can be applied to, but not limited to, such as figure 1shown in the application environment. During the process of running the program to be tested on the terminal 100, the test device 102 compiles the managed function to be called in the program to obtain an unmanaged function, and then performs a hook operation on the unmanaged function to obtain the first function call information. The first function call information and the function name of the managed function generate the second function call information, and then output the obtained second function call information, wherein, the unmanaged function is allowed to run directly on the central processing unit CPU, and the hook operation is used to monitor the unmanaged The parameters and return values ​​of th...

Embodiment 2

[0092] According to an embodiment of the present invention, there is also provided a device for obtaining function call information for implementing the above method for obtaining function call information, such as Figure 8 As shown, the device includes:

[0093] 1) compiling unit 80, used for compiling the managed function to be called in the program during the process of running the program to be tested;

[0094] 2) The first determination unit 82 is used to obtain the unmanaged function after compiling the managed function, wherein the unmanaged function is allowed to run directly on the central processing unit CPU;

[0095] 3) The second determining unit 84 is used to perform a hook operation on the unmanaged function to obtain the first function call information, wherein the hook operation is used to monitor the parameters and return values ​​of the unmanaged function at runtime, and the first function call information At least include: function entry time, function exi...

Embodiment 3

[0114] According to an embodiment of the present invention, there is also provided a test device for implementing the method for obtaining the above function call information, such as Figure 11 As shown, the test equipment includes:

[0115] processor 110;

[0116] memory 112 for storing processor-executable instructions;

[0117] Wherein, the processor 110 is configured to compile the managed function to be called in the program during running the program to be tested to obtain an unmanaged function, perform a hook operation on the unmanaged function, and obtain the first function call information, Generate the second function call information according to the first function call information and the function name of the managed function, and then output the second function call information, wherein, the unmanaged function is allowed to run directly on the central processing unit CPU, and the hook operation is used to monitor the unmanaged For the parameters and return valu...

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 function call information obtaining method and apparatus, and a test device. The method comprises the steps of compiling a to-be-called managed function in a program in a process of running the to-be-tested program to obtain a non-managed function; performing hook operation on the non-managed function to obtain first function call information; generating second function call information according to the first function call information and a function name of the managed function; and outputting the obtained second function call information, wherein the non-managed function is allowed to directly run in a CPU, the hook operation is used for monitoring parameters and a return value of the non-managed function in running, and the first function call information at least comprises function entry time, function exit time and a function return value, and the second function call information comprises the function name, function entry time, function exit time and a function return value, having a corresponding relationship, of the managed function. According to the method, the apparatus and the test device, the technical problem of occasional occurrence of crash in related technologies is solved.

Description

technical field [0001] The present invention relates to the communication field, in particular to a method and device for acquiring function call information, and testing equipment. Background technique [0002] A related technology provides a technical solution that can record the calling of managed code functions. Using the Profiler (which can be understood as an analysis tool) function provided by Mono, this function can use the mono_profiler_install_enter_leave interface provided by Mono to register two functions. These two registered callback functions will be called when the function in the managed code enters and exits respectively. Mono will provide a custom data structure for these two callback functions to store the data that may be needed. Provide a parameter, through which the function that the managed code calls this time can be obtained. After the interface is registered, use the mono_profiler_set_events interface provided by Mono to set the MONO_PROFILER_ENTE...

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): G06F11/36
CPCG06F11/3612G06F11/3672
Inventor 黄柳优李源纯姜润知王鹏魏学峰
Owner TENCENT TECH (SHENZHEN) CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products