7

Which package has the debug symbols for gcov from the gcc package? I've tried installing gcc-5-dbgsym, but it didn't have the symbols.

Not a duplicate of [1]. As I mentioned I've already enabled the ddebs repositories, and installed the corresponding -dbgsym package. The gcov program is provided by the gcc-5 package as indicated by dpkg -S /usr/bin/gcov-5, but gcc-5-dbgsym does not include debugging symbols for gcov. Where are the debugging symbols for gcov?

[1] How to install debug symbols for installed packages?

Evan
  • 218

1 Answers1

0

I think this is an XY problem.

AFAICT, gcov doesn't have it's own debugging symbols. Research indicates that gcov is a test coverage program utilized along with gcc to analyze your programs to help create more efficient, faster running code and to discover untested parts of your program.

gcov uses two files for profiling. The names of these files are derived from the original object file by substituting the file suffix with either .gcno, or .gcda. The files contain coverage and profile data stored in a platform-independent format. The .gcno files are placed in the same directory as the object file. By default, the .gcda files are also stored in the same directory as the object file, but the GCC -fprofile-dir option may be used to store the .gcda files in a separate directory.

The .gcno notes file is generated when the source file is compiled with the GCC -ftest-coverage option. It contains information to reconstruct the basic block graphs and assign source line numbers to blocks.

The .gcda count data file is generated when a program containing object files built with the GCC -fprofile-arcs option is executed. A separate .gcda file is created for each object file compiled with this option. It contains arc transition counts, value profile counts, and some summary information.

It is not recommended to access the coverage files directly. Consumers should use the intermediate format that is provided by gcov tool via --intermediate-format option.

Unless I'm entirely misunderstanding the intent behind your question, you are looking for GDB: The GNU Project Debugger which is available for all currently supported versions of Ubuntu and may already be installed.

EDIT: Based on your comment you seem to actually be looking for a tutorial on using GDB. There's one available here. I hope this helps you.

Sources: https://gcc.gnu.org/onlinedocs/

Specifically:

https://gcc.gnu.org/onlinedocs/gcc/Gcov-Intro.html

https://gcc.gnu.org/onlinedocs/gcc/Gcov-Data-Files.html#Gcov-Data-Files

the documentation for gdb can be found here

You might also find this useful specifically for this.

Elder Geek
  • 36,023
  • 25
  • 98
  • 183
  • 1
    I'm looking for the debug symbols for gcov itself. When I run gcov I'm getting a segfault and I want to debug that error. i.e. print a back trace and values of some variables using GDB. – Evan May 11 '18 at 12:36
  • Gcov is a c program source. GCC can generate debugging symbols for every C program it compiles. – Evan May 11 '18 at 12:43
  • @Evan Right an X Y problem. At the risk of repeating myself "gcov doesn't have it's own debugging symbols. " – Elder Geek May 11 '18 at 17:59
  • @Evan updated answer – Elder Geek May 11 '18 at 20:45
  • I disagree that it is an X Y problem. I want the debug symbols for gcov, but the dbgsym package doesn't have them. I already know how to use GDB, that's why I want the debug symbols. Ubuntu debug symbols are better than sources because you don't have to issue those extra gdb commands. – Evan May 14 '18 at 12:05
  • @Evan I'm sorry you feel my answer is inadequate. Hopefully someone else will come along and provide you with an answer you feel is acceptable. – Elder Geek May 14 '18 at 17:47
  • @ElderGeek: Why do you find it so hard to believe that someone wants to debug a debugging/analysis tool and consequently needs the debug symbols for that tool? compilers, debuggers and analysis tools are nothing but normal software themselves. – MikeMB May 21 '19 at 17:24
  • @MikeMB As I stated in my answer as far as I can tell, gcov doesn't have it's own debugging symbols. Please feel free to provide a more comprehensive accurate answer. I'm sure the community would appreciate it. – Elder Geek May 24 '19 at 21:57