keiths / rpms / gdb

Forked from rpms/gdb 5 months ago
Clone
a8767b3
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
f524ac5
From: Fedora GDB patches <invalid@email.com>
f524ac5
Date: Fri, 27 Oct 2017 21:07:50 +0200
d8c8d57
Subject: gdb-gdb-add-index-script.patch
f524ac5
f637971
;; Provide /usr/bin/gdb-add-index for rpm-build (Tom Tromey).
f637971
;;=push: Re-check against the upstream version.
f524ac5
f637971
http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html
f524ac5
44969d3
Jan Kratochvil: Fixed $d -> $dir.
44969d3
Jan Kratochvil: Remove /dev/null redirection.
44969d3
20f9f67
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
20f9f67
20f9f67
Tom> This patch series adds support for a DWARF index to gdb.
20f9f67
20f9f67
Roland suggested we wrap up the index-creation code into a helper
20f9f67
script.
20f9f67
20f9f67
I'm not sure if this is something people would want in gdb proper, but I
20f9f67
figured I would send it here just in case.
20f9f67
20f9f67
Tom
20f9f67
20f9f67
2010-07-09  Tom Tromey  <tromey@redhat.com>
20f9f67
20f9f67
	* Makefile.in (install-only): Install gdb-add-index.
20f9f67
	* gdb-add-index: New file.
20f9f67
20f9f67
2010-07-09  Tom Tromey  <tromey@redhat.com>
20f9f67
20f9f67
	* gdb.texinfo (Index Files): Mention gdb-add-index.
20f9f67
20f9f67
>From 30714fe719e61baea03d0dc5793eb0d564faebb7 Mon Sep 17 00:00:00 2001
20f9f67
From: Tom Tromey <tromey@redhat.com>
20f9f67
Date: Fri, 9 Jul 2010 11:17:54 -0600
20f9f67
Subject: [PATCH 4/4] add gdb-add-index
20f9f67
Subject: [PATCH 4/4] add gdb-add-index
f637971
f637971
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
f637971
--- a/gdb/Makefile.in
f637971
+++ b/gdb/Makefile.in
ad19172
@@ -1773,6 +1773,15 @@ install-only: install-gstack $(CONFIG_INSTALL)
Jan Kratochvil 2c55a54
 		  $(INSTALL_SCRIPT) gcore \
Jan Kratochvil cf0b61a
 			  $(DESTDIR)$(bindir)/$$transformed_name; \
Jan Kratochvil cf0b61a
 	fi
20f9f67
+	transformed_name=`t='$(program_transform_name)'; \
20f9f67
+			  echo gdb-add-index | sed -e "$$t"` ; \
20f9f67
+		if test "x$$transformed_name" = x; then \
20f9f67
+		  transformed_name=gdb-add-index ; \
20f9f67
+		else \
20f9f67
+		  true ; \
20f9f67
+		fi ; \
Jan Kratochvil 2c55a54
+		$(INSTALL_PROGRAM) $(srcdir)/contrib/gdb-add-index.sh \
20f9f67
+			$(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT)
20f9f67
 	@$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
Jan Kratochvil 254f0e9
 
Jan Kratochvil 2c55a54
 install-strip:
f637971
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
f637971
--- a/gdb/doc/Makefile.in
f637971
+++ b/gdb/doc/Makefile.in
f637971
@@ -174,7 +174,7 @@ POD2MAN5 = pod2man --center="GNU Development Tools" \
f637971
 		   --release="gdb-`sed q version.subst`" --section=5
f637971
 
f637971
 # List of man pages generated from gdb.texi
f637971
-MAN1S = gdb.1 gdbserver.1 gcore.1
f637971
+MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1
f637971
 MAN5S = gdbinit.5
f637971
 MANS = $(MAN1S) $(MAN5S)
f637971
 
f637971
@@ -633,6 +633,13 @@ gcore.1: $(GDB_DOC_FILES)
f637971
 		mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
f637971
 	rm -f gcore.pod
f637971
 
