Source Code analysis tool under Windows platform

Source: Internet
Author: User
Tags doxygen

Recently this time in reading the source code of the Rtklib, is now the part of the PNTPOS.C file is read, ready to write a document to record the use of these code, processing, theoretical formula source, attention matters, not to understand the place. The current idea is to make each function a business card, the card contains the function of the code description, parameter description, function call diagram, the whole process of processing, considerations and their doubts about the parts. Other functions that appear within this card, including those appearing in text and call graphs, use hyperlinks to link to other function cards. However, I do not want to manually draw the function call diagram, so Baidu a bit, this only found about the interface document, document, function call diagram of these auxiliary development documents have been made by the special software to efficiently, organized to solve these problems.

With regard to the function Call graph, there are different solutions under Linux and Windows platforms, and there are a number of technical documents that can be found in the search. At the moment I'm only using Windows, and here's a look at the right solution in Windows.

1. Generate the call graph directly using the VS-own diagram feature. This is undoubtedly the simplest approach for people who often use vs to develop under the Windows platform. But I did not use this method, as I looked, I feel that the generated code map is not intuitive, some functions will be collapsed; and now I do not intend to use vs to compile Rtklib source code, I have been using notepad++ to edit, read the source.

2. Source insight, good, but in someone else's blog, said in the SI generated call graph, when two functions call the same underlying function, the underlying function will appear in the two function call graph below, so this method is not the fastest to see those often called the underlying function , feeling that the same function appears multiple times in the same picture, it looks redundant and not good.

3.Doxygen+graphviz+htmlhelp, this is what I want to introduce in writing this blog. For details, see "Windows platform Doxygen+graphviz+htmlhelp automatically generated function call diagram" (originally wanted to directly reprint the blog, but also too lazy to contact its author, then set a link to this), the following main write a few I follow this blog operation encountered problems.

1. The given Graphviz download directory is not available, as shown in 1. This problem is not difficult, you go to the official website to download the version of Windows on the line. Here I downloaded version 2, to note that this is not an installation package, can be used directly, so in some cases you need to set the environment variable. For this and Doxygen, it is not necessary, because when you create a new Doxygen project, you need to specify the directory where the Graphviz is located.

Figure 1

Figure 2

2. The generated call graph sometimes contains too many underlying functions, making the entire diagram look messy, as shown in 3. This can be set in Doxygen, with the parameters of two, dot_graph_max_nodes and max_dot_graph_depth, respectively, control the maximum number of nodes in the graph and the node depth, as shown in 4. The node depth defaults to 0, which means that no depth control is available and the user can set the settings themselves. Just need to be aware that the depth should not be too small. For example, the call relationship in Figure 5, when set to a depth of 1 o'clock, C will not be displayed.

Figure 3 The function call graph at max_dot_graph_depth=0

Figure 4

Figure 5

I also today found this magical thing, the source of the analysis tool also said here first. Some time ago in the intention to start reading Rtklib source code when thinking, read the open source codes there is no "black technology", at that time out of laziness did not go to find relevant information, now eat the suffering only to find, can only say "technically lazy, the idea can not be lazy." Do things have predecessors experience and skills, use this way, can really steal to get lazy.

(In the end, I still have to spit up the blog Garden editing interface and display interface, the landscape is too wide, really not as good as the cmd markdown write convenient, beautiful)

Source Code analysis tool under Windows platform

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.