caolanm / callcatcher Goto Github PK
View Code? Open in Web Editor NEWfind unused code by collecting methods defined but not called or referenced
Home Page: http://www.skynet.ie/~caolan/Packages/callcatcher.html
find unused code by collecting methods defined but not called or referenced
Home Page: http://www.skynet.ie/~caolan/Packages/callcatcher.html
callanalyse relies on a fixed paths under /tmp : analyse this, analyse that, and doesn't clean up after itself. This breaks concurrent runs (on different projects), or if different users run it - permission denied errors result.
Suggest changing the actual run code to something like:
tmpdir = tempfile.mkdtemp()
callcatcher.combine.combine(tmpdir + os.path.sep, inputs)
callcatcher.analyse.analyse(tmpdir + os.path.sep, "", strict, detailed, LibO, mapfile)
shutil.rmtree(tmpdir)
and add corresponding imports obviously.
When calling callcatcher on the following cpp file, I'm getting the Broken pipe error:
#include <variant>
#include <string>std::variant<std::string, int> _variantWithString;
Steps to reproduce:
Result:
callcatcher - detecting compiling:
collecting test.o
'g++' '-c' '-std=c++17' 'test.cpp' '-o' '/login/myuser/.callcatcher/login/myuser/test.o' '-O0' '-S'
Traceback (most recent call last):
File "/login/myuser/opt/bin/callcatcher", line 13, in
callcatcher.compile(args)
File "/login/myuser/opt/lib/python3.9/site-packages/callcatcher/init.py", line 108, in compile
aDefines.collect(filename)
File "/login/myuser/opt/lib/python3.9/site-packages/callcatcher/defines.py", line 48, in collect
realname = aLookup.lookup(name)
File "/login/myuser/opt/lib/python3.9/site-packages/callcatcher/lookup.py", line 51, in lookup
self.filtin1.flush()
BrokenPipeError: [Errno 32] Broken pipe
Exception ignored in: <function Lookup.del at 0x7f57623d5040>
Traceback (most recent call last):
File "/login/myuser/opt/lib/python3.9/site-packages/callcatcher/lookup.py", line 67, in del
self.filtin1.close()
BrokenPipeError: [Errno 32] Broken pipe
Expected result:
callcatcher - detecting compiling:
collecting test.o
'g++' '-c' '-std=c++17' 'test.cpp' '-o' '/login/myuser/.callcatcher/login/myuser/test.o' '-O0' '-S'
0 methods (0 virtual)
recently, I've been working on callcatcher
for our really large Cpp project, total number of ninjia jobs is up to ~10k.
We use response file to avoid command-line-length issue, callcatcher
can expand response file to fix this.
When attempting to use callanalyse, the following errors are produced:
$ callanalyse mybinary
/usr/lib/python2.6/site-packages/callcatcher/lookup.py:42: DeprecationWarning: os.popen2 is deprecated. Use the subprocess module.
self.filtin1, self.filtout1 = os.popen2('c++filt --no-strip-underscore', 'rw')
/usr/lib/python2.6/site-packages/callcatcher/lookup.py:43: DeprecationWarning: os.popen2 is deprecated. Use the subprocess module.
self.filtin2, self.filtout2 = os.popen2('c++filt --strip-underscore', 'rw')
Python version 2.6.6. Probably not relevant, but the binary was compiled with GCC 4.4.7. System info: CentOS 6.4, Linux 3.11.6-x86_64.
The documentation currently states that it should suffice to set:
export CC="callcatcher gcc"
export CXX="callcatcher g++"
export AR="callarchive ar"
While this seems to work for autotools based projects, trying this on a cmake based project just gives the following error:
CMake Error at CMakeLists.txt:2 (project):
The CMAKE_C_COMPILER:
callcatcher gcc
is not a full path to an existing compiler tool.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.