Do runtime libraries shipped with Sourcery CodeBench include debugging information, or are they stripped? What do I have to do to be able to debug library code?

Question

Do runtime libraries shipped with Sourcery CodeBench include debugging information, or are they stripped? What do I have to do to be able to debug library code?

Answer

Sourcery CodeBench for GNU/Linux targets

Shared libraries, such as GLIBC, that are provided with Sourcery CodeBench for GNU/Linux targets are stripped to include only static symbol table and .debug_frame information. This results in a more compact sysroot installation on the target. Stripping the remaining debug information to further reduce the size of the libraries is not recommended as it can break backtracing through library code and thread debugging, and the space savings are comparatively small.

On GNU/Linux targets, library debug information is available as an add-on to Professional and Standard Edition subscribers. Refer to the section "Installing Add-Ons" in the installation chapter of the Getting Started guide for instructions on downloading add-ons from the Sourcery CodeBench IDE.

To debug library code, you should install both the library debug information add-on for the multilib you are using, and the corresponding library source code add-on. Once you have installed the add-ons, the debugger can load the debug information automatically; no special debugger configuration is necessary.

Sourcery CodeBench for bare-metal targets

On EABI, ELF, and uClinux targets where libraries are statically linked, the libraries provided with Sourcery CodeBench already contain debug information. Library debug information add-ons may contain no additional information, but are provided as a future mechanism of providing additional data for debugging and it is recommended you install them if you want to debug the runtimes.

You may strip your executables after linking, if you wish. On the other hand, if you want to debug library code, most Sourcery CodeBench toolchains for these targets have an available library source code add-on for Professional and Standard Edition subscribers. Follow the instructions in the Getting Started guide to install the add-on. The debugger can then find the installed library source code automatically.

The source code for CSLIBC is not available as part of the library source code add-on. For more information please see: Why don't I have the source to CSLIBC?

The early startup for CS3 is made available as part of the product install, the rest of the source is not available from the library source code add-on. Please contact sourcery_sales@mentor.com to discuss availability.

Note that library source code for open-source components is also provided in the freely-available Sourcery CodeBench source packages. However, the library source code add-ons are prepackaged for use from the debugger and also include additional source files generated automatically during the build process.


This entry was last updated on 8 March 2013.