|
|
|
Re: Mangled C++ names are printed in the coverage summary report [message #1002223 is a reply to message #1001817] |
Fri, 18 January 2013 08:02 |
Tamas Kleiber Messages: 20 Registered: December 2010 |
Junior Member |
|
|
Hello Xavier,
I found the problem. C++filt required the -n option. This way the output is as follows:
O:\eclipse\eclipse_java>c++filt c++filt.exe --help
Usage: c++filt [options] [mangled names]
Options are:
[-_|--strip-underscore] Ignore first leading underscore (default)
[-n|--no-strip-underscore] Do not ignore a leading underscore
[-p|--no-params] Do not display function arguments
[-i|--no-verbose] Do not show implementation details (if any)
[-t|--types] Also attempt to demangle type encodings
[-s|--format {none,auto,gnu,lucid,arm,hp,edg,gnu-v3,java,gnat}]
[@<file>] Read extra options from <file>
[-h|--help] Display this information
[-v|--version] Show the version information
Demangled names are displayed to stdout.
If a name cannot be demangled it is just echoed to stdout.
If no names are provided on the command line, stdin is read.
Report bugs to <http://www.sourceware.org/bugzilla/>.
O:\eclipse\eclipse_java>c++filt -n _ZN12_GLOBAL__N_126VER_updateVersionInfoFieldENS_16VER_infoFields_eEPh
(anonymous namespace)::VER_updateVersionInfoField((anonymous namespace)::VER_infoFields_e, unsigned char*)
Note that the anonymous or file scope name space is intentional.
[Updated on: Fri, 18 January 2013 08:04] Report message to a moderator
|
|
|
Re: Mangled C++ names are printed in the coverage summary report [message #1004295 is a reply to message #1002223] |
Tue, 22 January 2013 23:42 |
Tamas Kleiber Messages: 20 Registered: December 2010 |
Junior Member |
|
|
I found that in CovManager.java, the following call is made:
name = STSymbolManager.sharedInstance.demangle(binaryObject, name, project);
The demangle() function calls demangleImpl(symbolName, cpu, project) where cpu is identified as "x86".
In demangleImpl() the first code line is this:
CPPFilt cppfilt = getCppFilt(cpu, project);
And getCppFilt() reaches this code snippet:
if (adCppfilt.cppfilt == null) {
try {
adCppfilt.cppfilt = STCPPFiltFactory.getCPPFilt(cpu, project);
} catch (IOException _) {
// TODO: log the error ?;
// Perhaps log the error only once, because
// this method is called many many times...
return null;
}
}
where STCPPFiltFactory.getCPPFilt(cpu, project) throws an exception saying: "java.io.IOException: Cannot run program "c++filt": Launching failed", but this exception is silenced with a TODO.
So at last it turned out that the GCov plugin has some dependencies and actually my mingw is not registered in the system path as it is not allowed to be registered in my work environment that way. So after fixing the tool dependency issue at my end, I reached to this position in demangleImpl():
symbolName = cppfilt.getFunction(symbolName);
Which returns the original mangled names as per the examples above. I think my issue is coming from DefaultBinutilsFactory.java, as class DefaultBinutilsFactory defines the CPPFILT_CMD command simply as "c++filt". So probably the -n command line switch is never applied.
I tried to figure out how to add this -n switch for quick testing as prefix to the function name or as a suffix to CPPFILT_CMD but nothing worked out...
So... as c++filt has two operation modes, cut first underscore (default behavior) and keep first underscore (alternative behavior), would it be possible to perform the c++filt tool invocation twice so that if the default invocation results in the same mangled name which was passed to the demangler function than it tries to demangle the name using the alternate method with the -n switch?
By the way I am using the latest MinGW/GCC distribution on Windows so the mangled names should not be anything fancy unique special abominations...
|
|
|
Powered by
FUDForum. Page generated in 0.03639 seconds