1 From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
2 From: Fedora GDB patches <invalid@email.com>
3 Date: Fri, 27 Oct 2017 21:07:50 +0200
4 Subject: RFC: add DWARF index support
6 FileName: gdb-gdb-add-index-script.patch
8 ;; Provide /usr/bin/gdb-add-index for rpm-build (Tom Tromey).
9 ;;=push: Re-check against the upstream version.
11 http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html
13 Jan Kratochvil: Fixed $d -> $dir.
14 Jan Kratochvil: Remove /dev/null redirection.
16 >>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
18 Tom> This patch series adds support for a DWARF index to gdb.
20 Roland suggested we wrap up the index-creation code into a helper
23 I'm not sure if this is something people would want in gdb proper, but I
24 figured I would send it here just in case.
28 2010-07-09 Tom Tromey <tromey@redhat.com>
30 * Makefile.in (install-only): Install gdb-add-index.
31 * gdb-add-index: New file.
33 2010-07-09 Tom Tromey <tromey@redhat.com>
35 * gdb.texinfo (Index Files): Mention gdb-add-index.
37 >From 30714fe719e61baea03d0dc5793eb0d564faebb7 Mon Sep 17 00:00:00 2001
38 From: Tom Tromey <tromey@redhat.com>
39 Date: Fri, 9 Jul 2010 11:17:54 -0600
40 Subject: [PATCH 4/4] add gdb-add-index
41 Subject: [PATCH 4/4] add gdb-add-index
43 gdb/Makefile.in | 9 +++++++++
44 gdb/doc/Makefile.in | 9 ++++++++-
45 gdb/doc/gdb.texinfo | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++
46 3 files changed, 74 insertions(+), 1 deletion(-)
48 diff --git a/gdb/Makefile.in b/gdb/Makefile.in
49 index e77d6a5c03..3142ad6af1 100644
52 @@ -1770,6 +1770,15 @@ install-only: install-gstack $(CONFIG_INSTALL)
53 $(INSTALL_SCRIPT) gcore \
54 $(DESTDIR)$(bindir)/$$transformed_name; \
56 + transformed_name=`t='$(program_transform_name)'; \
57 + echo gdb-add-index | sed -e "$$t"` ; \
58 + if test "x$$transformed_name" = x; then \
59 + transformed_name=gdb-add-index ; \
63 + $(INSTALL_PROGRAM) $(srcdir)/contrib/gdb-add-index.sh \
64 + $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT)
65 @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
68 diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
69 index eafadee899..0323bc4ecb 100644
70 --- a/gdb/doc/Makefile.in
71 +++ b/gdb/doc/Makefile.in
72 @@ -174,7 +174,7 @@ POD2MAN5 = pod2man --center="GNU Development Tools" \
73 --release="gdb-`sed q version.subst`" --section=5
75 # List of man pages generated from gdb.texi
76 -MAN1S = gdb.1 gdbserver.1 gcore.1
77 +MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1
79 MANS = $(MAN1S) $(MAN5S)
81 @@ -633,6 +633,13 @@ gcore.1: $(GDB_DOC_FILES)
82 mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
85 +gdb-add-index.1: $(GDB_DOC_FILES)
87 + -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
88 + -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
89 + mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
90 + rm -f gdb-add-index.pod
92 gdbinit.5: $(GDB_DOC_FILES)
94 -$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
95 diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
96 index 2f2cbd3dea..7b99ae1551 100644
97 --- a/gdb/doc/gdb.texinfo
98 +++ b/gdb/doc/gdb.texinfo
99 @@ -19796,6 +19796,14 @@ There are currently some limitation on indices. They only work when
100 for DWARF debugging information, not stabs. And, they do not
101 currently work for programs using Ada.
103 +@value{GDBN} comes with a program, @command{gdb-add-index}, which can
104 +be used to add the index to a symbol file. It takes the symbol file
105 +as its only argument:
108 +$ gdb-add-index symfile
112 @section Errors Reading Symbol Files
114 @@ -42759,6 +42767,7 @@ switch (die->tag)
115 * gdbserver man:: Remote Server for the GNU Debugger man page
116 * gcore man:: Generate a core file of a running program
117 * gdbinit man:: gdbinit scripts
118 +* gdb-add-index man:: Add index files to speed up GDB
122 @@ -43435,6 +43444,54 @@ Richard M. Stallman and Roland H. Pesch, July 1991.
126 +@node gdb-add-index man
127 +@heading gdb-add-index
129 +@c man title gdb-add-index Add index files to speed up GDB
131 +@c man begin SYNOPSIS gdb-add-index
132 +gdb-add-index @var{filename}
135 +@c man begin DESCRIPTION gdb-add-index
136 +When GDB finds a symbol file, it scans the symbols in the file in order
137 +to construct an internal symbol table. This lets most GDB operations
138 +work quickly--at the cost of a delay early on. For large programs,
139 +this delay can be quite lengthy, so GDB provides a way to build an
140 +index, which speeds up startup.
142 +To determine whether a file contains such an index, use the command
143 +@command{readelf -S filename}: the index is stored in a section named
144 +@code{.gdb_index}. Note that the index is never generated for files that do
145 +not contain DWARF debug information (sections named @code{.debug_*}).
149 +the @value{GDBN} manual in node @code{Index Files}
150 +-- shell command @code{info -f gdb -n 'Index Files'}.
157 +@c man begin SEEALSO gdb-add-index
159 +The full documentation for @value{GDBN} is maintained as a Texinfo manual.
160 +If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo
161 +documentation are properly installed at your site, the command
167 +should give you access to the complete manual.
169 +@cite{Using GDB: A Guide to the GNU Source-Level Debugger},
170 +Richard M. Stallman and Roland H. Pesch, July 1991.
176 @node GNU Free Documentation License