diff options
author | Tom Tromey <tromey@redhat.com> | 2012-11-26 19:23:56 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-11-26 19:23:56 +0000 |
commit | 608e2dbbfefcec9aa3efc863ffcc889786ae93d7 (patch) | |
tree | 864efd0235bc2d56f8be06b71c4b0e058cbdc5eb /gdb/doc | |
parent | 4648e5880ea4bc32689612ccf586b0fb2c9c0884 (diff) | |
download | gdb-608e2dbbfefcec9aa3efc863ffcc889786ae93d7.zip gdb-608e2dbbfefcec9aa3efc863ffcc889786ae93d7.tar.gz gdb-608e2dbbfefcec9aa3efc863ffcc889786ae93d7.tar.bz2 |
2012-11-26 Alexander Larsson <alexl@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
* NEWS: Mention mini debuginfo feature.
* minidebug.c: New file.
* configure.ac: Check for lzma.
* configure, config.in: Rebuild.
* Makefile.in (LIBLZMA): New variable.
(CLIBS): Include LIBLZMA.
(SFILES): Mention minidebug.c.
(COMMON_OBS): Mention minidebug.o.
* symfile.c (read_symbols): New function.
(syms_from_objfile, reread_symbols): Call it.
* symfile.h (find_separate_debug_file_in_section): Declare.
doc
* gdb.texinfo (MiniDebugInfo): New node.
(GDB Files): Update.
testsuite
* gdb.base/gnu-debugdata.exp: New file.
* gdb.base/gnu-debugdata.c: New file.
* lib/gdb.exp (gdb_file_cmd): Handle LZMA warning.
(gdb_unload): Return 0 on success.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 50 |
2 files changed, 55 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 8fda5d5..b594764 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2012-11-26 Tom Tromey <tromey@redhat.com> + + * gdb.texinfo (MiniDebugInfo): New node. + (GDB Files): Update. + 2012-11-16 Doug Evans <dje@google.com> * gdb.texinfo (System-wide configuration): If the system-wide init diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 80148f7..afe3845 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -15865,6 +15865,7 @@ program. To debug a core dump of a previous run, you must also tell @menu * Files:: Commands to specify files * Separate Debug Files:: Debugging information in separate files +* MiniDebugInfo:: Debugging information in a special section * Index Files:: Index files speed up GDB * Symbol Errors:: Errors reading symbol files * Data Files:: GDB data files @@ -16790,6 +16791,55 @@ gnu_debuglink_crc32 (unsigned long crc, @noindent This computation does not apply to the ``build ID'' method. +@node MiniDebugInfo +@section Debugging information in a special section +@cindex separate debug sections +@cindex @samp{.gnu_debugdata} section + +Some systems ship pre-built executables and libraries that have a +special @samp{.gnu_debugdata} section. This feature is called +@dfn{MiniDebugInfo}. This section holds an LZMA-compressed object and +is used to supply extra symbols for backtraces. + +The intent of this section is to provide extra minimal debugging +information for use in simple backtraces. It is not intended to be a +replacement for full separate debugging information (@pxref{Separate +Debug Files}). The example below shows the intended use; however, +@value{GDBN} does not currently put restrictions on what sort of +debugging information might be included in the section. + +@value{GDBN} has support for this extension. If the section exists, +then it is used provided that no other source of debugging information +can be found, and that @value{GDBN} was configured with LZMA support. + +This section can be easily created using @command{objcopy} and other +standard utilities: + +@smallexample +# Extract the dynamic symbols from the main binary, there is no need +# to also have these in the normal symbol table +nm -D @var{binary} --format=posix --defined-only \ + | awk '@{ print $1 @}' | sort > dynsyms + +# Extract all the text (i.e. function) symbols from the debuginfo . +nm @var{binary} --format=posix --defined-only \ + | awk '@{ if ($2 == "T" || $2 == "t") print $1 @}' \ + | sort > funcsyms + +# Keep all the function symbols not already in the dynamic symbol +# table. +comm -13 dynsyms funcsyms > keep_symbols + +# Copy the full debuginfo, keeping only a minimal set of symbols and +# removing some unnecessary sections. +objcopy -S --remove-section .gdb_index --remove-section .comment \ + --keep-symbols=keep_symbols @var{binary} mini_debuginfo + +# Inject the compressed data into the .gnu_debugdata section of the +# original binary. +xz mini_debuginfo +objcopy --add-section .gnu_debugdata=mini_debuginfo.xz @var{binary} +@end smallexample @node Index Files @section Index Files Speed Up @value{GDBN} |