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

A method of statically analyzing c++ virtual function calls based on cfg files

A static analysis and virtual function technology, applied in the field of software analysis, can solve the problems of software robustness and security risks, the difficulty of dynamic testing to achieve 100% coverage, and the increase of testing costs, so as to improve the efficiency and accuracy of table building, The effect of improving the accuracy of analysis and improving precision

Active Publication Date: 2017-04-05
西安沃派通信科技有限公司
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

As the scale of software code increases, the running space expands sharply, and dynamic testing is difficult to achieve 100% coverage, leaving hidden dangers for software robustness and security. At the same time, with the increase of test coverage, the cost of testing is also increasing sharply.

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

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0022] In this embodiment, a method for statically analyzing C++ virtual function calls based on the cfg file is implemented based on the G++ compiler of the Linux platform, and taking the 64-bit Linux system GCC4.7.1 as an example, it is to first create new virtual functions of multiple classes The linked list and the virtual function starting position offset linked list of multiple classes. Secondly, when the virtual function is called, according to the dynamic type and static type of the class type pointer, use the new virtual function linked list and the virtual function starting position offset linked list to return the called The name of the virtual function, combined with the parameters of the virtual function, uniquely determines the virtual function to be called. By using the compiler intermediate file class file, create a new virtual function linked list that is completely consistent with the rules of the compiler to create a virtual function table, etc., by recording...

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 method for performing static analysis on C++ virtual function call upon cfg (configuration) files. The method is characterized by comprising the following steps: firstly, creating a multi-class new virtual function chain table and a multi-class virtual function initial position offset chain table; secondly, during the virtual function call, according to the dynamic type information and the static type information of a class-type pointer, returning the names of called virtual functions through the new virtual function chain table and the multi-class virtual function initial position offset chain table; uniquely determining the called virtual functions by combining parameters during the virtual function call. By using class files of compiler intermediate files of a compiler, the new virtual function chain table and the like according with the table creation rule of the compiler; by recording the static type and the dynamic type of the class-type pointer and combining the created new virtual function chain table and the like, information during dynamic operation is accurately acquired during the static analysis, and the called virtual functions are accurately determined, and therefore the accuracy of the static analysis is improved, and the program logic is satisfied more.

Description

technical field [0001] The invention relates to the field of software analysis, in particular to a method for statically analyzing C++ virtual function calls based on cfg files. Background technique [0002] With the progress of the times, the functions of software are becoming more and more complex, and users have higher and higher requirements for software. At the same time, with the development of computer-related technologies, the scale of software has become larger and larger, and the complexity of development has increased dramatically. [0003] With the increase of software scale, in order to ensure the software quality, the testing poses a greater challenge. Especially for special application scenarios such as real-time control, software failure will lead to immeasurable consequences, and the requirements for software reliability are higher. In order to ensure software reliability to the greatest extent, a large number of test software is required. [0004] In sof...

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 Patents(China)
IPC IPC(8): G06F11/36G06F9/45
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