8

I try to watch how programs work by running them by the 'Qt Creator' debugger. For better orientation I'd like to see also the system (core) utilities fully in the call stack window as I am used from the MS Visual Studio 6.0, not only to see their assembly code. For the utilities, the 'Qt Creator' debugger displays only that their debug symbols are not available. (Sometimes, the system generates bug reports for its developers; the bug report dialog has requested installing such symbols only for a particular program.) How can I get the core debug symbols? (Without translating the whole Ubuntu version. I use the 'Update Manager' to install updates regularly. My

/sys/kernel/debug/x86
directory contains only one empty file. I have not found it in the 'Ubuntu software center' nor do I see if some of the packages at the http://packages.ubuntu.com/precise/x11/ is what I seek.) Thanks!

  • 1
    See this page. – saiarcot895 Jun 23 '14 at 16:42
  • @saiarcot895 It works, please formulate your comment as an answer so that I can set it as an accepted one. Where are the debug symbols placed in my filesystem? Thanks! – Tomáš Pečený Jun 24 '14 at 8:57
8

Packages in Ubuntu have their debugging symbols stored in a separate repo. To download these debugging symbols, run (copy and paste):

printf "deb http://ddebs.ubuntu.com %s main restricted universe multiverse\n" $(lsb_release -cs){,-updates,-security,-proposed} | \
 sudo tee -a /etc/apt/sources.list.d/ddebs.list

to add the repo links into /etc/apt/sources.list.d/ddebs.list (This makes it easier to remove the repo). Alternatively, you can also copy each of the deb links into Software Sources and add them from there (Note that you'll likely need to replace $(lsb_release -cs) with the Ubuntu release that you're running).

To download the debugging symbols for package, you can just install package-dbgsym or, in some cases, package-dbg. Note that packages from a PPA don't have debugging symbols available from repos, and that it's the maintainer's responsibility to provide a package that contains the debugging symbols, usually in a package named package-dbg.

Debugging symbols are installed in /usr/lib/debug, although gdb automatically reads in debugging symbols if available and that you don't manually need to specify a location to look in. Depending on the Debhelper Compatibility version of the package, debugging symbols may either be located in a folder with the name of the build ID located inside .build-id (>= 9), or may be located relative to where the executable would be installed (< 9). For example, if you were looking for the location of the debugging symbols for /usr/bin/zip, and the version is less than 9, it would be in /usr/lib/debug/usr/bin/zip.

To remove all debugging symbols and the repo, run sudo apt-get remove \.*-dbgsym to remove all -dbgsym packages, and sudo rm /etc/apt/sources.list.d/ddebs.list to remove the debugging symbols repo.

5

Adding to saircot859's answer. You also have to install the GPG key for the repositories as described here: https://wiki.ubuntu.com/Debug%20Symbol%20Packages

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 428D7C01 C8CAB6595FDFF622
2

Adding to Evans answer: On Ubuntu 18.04 and later you use the command

sudo apt install ubuntu-dbgsym-keyring

to install the GPG keys. (According to https://wiki.ubuntu.com/Debug%20Symbol%20Packages )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.