I use boost test for unit testing and gcov and lcov for measuring the coverage.
Unfortuanlly genhtml generates reports like that for function coverage:
I now want to know what the function _ZN7UtilLib11ProgressBarC2EjdRSo
actually is.
So far I can not correlate this function to any of the class interface of ProgressBar:
class ProgressBar {
public:
explicit ProgressBar(
unsigned int expected_count,
double updateInterval = 30,
std::ostream& os = std::cout);
unsigned int operator+=(unsigned int increment);
unsigned int operator++();
unsigned int operator++(int i);
}
Can any one help me how to either get better function names with gcov or how does one understand these function names.
The application is compiled with gcc4.7 with the following flags:-g -g -save-temps=obj -Wall -Wextra -Wno-unused-parameter -Wno-error=unused-parameter -O0 -pedantic
These are mangled C++ symbols, use c++filt
in a shell to demangle it:
> c++filt _ZN7UtilLib11ProgressBarC2EjdRSo
UtilLib::ProgressBar::ProgressBar(unsigned int, double, std::basic_ostream<char, std::char_traits<char> >&)
Also, since you seem to use genhtml
, check out the --demangle-cpp
option to do the demangling automatically for you.
Note that the compiler emits two implementations for the ctor you wrote, using --demangle-cpp
will hide the difference which is visible only in the mangled symbol name. To understand what the compiler is doing, have a look here.
Use c++filt
, like this:
$c++filt -n _ZN7UtilLib11ProgressBarC2EjdRSo
which outputs:
UtilLib::ProgressBar::ProgressBar(unsigned int, double, std::basic_ostream<char, std::char_traits<char> >&)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With