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