f637971
+gdb-add-index.1: $(GDB_DOC_FILES)
f637971
+	touch $@
f637971
+	-$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
f637971
+	-($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
f637971
+		mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
f637971
+	rm -f gdb-add-index.pod
f637971
+
f637971
 gdbinit.5: $(GDB_DOC_FILES)
f637971
 	touch $@
f637971
 	-$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
f637971
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
f637971
--- a/gdb/doc/gdb.texinfo
f637971
+++ b/gdb/doc/gdb.texinfo
c42f029
@@ -19796,6 +19796,14 @@ There are currently some limitation on indices.  They only work when
20f9f67
 for DWARF debugging information, not stabs.  And, they do not
20f9f67
 currently work for programs using Ada.
20f9f67
 
20f9f67
+@value{GDBN} comes with a program, @command{gdb-add-index}, which can
20f9f67
+be used to add the index to a symbol file.  It takes the symbol file
20f9f67
+as its only argument:
20f9f67
+
20f9f67
+@smallexample
20f9f67
+$ gdb-add-index symfile
20f9f67
+@end smallexample
20f9f67
+
20f9f67
 @node Symbol Errors
20f9f67
 @section Errors Reading Symbol Files
Jan Kratochvil e00e5ea
 
c42f029
@@ -42759,6 +42767,7 @@ switch (die->tag)
Jan Kratochvil cf0b61a
 * gdbserver man::               Remote Server for the GNU Debugger man page
Jan Kratochvil cf0b61a
 * gcore man::                   Generate a core file of a running program
Jan Kratochvil cf0b61a
 * gdbinit man::                 gdbinit scripts
Jan Kratochvil cf0b61a
+* gdb-add-index man::           Add index files to speed up GDB
Jan Kratochvil cf0b61a
 @end menu
Jan Kratochvil cf0b61a
 
Jan Kratochvil cf0b61a
 @node gdb man
c42f029
@@ -43435,6 +43444,54 @@ Richard M. Stallman and Roland H. Pesch, July 1991.
f637971
 @end ifset
f637971
 @c man end
f637971
 
Jan Kratochvil cf0b61a
+@node gdb-add-index man
Jan Kratochvil cf0b61a
+@heading gdb-add-index
Jan Kratochvil cf0b61a
+
Jan Kratochvil cf0b61a
+@c man title gdb-add-index Add index files to speed up GDB
Jan Kratochvil cf0b61a
+
Jan Kratochvil cf0b61a
+@c man begin SYNOPSIS gdb-add-index
Jan Kratochvil cf0b61a
+gdb-add-index @var{filename}
Jan Kratochvil cf0b61a
+@c man end
Jan Kratochvil cf0b61a
+
Jan Kratochvil cf0b61a
+@c man begin DESCRIPTION gdb-add-index
Jan Kratochvil cf0b61a
+When GDB finds a symbol file, it scans the symbols in the file in order
Jan Kratochvil cf0b61a
+to construct an internal symbol table.  This lets most GDB operations
Jan Kratochvil cf0b61a
+work quickly--at the cost of a delay early on.  For large programs,
Jan Kratochvil cf0b61a
+this delay can be quite lengthy, so GDB provides a way to build an
Jan Kratochvil cf0b61a
+index, which speeds up startup.
Jan Kratochvil cf0b61a
+
Jan Kratochvil cf0b61a
+To determine whether a file contains such an index, use the command
Jan Kratochvil cf0b61a
+@command{readelf -S filename}: the index is stored in a section named
Jan Kratochvil cf0b61a
+@code{.gdb_index}.  Note that the index is never generated for files that do
Jan Kratochvil cf0b61a
+not contain DWARF debug information (sections named @code{.debug_*}).
Jan Kratochvil cf0b61a
+
Jan Kratochvil cf0b61a
+See more in
Jan Kratochvil cf0b61a
+@ifset man
Jan Kratochvil cf0b61a
+the @value{GDBN} manual in node @code{Index Files}
Jan Kratochvil cf0b61a
+-- shell command @code{info -f gdb -n 'Index Files'}.
Jan Kratochvil cf0b61a
+@end ifset
Jan Kratochvil cf0b61a
+@ifclear man
Jan Kratochvil cf0b61a
+@ref{Index Files}.
Jan Kratochvil cf0b61a
+@end ifclear
Jan Kratochvil cf0b61a
+@c man end
Jan Kratochvil cf0b61a
+
Jan Kratochvil cf0b61a
+@c man begin SEEALSO gdb-add-index
Jan Kratochvil cf0b61a
+@ifset man
Jan Kratochvil cf0b61a
+The full documentation for @value{GDBN} is maintained as a Texinfo manual.
Jan Kratochvil cf0b61a
+If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo
Jan Kratochvil cf0b61a
+documentation are properly installed at your site, the command
Jan Kratochvil cf0b61a
+
f637971
+@smallexample
f637971
+info gdb
f637971
+@end smallexample
f637971
+
f637971
+should give you access to the complete manual.
f637971
+
f637971
+@cite{Using GDB: A Guide to the GNU Source-Level Debugger},
f637971
+Richard M. Stallman and Roland H. Pesch, July 1991.
f637971
+@end ifset
f637971
+@c man end
f637971
+
f637971
 @include gpl.texi
f637971
 
f637971
 @node GNU Free Documentation License