I am running openSUSE Leap 42.1 in a Vagrant box and while I had to debug a small executable file, I came across a message prompting me to install the glibc-debuginfo-2.19-19.1.x86_64 package.
(gdb) run Starting program: /home/vagrant/hi Missing separate debuginfos, use: zypper install glibc-debuginfo-2.19-19.1.x86_64 Breakpoint 1, 0x0000000000400561 in main ()
I searched for the package and could not find it in the enabled repositories. It didn’t ring in my head that it’s a ‘debug’ related package and it could be in a repository other than the default repos enabled by YaST during install time. openSUSE has several official repositories that are listed on its wiki page.
I added the ‘debug’ repository. You may include the
-f flag to the zypper command to enable autorefresh, I did not since I prefer refresh manually.
zypper ar http://download.opensuse.org/debug/distribution/leap/42.1/repo/oss/ debug-infos
I refreshed the repos and installed the glibc-debuginfo package. However, it installed version 2.19-17.4 while gdb prompted for 2.19-19.1. Running gdb this time continued to prompt the missing glibc-debuginfo package and would complain about checksum errors.
(gdb) run Starting program: /home/vagrant/hi warning: the debug information found in "/usr/lib/debug//lib64/ld-2.19.so.debug" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch). warning: the debug information found in "/usr/lib/debug/lib64/ld-2.19.so.debug" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch). Missing separate debuginfos, use: zypper install glibc-debuginfo-2.19-19.1.x86_64 warning: the debug information found in "/usr/lib/debug//lib64/libc-2.19.so.debug" does not match "/lib64/libc.so.6" (CRC mismatch). warning: the debug information found in "/usr/lib/debug/lib64/libc-2.19.so.debug" does not match "/lib64/libc.so.6" (CRC mismatch).
It happens that debug related latest packages are in the ‘debug updates’ repository which was not present, and thus the package manager didn’t find version 2.19-19.1. I added the repository for Leap 42.1 and upgraded the glibc-debuginfo package. Gdb now runs without complaining.
Thanks to Stephan Kulow for the hints.