Blame SOURCES/gdb-gdb-add-index-script.patch

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