Install and generate docs for gdb-add-index
authorSergio Durigan Junior <sergiodj@redhat.com>
Thu, 11 Jan 2018 21:12:05 +0000 (16:12 -0500)
committerSergio Durigan Junior <sergiodj@redhat.com>
Fri, 12 Jan 2018 20:29:06 +0000 (15:29 -0500)
The "gdb-add-index" script has been resurrected on:

  commit caf26be91a584ef141ac5d3cb31007731af8b8e3
  Author: Samuel Bronson <naesten@gmail.com>
  Date:   Fri Nov 15 16:09:33 2013 -0500

      Resurrect gdb-add-index as a contrib script

However, for some reason (I couldn't find it in the archives), only
the script has been checked-in; the Makefile parts responsible for
installing it in the system were left out.  This commit fixes that, by
also resurrecting the Makefile and documentation bits.

This commit is part of our effort to upstream the local Fedora GDB
changes.  With this commit, we'll only carry a very small
Fedora-specific modification to the script.

gdb/ChangeLog:
2017-01-12  Tom Tromey  <tom@tromey.com>
    Sergio Durigan Junior  <sergiodj@redhat.com>

* Makefile.in (install-only): Install gdb-add-index.

gdb/doc/ChangeLog:
2017-01-12  Tom Tromey  <tom@tromey.com>
    Sergio Durigan Junior  <sergiodj@redhat.com>

* gdb.texinfo (Index Files): Mention gdb-add-index.
(gdb-add-index man): New section.
* Makefile.in (gdb-add-index.1): New rule to generate manpage
from gdb.texinfo.

gdb/ChangeLog
gdb/Makefile.in
gdb/doc/ChangeLog
gdb/doc/Makefile.in
gdb/doc/gdb.texinfo

index 1c52f5f17b798265a036079e24d3e5326d9a0087..284245ed8c61761729bee45ea4680eb000d4bc44 100644 (file)
@@ -1,3 +1,8 @@
+2017-01-12  Tom Tromey  <tom@tromey.com>
+           Sergio Durigan Junior  <sergiodj@redhat.com>
+
+       * Makefile.in (install-only): Install gdb-add-index.
+
 2018-01-12  John Baldwin  <jhb@FreeBSD.org>
 
        * fbsd-tdep.c (KVE_PROTECTION): Correct value.
index 17b71c6e7c63fa782ee1d69a3dccfe1534fb249b..0a4a06b242e0423218648fe77d53fc192456cd2f 100644 (file)
@@ -1770,6 +1770,15 @@ install-only: $(CONFIG_INSTALL)
                  $(INSTALL_SCRIPT) gcore \
                          $(DESTDIR)$(bindir)/$$transformed_name; \
        fi
+       transformed_name=`t='$(program_transform_name)'; \
+                         echo gdb-add-index | sed -e "$$t"` ; \
+       if test "x$$transformed_name" = x; then \
+         transformed_name=gdb-add-index ; \
+       else \
+         true ; \
+       fi ; \
+       $(INSTALL_PROGRAM) $(srcdir)/contrib/gdb-add-index.sh \
+               $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT)
        @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
 
 install-strip:
index 76ce904635830f3ecfde2837c4c9108402daceb3..fe8aa5a15f923c63ae50d4dbd8d48a804945c7ca 100644 (file)
@@ -1,3 +1,11 @@
+2017-01-12  Tom Tromey  <tom@tromey.com>
+           Sergio Durigan Junior  <sergiodj@redhat.com>
+
+       * gdb.texinfo (Index Files): Mention gdb-add-index.
+       (gdb-add-index man): New section.
+       * Makefile.in (gdb-add-index.1): New rule to generate manpage
+       from gdb.texinfo.
+
 2018-01-11  Szabolcs Nagy  <szabolcs.nagy@arm.com>
 
        * gdb.texinfo (pwd): Fix whitespace.
index eafadee899ea5a458d44138985da4bea418ea741..0323bc4ecbc65a092b9b8e8799940fe9142fd8b8 100644 (file)
@@ -174,7 +174,7 @@ POD2MAN5 = pod2man --center="GNU Development Tools" \
                   --release="gdb-`sed q version.subst`" --section=5
 
 # List of man pages generated from gdb.texi
