|
|
7a6771 |
http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html
|
|
|
7a6771 |
Subject: Re: [0/4] RFC: add DWARF index support
|
|
|
7a6771 |
|
|
|
7a6771 |
Jan Kratochvil: Fixed $d -> $dir.
|
|
|
7a6771 |
Jan Kratochvil: Remove /dev/null redirection.
|
|
|
7a6771 |
|
|
|
7a6771 |
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
|
|
|
7a6771 |
|
|
|
7a6771 |
Tom> This patch series adds support for a DWARF index to gdb.
|
|
|
7a6771 |
|
|
|
7a6771 |
Roland suggested we wrap up the index-creation code into a helper
|
|
|
7a6771 |
script.
|
|
|
7a6771 |
|
|
|
7a6771 |
I'm not sure if this is something people would want in gdb proper, but I
|
|
|
7a6771 |
figured I would send it here just in case.
|
|
|
7a6771 |
|
|
|
7a6771 |
Tom
|
|
|
7a6771 |
|
|
|
7a6771 |
2010-07-09 Tom Tromey <tromey@redhat.com>
|
|
|
7a6771 |
|
|
|
7a6771 |
* Makefile.in (install-only): Install gdb-add-index.
|
|
|
7a6771 |
* gdb-add-index: New file.
|
|
|
7a6771 |
|
|
|
7a6771 |
2010-07-09 Tom Tromey <tromey@redhat.com>
|
|
|
7a6771 |
|
|
|
7a6771 |
* gdb.texinfo (Index Files): Mention gdb-add-index.
|
|
|
7a6771 |
|
|
|
7a6771 |
>From 30714fe719e61baea03d0dc5793eb0d564faebb7 Mon Sep 17 00:00:00 2001
|
|
|
7a6771 |
From: Tom Tromey <tromey@redhat.com>
|
|
|
7a6771 |
Date: Fri, 9 Jul 2010 11:17:54 -0600
|
|
|
7a6771 |
Subject: [PATCH 4/4] add gdb-add-index
|
|
|
7a6771 |
Subject: [PATCH 4/4] add gdb-add-index
|
|
|
7a6771 |
|
|
|
7a6771 |
---
|
|
|
7a6771 |
gdb/ChangeLog | 5 +++++
|
|
|
7a6771 |
gdb/Makefile.in | 11 ++++++++++-
|
|
|
7a6771 |
gdb/doc/ChangeLog | 4 ++++
|
|
|
7a6771 |
gdb/doc/gdb.texinfo | 8 ++++++++
|
|
|
7a6771 |
gdb/gdb-add-index | 30 ++++++++++++++++++++++++++++++
|
|
|
7a6771 |
5 files changed, 57 insertions(+), 1 deletions(-)
|
|
|
7a6771 |
create mode 100755 gdb/gdb-add-index
|
|
|
7a6771 |
|
|
|
7a6771 |
Index: gdb-7.6.90.20140127/gdb/Makefile.in
|
|
|
7a6771 |
===================================================================
|
|
|
7a6771 |
--- gdb-7.6.90.20140127.orig/gdb/Makefile.in 2014-02-06 17:37:54.555975958 +0100
|
|
|
7a6771 |
+++ gdb-7.6.90.20140127/gdb/Makefile.in 2014-02-06 17:38:52.110038415 +0100
|
|
|
7a6771 |
@@ -1093,6 +1093,15 @@ install-only: install-gstack $(CONFIG_IN
|
|
|
7a6771 |
$(INSTALL_SCRIPT) gcore \
|
|
|
7a6771 |
$(DESTDIR)$(bindir)/$$transformed_name; \
|
|
|
7a6771 |
fi
|
|
|
7a6771 |
+ transformed_name=`t='$(program_transform_name)'; \
|
|
|
7a6771 |
+ echo gdb-add-index | sed -e "$$t"` ; \
|
|
|
7a6771 |
+ if test "x$$transformed_name" = x; then \
|
|
|
7a6771 |
+ transformed_name=gdb-add-index ; \
|
|
|
7a6771 |
+ else \
|
|
|
7a6771 |
+ true ; \
|
|
|
7a6771 |
+ fi ; \
|
|
|
7a6771 |
+ $(INSTALL_PROGRAM) $(srcdir)/contrib/gdb-add-index.sh \
|
|
|
7a6771 |
+ $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT)
|
|
|
7a6771 |
@$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
|
|
|
7a6771 |
|
|
|
7a6771 |
install-strip:
|
|
|
7a6771 |
Index: gdb-7.6.90.20140127/gdb/doc/gdb.texinfo
|
|
|
7a6771 |
===================================================================
|
|
|
7a6771 |
--- gdb-7.6.90.20140127.orig/gdb/doc/gdb.texinfo 2014-02-06 17:37:50.822971940 +0100
|
|
|
7a6771 |
+++ gdb-7.6.90.20140127/gdb/doc/gdb.texinfo 2014-02-06 17:37:54.565975968 +0100
|
|
|
7a6771 |
@@ -17749,6 +17749,14 @@ There are currently some limitation on i
|
|
|
7a6771 |
for DWARF debugging information, not stabs. And, they do not
|
|
|
7a6771 |
currently work for programs using Ada.
|
|
|
7a6771 |
|
|
|
7a6771 |
+@value{GDBN} comes with a program, @command{gdb-add-index}, which can
|
|
|
7a6771 |
+be used to add the index to a symbol file. It takes the symbol file
|
|
|
7a6771 |
+as its only argument:
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+@smallexample
|
|
|
7a6771 |
+$ gdb-add-index symfile
|
|
|
7a6771 |
+@end smallexample
|
|
|
7a6771 |
+
|
|
|
7a6771 |
@node Symbol Errors
|
|
|
7a6771 |
@section Errors Reading Symbol Files
|
|
|
7a6771 |
|
|
|
7a6771 |
@@ -43878,6 +43886,7 @@ switch (die->tag)
|
|
|
7a6771 |
* gdbserver man:: Remote Server for the GNU Debugger man page
|
|
|
7a6771 |
* gcore man:: Generate a core file of a running program
|
|
|
7a6771 |
* gdbinit man:: gdbinit scripts
|
|
|
7a6771 |
+* gdb-add-index man:: Add index files to speed up GDB
|
|
|
7a6771 |
@end menu
|
|
|
7a6771 |
|
|
|
7a6771 |
@node gdb man
|
|
|
7a6771 |
@@ -44530,6 +44539,54 @@ gdb(1), @code{info -f gdb -n Startup}
|
|
|
7a6771 |
The full documentation for @value{GDBN} is maintained as a Texinfo manual.
|
|
|
7a6771 |
If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo
|
|
|
7a6771 |
documentation are properly installed at your site, the command
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+@smallexample
|
|
|
7a6771 |
+info gdb
|
|
|
7a6771 |
+@end smallexample
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+should give you access to the complete manual.
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+@cite{Using GDB: A Guide to the GNU Source-Level Debugger},
|
|
|
7a6771 |
+Richard M. Stallman and Roland H. Pesch, July 1991.
|
|
|
7a6771 |
+@end ifset
|
|
|
7a6771 |
+@c man end
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+@node gdb-add-index man
|
|
|
7a6771 |
+@heading gdb-add-index
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+@c man title gdb-add-index Add index files to speed up GDB
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+@c man begin SYNOPSIS gdb-add-index
|
|
|
7a6771 |
+gdb-add-index @var{filename}
|
|
|
7a6771 |
+@c man end
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+@c man begin DESCRIPTION gdb-add-index
|
|
|
7a6771 |
+When GDB finds a symbol file, it scans the symbols in the file in order
|
|
|
7a6771 |
+to construct an internal symbol table. This lets most GDB operations
|
|
|
7a6771 |
+work quickly--at the cost of a delay early on. For large programs,
|
|
|
7a6771 |
+this delay can be quite lengthy, so GDB provides a way to build an
|
|
|
7a6771 |
+index, which speeds up startup.
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+To determine whether a file contains such an index, use the command
|
|
|
7a6771 |
+@command{readelf -S filename}: the index is stored in a section named
|
|
|
7a6771 |
+@code{.gdb_index}. Note that the index is never generated for files that do
|
|
|
7a6771 |
+not contain DWARF debug information (sections named @code{.debug_*}).
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+See more in
|
|
|
7a6771 |
+@ifset man
|
|
|
7a6771 |
+the @value{GDBN} manual in node @code{Index Files}
|
|
|
7a6771 |
+-- shell command @code{info -f gdb -n 'Index Files'}.
|
|
|
7a6771 |
+@end ifset
|
|
|
7a6771 |
+@ifclear man
|
|
|
7a6771 |
+@ref{Index Files}.
|
|
|
7a6771 |
+@end ifclear
|
|
|
7a6771 |
+@c man end
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+@c man begin SEEALSO gdb-add-index
|
|
|
7a6771 |
+@ifset man
|
|
|
7a6771 |
+The full documentation for @value{GDBN} is maintained as a Texinfo manual.
|
|
|
7a6771 |
+If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo
|
|
|
7a6771 |
+documentation are properly installed at your site, the command
|
|
|
7a6771 |
|
|
|
7a6771 |
@smallexample
|
|
|
7a6771 |
info gdb
|
|
|
7a6771 |
Index: gdb-7.6.90.20140127/gdb/doc/Makefile.in
|
|
|
7a6771 |
===================================================================
|
|
|
7a6771 |
--- gdb-7.6.90.20140127.orig/gdb/doc/Makefile.in 2014-02-06 17:37:50.824971942 +0100
|
|
|
7a6771 |
+++ gdb-7.6.90.20140127/gdb/doc/Makefile.in 2014-02-06 17:37:54.565975968 +0100
|
|
|
7a6771 |
@@ -165,7 +165,7 @@ POD2MAN5 = pod2man --center="GNU Develop
|
|
|
7a6771 |
--release="gdb-`sed q version.subst`" --section=5
|
|
|
7a6771 |
|
|
|
7a6771 |
# List of man pages generated from gdb.texi
|
|
|
7a6771 |
-MAN1S = gdb.1 gdbserver.1 gcore.1
|
|
|
7a6771 |
+MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1
|
|
|
7a6771 |
MAN5S = gdbinit.5
|
|
|
7a6771 |
MANS = $(MAN1S) $(MAN5S)
|
|
|
7a6771 |
|
|
|
7a6771 |
@@ -590,6 +590,13 @@ gcore.1: $(GDB_DOC_FILES)
|
|
|
7a6771 |
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
|
|
7a6771 |
rm -f gcore.pod
|
|
|
7a6771 |
|
|
|
7a6771 |
+gdb-add-index.1: $(GDB_DOC_FILES)
|
|
|
7a6771 |
+ touch $@
|
|
|
7a6771 |
+ -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
|
|
|
7a6771 |
+ -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
|
|
7a6771 |
+ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
|
|
7a6771 |
+ rm -f gdb-add-index.pod
|
|
|
7a6771 |
+
|
|
|
7a6771 |
gdbinit.5: $(GDB_DOC_FILES)
|
|
|
7a6771 |
touch $@
|
|
|
7a6771 |
-$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
|