]>
Commit | Line | Data |
---|---|---|
4b0e5c1b AM |
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 | |
5 | ||
6 | FileName: gdb-gdb-add-index-script.patch | |
7 | ||
8 | ;; Provide /usr/bin/gdb-add-index for rpm-build (Tom Tromey). | |
9 | ;;=push: Re-check against the upstream version. | |
10 | ||
969912f7 | 11 | http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html |
969912f7 JR |
12 | |
13 | Jan Kratochvil: Fixed $d -> $dir. | |
14 | Jan Kratochvil: Remove /dev/null redirection. | |
15 | ||
16 | >>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes: | |
17 | ||
18 | Tom> This patch series adds support for a DWARF index to gdb. | |
19 | ||
20 | Roland suggested we wrap up the index-creation code into a helper | |
21 | script. | |
22 | ||
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. | |
25 | ||
26 | Tom | |
27 | ||
28 | 2010-07-09 Tom Tromey <tromey@redhat.com> | |
29 | ||
30 | * Makefile.in (install-only): Install gdb-add-index. | |
31 | * gdb-add-index: New file. | |
32 | ||
33 | 2010-07-09 Tom Tromey <tromey@redhat.com> | |
34 | ||
35 | * gdb.texinfo (Index Files): Mention gdb-add-index. | |
36 | ||
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 | |
969912f7 | 42 | --- |
4b0e5c1b AM |
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(-) | |
47 | ||
48 | diff --git a/gdb/Makefile.in b/gdb/Makefile.in | |
49 | index e77d6a5c03..3142ad6af1 100644 | |
50 | --- a/gdb/Makefile.in | |
51 | +++ b/gdb/Makefile.in | |
52 | @@ -1770,6 +1770,15 @@ install-only: install-gstack $(CONFIG_INSTALL) | |
321e94d6 BS |
53 | $(INSTALL_SCRIPT) gcore \ |
54 | $(DESTDIR)$(bindir)/$$transformed_name; \ | |
55 | fi | |
969912f7 JR |
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 ; \ | |
60 | + else \ | |
61 | + true ; \ | |
62 | + fi ; \ | |
f727df28 KK |
63 | + $(INSTALL_PROGRAM) $(srcdir)/contrib/gdb-add-index.sh \ |
64 | + $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) | |
969912f7 JR |
65 | @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do |
66 | ||
321e94d6 | 67 | install-strip: |
4b0e5c1b AM |
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 | |
74 | ||
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 | |
78 | MAN5S = gdbinit.5 | |
79 | MANS = $(MAN1S) $(MAN5S) | |
80 | ||
81 | @@ -633,6 +633,13 @@ gcore.1: $(GDB_DOC_FILES) | |
82 | mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) | |
83 | rm -f gcore.pod | |
84 | ||
85 | +gdb-add-index.1: $(GDB_DOC_FILES) | |
86 | + touch $@ | |
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 | |
91 | + | |
92 | gdbinit.5: $(GDB_DOC_FILES) | |
93 | touch $@ | |
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 | |
969912f7 JR |
100 | for DWARF debugging information, not stabs. And, they do not |
101 | currently work for programs using Ada. | |
102 | ||
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: | |
106 | + | |
107 | +@smallexample | |
108 | +$ gdb-add-index symfile | |
109 | +@end smallexample | |
110 | + | |
111 | @node Symbol Errors | |
112 | @section Errors Reading Symbol Files | |
113 | ||
4b0e5c1b | 114 | @@ -42759,6 +42767,7 @@ switch (die->tag) |
f727df28 KK |
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 | |
119 | @end menu | |
120 | ||
121 | @node gdb man | |
4b0e5c1b AM |
122 | @@ -43435,6 +43444,54 @@ Richard M. Stallman and Roland H. Pesch, July 1991. |
123 | @end ifset | |
124 | @c man end | |
125 | ||
f727df28 KK |
126 | +@node gdb-add-index man |
127 | +@heading gdb-add-index | |
969912f7 | 128 | + |
f727df28 | 129 | +@c man title gdb-add-index Add index files to speed up GDB |
969912f7 | 130 | + |
f727df28 KK |
131 | +@c man begin SYNOPSIS gdb-add-index |
132 | +gdb-add-index @var{filename} | |
133 | +@c man end | |
969912f7 | 134 | + |
f727df28 KK |
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. | |
969912f7 | 141 | + |
f727df28 KK |
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_*}). | |
146 | + | |
147 | +See more in | |
148 | +@ifset man | |
149 | +the @value{GDBN} manual in node @code{Index Files} | |
150 | +-- shell command @code{info -f gdb -n 'Index Files'}. | |
151 | +@end ifset | |
152 | +@ifclear man | |
153 | +@ref{Index Files}. | |
154 | +@end ifclear | |
155 | +@c man end | |
156 | + | |
157 | +@c man begin SEEALSO gdb-add-index | |
158 | +@ifset man | |
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 | |
969912f7 | 162 | + |
4b0e5c1b AM |
163 | +@smallexample |
164 | +info gdb | |
165 | +@end smallexample | |
166 | + | |
167 | +should give you access to the complete manual. | |
168 | + | |
169 | +@cite{Using GDB: A Guide to the GNU Source-Level Debugger}, | |
170 | +Richard M. Stallman and Roland H. Pesch, July 1991. | |
171 | +@end ifset | |
172 | +@c man end | |
173 | + | |
174 | @include gpl.texi | |
175 | ||
176 | @node GNU Free Documentation License | |
177 | -- | |
178 | 2.14.3 | |
179 |