Source code analysis method based on makefile dependency

An analysis method and source code technology, applied in the field of source code analysis, can solve problems such as object positioning errors, and achieve the effect of ensuring effectiveness and improving accuracy

An analysis method and source code technology, applied in the field of source code analysis, can solve problems such as object positioning errors, and achieve the effect of ensuring effectiveness and improving accuracy

CN106202450AInactive Publication Date: 2016-12-07NANJING UNIV

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Source code analysis method based on makefile dependency
  • Source code analysis method based on makefile dependency
  • Source code analysis method based on makefile dependency

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0035] In order to better understand the technical content of the present invention, specific embodiments are given together with the attached drawings for description as follows.

[0036] figure 1 It is a source code analysis method based on makefile file dependencies in an embodiment of the present invention.

[0037] It includes three phases: dependency extraction phase, source code information extraction phase and object definition lookup phase.

[0038] Step 0 is the initial state of the present invention;

[0039] In the stage of dependent information extraction (step 1-3), step 1 is information conversion, and the makefile is processed to generate an intermediate file that is convenient for processing the information therein;

[0040] Step 2 judges and eliminates redundant information in the intermediate file to improve system memory utilization.

[0041] Step 3 extracts the file dependency information and converts it into a data structure available for query. The fi...

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 provides a source code analysis method based on makefile dependency. The method includes the following steps of 1, a dependency relationship extraction stage; 2, a source code information extraction stage; 3, an object definition search stage. The dependency relationship extraction stage includes the steps of firstly, information conversion, wherein a makefile is processed to obtain a corresponding intermediate file; secondly, redundant information processing, wherein redundant information in the intermediate file is removed; thirdly, dependency information extraction, wherein dependency information is extracted from the intermediate file; fourthly, ending. The source code information extraction stage includes the steps that firstly, source code content is analyzed to obtain source code information; secondly, symbol conversion is carried out, wherein symbols in the source code information are processed; thirdly, an index is established to establish data mapping; fourthly, the process is ended. The object definition search stage includes the steps that firstly, a file search range is confirmed, and a corresponding dependency file list is searched for; secondly, the definition position is confirmed, and the data mapping is searched for symbol information; thirdly, the process is ended. According to the source code analysis method based on makefile dependency, firstly, the file search range is determined, and then symbol definition position information is determined. By defining the file range, the accuracy of symbol definition search in source code analysis is improved to a great extent.

Description

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

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
07 Dec 2016
Publication
CN106202450A