-MAN1S = gdb.1 gdbserver.1 gcore.1
+MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1
 MAN5S = gdbinit.5
 MANS = $(MAN1S) $(MAN5S)
 
@@ -633,6 +633,13 @@ gcore.1: $(GDB_DOC_FILES)
                mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
        rm -f gcore.pod
 
+gdb-add-index.1: $(GDB_DOC_FILES)
+       touch $@
+       -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
+       -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
+               mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
+       rm -f gdb-add-index.pod
+
 gdbinit.5: $(GDB_DOC_FILES)
        touch $@
        -$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
index dba2fa766ab2162f593eea9ea6ef7559f0e7bd3d..b6e7a4975e57dd0328eabdeb675f5e9d0938db8a 100644 (file)
@@ -19712,6 +19712,19 @@ on.  For large programs, this delay can be quite lengthy, so
 @value{GDBN} provides a way to build an index, which speeds up
 startup.
 
+For convenience, @value{GDBN} comes with a program,
+@command{gdb-add-index}, which can be used to add the index to a
+symbol file.  It takes the symbol file as its only argument:
+
+@smallexample
+$ gdb-add-index symfile
+@end smallexample
+
+@xref{gdb-add-index}.
+
+It is also possible to do the work manually.  Here is what
+@command{gdb-add-index} does behind the curtains.
+
 The index is stored as a section in the symbol file.  @value{GDBN} can
 write the index to a file, then you can put it into the symbol file
 using @command{objcopy}.
@@ -42750,6 +42763,7 @@ switch (die->tag)
 * gdbserver man::               Remote Server for the GNU Debugger man page
 * gcore man::                   Generate a core file of a running program
 * gdbinit man::                 gdbinit scripts
+* gdb-add-index man::           Add index files to speed up GDB
 @end menu
 
 @node gdb man
@@ -43426,6 +43440,62 @@ Richard M. Stallman and Roland H. Pesch, July 1991.
 @end ifset
 @c man end
 
+@node gdb-add-index man
+@pindex gdb-add-index
+@anchor{gdb-add-index}
+@heading gdb-add-index
+
+@c man title gdb-add-index Add index files to speed up GDB
+
+@c man begin SYNOPSIS gdb-add-index
+gdb-add-index @var{filename}
+@c man end
+
+@c man begin DESCRIPTION gdb-add-index
+When @value{GDBN} finds a symbol file, it scans the symbols in the
+file in order to construct an internal symbol table.  This lets most
+@value{GDBN} operations work quickly--at the cost of a delay early on.
+For large programs, this delay can be quite lengthy, so @value{GDBN}
+provides a way to build an index, which speeds up startup.
+
+To determine whether a file contains such an index, use the command
+@kbd{readelf -S filename}: the index is stored in a section named
+@code{.gdb_index}.  The index file can only be produced on systems
+which use ELF binaries and DWARF debug information (i.e., sections
+named @code{.debug_*}).
+
+@command{gdb-add-index} uses @value{GDBN} and @command{objdump} found
+in the @env{PATH} environment variable.  If you want to use different
+versions of these programs, you can specify them through the
+@env{GDB} and @env{OBJDUMP} environment variables.
+
+See more in
+@ifset man
+the @value{GDBN} manual in node @code{Index Files}
+-- shell command @kbd{info -f gdb -n "Index Files"}.
+@end ifset
+@ifclear man
+@ref{Index Files}.
+@end ifclear
+@c man end
+
+@c man begin SEEALSO gdb-add-index
+@ifset man
+The full documentation for @value{GDBN} is maintained as a Texinfo manual.
+If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo
+documentation are properly installed at your site, the command
+
+@smallexample
+info gdb
+@end smallexample
+
+should give you access to the complete manual.
+
+@cite{Using GDB: A Guide to the GNU Source-Level Debugger},
+Richard M. Stallman and Roland H. Pesch, July 1991.
+@end ifset
+@c man end
+
 @include gpl.texi
 
 @node GNU Free Documentation License
This page took 0.048434 seconds and 4 git commands to generate.