aboutdebug.xml 2.1 KB

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