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

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