PDA

View Full Version : Dead method and data identifier



RolandHughes
15th May 2013, 17:49
Back in the day there used to be a commercial product (I believe it was called "The C/C++ Programmer's ToolBox" under DOS). It had a lot of useful stuff in it. As I recall, it used to have a coverage analyzer. You would add their header and library to your build, then execute your code. When it exited the library would continue to churn for some length of time and out would pop a list of every function/method executed along with every variable which was touched. The report was really useful when it came to identifying dead code and dead variables.

I'm asking because I'm currently on a project which has, oh a three digit number of source and header files that have been generated by multiple people over the years this project carried on. It is all C++ and Qt. I would really like to find some form of that tool on Linux, preferrably open source, which could perform this same function. We have plenty of "college kids" to do the searches based upon the header files once we have the report.

Has anybody found such a C++ Qt Linux tool?

anda_skoa
15th May 2013, 23:33
My reflex would have assume that this is being covered by valgrind, so I searched a bit. Maybe one of those will do what you need:
http://www.brainmurders.eclipse.co.uk/covergrind.html
http://benjamin-meyer.blogspot.co.at/2007/12/valgrind-callgrind-tools-part-3-code.html

Also, a lot of recent analysis tools are built upon LLVM, e.g. as plugins for clang. Might be worth researching into

Cheers,
_

ChrisW67
16th May 2013, 04:24
Also look at gcov (http://gcc.gnu.org/onlinedocs/gcc/Gcov.html#Gcov)