How to get actual function names from these results

I use boost test for unit testing and gcov and lcov to measure coverage.

Unfortuanlly genhtml generates such reports to cover functions:

Function coverage

Now I want to know what the _ZN7UtilLib11ProgressBarC2EjdRSo function _ZN7UtilLib11ProgressBarC2EjdRSo .

So far I can not match this function with any interface of the ProgressBar class:

 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 someone help me how to get the best function names using gcov or how to understand these function names.

The application was compiled using gcc4.7 with the following flags: -g -g -save-temps=obj -Wall -Wextra -Wno-unused-parameter -Wno-error=unused-parameter -O0 -pedantic

+8
c ++ gcov
source share
2 answers

These are garbled C ++ characters, use c++filt in the shell to expand it:

 > c++filt _ZN7UtilLib11ProgressBarC2EjdRSo UtilLib::ProgressBar::ProgressBar(unsigned int, double, std::basic_ostream<char, std::char_traits<char> >&) 

Also, since you seem to be using genhtml , check the --demangle-cpp option to automatically --demangle-cpp out for you.

Note that the compiler emits two implementations for ctor that you wrote using --demangle-cpp to hide the difference, which is visible only in the name of the distorted character. To understand what the compiler does, look here .

+14
source share

Use c++filt , for example:

  $c++filt -n _ZN7UtilLib11ProgressBarC2EjdRSo 

which outputs:

  UtilLib::ProgressBar::ProgressBar(unsigned int, double, std::basic_ostream<char, std::char_traits<char> >&) 
+3
source share

All Articles