2001-01-24 00:31:17 +00:00
|
|
|
<sect1 id="ch06-aboutdebug">
|
|
|
|
<title>About debugging symbols</title>
|
2001-09-26 01:24:04 +01:00
|
|
|
<?dbhtml filename="aboutdebug.html" dir="chapter06"?>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>Most programs and libraries by default are compiled with debugging
|
2001-08-29 20:29:31 +01:00
|
|
|
symbols (gcc option -g).</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>A program compiled with debugging symbols means a user can run a program
|
|
|
|
or library through a debugger and the debugger's output will be user
|
2001-03-23 03:27:23 +00:00
|
|
|
friendly. These debugging symbols also enlarge the program or library
|
2001-07-22 20:45:10 +01:00
|
|
|
significantly.</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>Before you start wondering whether these debugging symbols really make a
|
2001-03-23 03:27:23 +00:00
|
|
|
big difference, here are some statistics. Use them to draw your own
|
2001-07-22 20:45:10 +01:00
|
|
|
conclusion.</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<listitem><para>A dynamic Bash binary
|
2002-04-19 19:09:37 +01:00
|
|
|
with debugging symbols: 1.2 MB</para></listitem>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<listitem><para>A dynamic Bash binary
|
2002-04-19 19:09:37 +01:00
|
|
|
without debugging symbols: 478 KB</para></listitem>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<listitem><para>/lib and /usr/lib (glibc
|
2002-04-19 19:09:37 +01:00
|
|
|
and gcc files) with debugging symbols: 87 MB</para></listitem>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<listitem><para>/lib and /usr/lib (glibc
|
2002-04-19 19:09:37 +01:00
|
|
|
and gcc files) without debugging symbols: 16 MB</para></listitem>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
|
|
|
</itemizedlist>
|
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>Sizes vary depending on which compiler was used and which C library
|
2001-03-19 16:02:50 +00:00
|
|
|
version was used to link dynamic programs against, but results will be
|
2001-08-29 20:29:31 +01:00
|
|
|
similar if you compare programs with and without debugging symbols.</para>
|
2001-03-23 03:27:23 +00:00
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>To remove debugging symbols from a binary (must be an a.out or ELF
|
2001-10-26 14:55:47 +01:00
|
|
|
binary) run <userinput>strip --strip-debug filename</userinput>. Wildcards
|
2001-03-23 03:27:23 +00:00
|
|
|
can be used to strip debugging symbols from multiple files (use something
|
|
|
|
like <userinput>strip --strip-debug $LFS/usr/bin/*</userinput>).
|
|
|
|
Most people will probably never use a debugger on software, so by
|
2001-07-22 20:45:10 +01:00
|
|
|
removing those symbols a lot of disk space can be regained.</para>
|
2001-01-24 00:31:17 +00:00
|
|
|
|
2001-08-29 20:29:31 +01:00
|
|
|
<para>For your convenience, chapter 9 includes one simple command to strip
|
|
|
|
all debugging symbols from all programs and libraries on your
|
|
|
|
system.</para>
|
|
|
|
|
2001-07-22 20:45:10 +01:00
|
|
|
<para>You might find additional information in the optimization hint which can
|
2002-05-11 14:26:21 +01:00
|
|
|
be found at <ulink url="&hints-root;optimization.txt"/>.</para>
|
2001-04-03 21:27:57 +01:00
|
|
|
|
2001-01-24 00:31:17 +00:00
|
|
|
</sect1>
|
|
|
|
|