Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I've been looking for a tool to extract exception information from a C++ program. The most wanted feature I'm looking for: I want to know all the exceptions that can be thrown from a function (which would include all the function that is called from that function recursively).
I've always thought that documenting errors and exceptions in particular is very hard (and takes a lot of effort to keep up to date). But if there is some way to automate that, it would be very helpful.
A tool for windows and Visual Studio would be preferred but not necessary, I could always work around that.
PC-Lint claims to do static exception analysis of C++ code.
Coverity is another static C++ code analysis tool that apparently informs you of unhandled exceptions.
AQtime claims to have exception tracing as part of its code analysis. Plus, they advertise Visual Studio integration.
Here is a list of several static code analysis tools.
DISCLAIMER: Working on this tool is my day job.
Its hard for me to write this without it looking like a sales pitch, so I apologise in advance.
As well as other analysis, QA C++ outputs the list of types that are thrown from the body of functions and the call tree. I believe that this would be all the information that you require.
EDoC++ (http://edoc.sourceforge.net) is another alternative.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I have got a c++ software from git.There is no documentation of the code.To understand the code, I need a way to figure out the classes & which functions call the other, preferably in the form of a tree.
I tried with doxygen, but i got only class description. I didnt get function hierarchy. Is it possible to get function hierarchy details using doxygen?
Eclipse (CDT - which is the C++ version) and Visual studio IDEs support building call hierarchies and caller hierarchies for any method you choose.
You can start from the main() and then dive in...
I suppose other IDEs such as CLion also support this.
I am presonally not familiar with a tool that will graph out all the code at once and in any case I think the output of such a full graph would be unreadable.
I suggest you choose an IDE and go from main() and build "call hierarchies" from the methods. Another good method would be to run it with debug and trace through it, then you can choose how deep you can go into the call hierarchies of the methods.
You can use a proper IDE like Microsoft Visual Studio. Here requested link for doxygen. You can clone it from git
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Does anyone know of a free tool, similar to what is built into Visual Studio 2010 for managed code, that can do analysis of unmanaged, MFC C++ code and give metrics (lines of code, dependency or coupling, etc)?
I've been searching on Google for awhile, but really haven't been able to find anything that works. Thanks a ton!
Source Monitor is a good free tool tool for code metrics such as LoC and complexity and also produces kiviat graphs. But it does not have any depedency or coupling metrics.
Our SourceMeter tool can analyze your Visual C++ project and provide you all the information you asked for: metrics (lines of code, dependency, coupling, 60+ metrics altogether). The results are in standard CSV files, which you can easily open in e.g. spreadsheet editors.
I am not sure about free tool but one paid tool which is most comprehensive is IBM's Logiscope http://www-01.ibm.com/software/awdtools/logiscope/
Not free but QA-CPP does metrics like cyclomatic complexity and static analysis.
It's fairly complex to set up but they are pretty good on product support and regularly put out updates.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I have an old DLL that stopped working (log2vis.dll) and I want to look inside it to see what objects it uses.
The DLL was written in C++ (not .NET). Is there a tool that will decompile/disassemble C++ files?
This might be impossible or at least very hard. The DLL's contents don't depend (a lot) on it being written in C++; it's all machine code. That code might have been optimized so a lot of information that was present in the original source code is simply gone.
That said, here is one article that goes through a lot of material about doing this.
Hex-Rays decompiler is probably the best in this field !!!
I think a C++ DLL is a machine code file. Therefore decompiling will only result in assembler code. If you can read that and create C++ from that you're good to go.
There are no decompilers which I know about.
W32dasm is good Win32 disassembler.
There really isn't any way of doing this as most of the useful information is discarded in the compilation process. However, you may want to take a look at this
site to see if you can find some way of extracting something from the DLL.
The closest you will ever get to doing such thing is a dissasembler, or debug info (Log2Vis.pdb).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have a large 95% C, 5% C++ Win32 code base that I am trying to grok.
What modern tools are available for generating call-graph diagrams for C or C++ projects?
Have you tried doxygen and codeviz ?
Doxygen is normally used as a documentation tool, but it can generate call graphs for you with the CALL_GRAPH/CALLER_GRAPH options turned on.
Wikipedia lists a bunch of other options that you can try.
Have you tried SourceInsight's call graph feature?
http://www.sourceinsight.com/docs35/ae1144092.htm
Good old cflow works fine for C. See here for an implementation.
Any decent static analysis tool should have this functionality (as well as all the other stuff that such tools do). Wikipedia has a good list of such tools.
Another group of tools that may be worth checking out are coverage tools. The call graph generated by the coverage tool will contain only the calls that actually take place during a run of the program. Initially this may be more helpful to you than a full call graph. I'm unable to make any suggestions on this for Windows, but for linux projects I highly recommend gcov and lcov.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I have a program in which I've lost the C++ source code. Are there any good C++ decompilers out there?
I've already ran across Boomerang.
You can use IDA Pro by Hex-Rays. You will usually not get good C++ out of a binary unless you compiled in debugging information. Prepare to spend a lot of manual labor reversing the code.
If you didn't strip the binaries there is some hope as IDA Pro can produce C-alike code for you to work with. Usually it is very rough though, at least when I used it a couple of years ago.
information is discarded in the compiling process. Even if a decompiler could produce the logical equivalent code with classes and everything (it probably can't), the self-documenting part is gone in optimized release code. No variable names, no routine names, no class names - just addresses.
Yes, but none of them will manage to produce readable enough code to worth the effort. You will spend more time trying to read the decompiled source with assembler blocks inside, than rewriting your old app from scratch.
I haven't seen any decompilers that generate C++ code. I've seen a few experimental ones that make a reasonable attempt at generating C code, but they tended to be dependent on matching the code-generation patterns of a particular compiler (that may have changed, it's been awhile since I last looked into this). Of course any symbolic information will be gone. Google for "decompiler".
Depending on how large and how well-written the original code was, it might be worth starting again in your favourite language (which might still be C++) and learning from any mistakes made in the last version. Didn't someone once say about writing one to throw away?
n.b. Clearly if this is a huge product, then it may not be worth the time.