aboutdebug.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-system-aboutdebug">
  7. <title>About debugging symbols</title>
  8. <?dbhtml filename="aboutdebug.html"?>
  9. <para>Most programs and libraries are, by default, compiled with debugging
  10. symbols included (with <command>gcc</command>'s <parameter>-g</parameter>
  11. option). This means that, when debugging a program or library that was compiled
  12. with debugging information included, the debugger can give you not only memory
  13. addresses but also the names of the routines and variables.</para>
  14. <para>The inclusion of these debugging symbols, however, enlarges a program or
  15. library significantly. To get an idea of the amount of space these symbols
  16. occupy, have a look at the following:</para>
  17. <itemizedlist>
  18. <listitem><para>a bash binary
  19. with debugging symbols: 1200 KB</para></listitem>
  20. <listitem><para>a bash binary
  21. without debugging symbols: 480 KB</para></listitem>
  22. <listitem><para>Glibc and GCC files (<filename class="directory">/lib</filename>
  23. and <filename class="directory">/usr/lib</filename>)
  24. with debugging symbols: 87 MB</para></listitem>
  25. <listitem><para>Glibc and GCC files
  26. without debugging symbols: 16 MB</para></listitem>
  27. </itemizedlist>
  28. <para>Sizes may vary somewhat, depending on which compiler was used and which C
  29. library, but when comparing programs with and without debugging symbols the
  30. difference will generally be a factor between 2 and 5.</para>
  31. <para>As most people will probably never use a debugger on their system
  32. software, a lot of disk space can be regained by removing these symbols. For
  33. your convenience, the next section shows how to strip all debugging symbols
  34. from all programs and libraries. Information on other ways of optimizing your
  35. system can be found in the hint at <ulink url="&hints-root;optimization.txt"/>.</para>
  36. </sect1>