]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-gdb-add-index-script.patch
- update some patches from gdb-7.2-51.fc14 (this fixes at least artifical arrays...
[packages/gdb.git] / gdb-gdb-add-index-script.patch
1 http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html
2 Subject: Re: [0/4] RFC: add DWARF index support
3
4 Jan Kratochvil: Fixed $d -> $dir.
5 Jan Kratochvil: Remove /dev/null redirection.
6
7 >>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
8
9 Tom> This patch series adds support for a DWARF index to gdb.
10
11 Roland suggested we wrap up the index-creation code into a helper
12 script.
13
14 I'm not sure if this is something people would want in gdb proper, but I
15 figured I would send it here just in case.
16
17 Tom
18
19 2010-07-09  Tom Tromey  <tromey@redhat.com>
20
21         * Makefile.in (install-only): Install gdb-add-index.
22         * gdb-add-index: New file.
23
24 2010-07-09  Tom Tromey  <tromey@redhat.com>
25
26         * gdb.texinfo (Index Files): Mention gdb-add-index.
27
28 >From 30714fe719e61baea03d0dc5793eb0d564faebb7 Mon Sep 17 00:00:00 2001
29 From: Tom Tromey <tromey@redhat.com>
30 Date: Fri, 9 Jul 2010 11:17:54 -0600
31 Subject: [PATCH 4/4] add gdb-add-index
32 Subject: [PATCH 4/4] add gdb-add-index
33
34 ---
35  gdb/ChangeLog       |    5 +++++
36  gdb/Makefile.in     |   11 ++++++++++-
37  gdb/doc/ChangeLog   |    4 ++++
38  gdb/doc/gdb.texinfo |    8 ++++++++
39  gdb/gdb-add-index   |   30 ++++++++++++++++++++++++++++++
40  5 files changed, 57 insertions(+), 1 deletions(-)
41  create mode 100755 gdb/gdb-add-index
42
43 diff --git a/gdb/Makefile.in b/gdb/Makefile.in
44 index 6dbb284..8210a2c 100644
45 --- a/gdb/Makefile.in
46 +++ b/gdb/Makefile.in
47 @@ -1018,7 +1018,16 @@ install-only: $(CONFIG_INSTALL) xml-syscall-install
48                 $(SHELL) $(srcdir)/../mkinstalldirs \
49                         $(DESTDIR)$(man1dir) ; \
50                 $(INSTALL_DATA) $(srcdir)/gdb.1 \
51 -                       $(DESTDIR)$(man1dir)/$$transformed_name.1
52 +                       $(DESTDIR)$(man1dir)/$$transformed_name.1; \
53 +       transformed_name=`t='$(program_transform_name)'; \
54 +                         echo gdb-add-index | sed -e "$$t"` ; \
55 +               if test "x$$transformed_name" = x; then \
56 +                 transformed_name=gdb-add-index ; \
57 +               else \
58 +                 true ; \
59 +               fi ; \
60 +               $(INSTALL_PROGRAM) $(srcdir)/gdb-add-index \
61 +                       $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT)
62         @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
63  .PHONY: install-tui
64  install-tui:
65 diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
66 index 69141e3..457e6b4 100644
67 --- a/gdb/doc/gdb.texinfo
68 +++ b/gdb/doc/gdb.texinfo
69 @@ -15045,6 +15045,14 @@ There are currently some limitation on indices.  They only work when
70  for DWARF debugging information, not stabs.  And, they do not
71  currently work for programs using Ada.
72  
73 +@value{GDBN} comes with a program, @command{gdb-add-index}, which can
74 +be used to add the index to a symbol file.  It takes the symbol file
75 +as its only argument:
76 +
77 +@smallexample
78 +$ gdb-add-index symfile
79 +@end smallexample
80 +
81  
82  @node Symbol Errors
83  @section Errors Reading Symbol Files
84 diff --git a/gdb/gdb-add-index b/gdb/gdb-add-index
85 new file mode 100755
86 index 0000000..c9a03b0
87 --- /dev/null
88 +++ b/gdb/gdb-add-index
89 @@ -0,0 +1,30 @@
90 +#! /bin/sh
91 +
92 +# Add a .gdb_index section to a file.
93 +
94 +# Copyright (C) 2010 Free Software Foundation, Inc.
95 +# This program is free software; you can redistribute it and/or modify
96 +# it under the terms of the GNU General Public License as published by
97 +# the Free Software Foundation; either version 3 of the License, or
98 +# (at your option) any later version.
99 +#
100 +# This program is distributed in the hope that it will be useful,
101 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
102 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
103 +# GNU General Public License for more details.
104 +#
105 +# You should have received a copy of the GNU General Public License
106 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
107 +
108 +file="$1"
109 +dir="${file%/*}"
110 +
111 +# We don't care if gdb gives an error.
112 +gdb -nx --batch-silent -ex "file $file" -ex "save gdb-index $dir"
113 +
114 +if test -f "${file}.gdb-index"; then
115 +   objcopy --add-section .gdb_index="${file}.gdb-index" --set-section-flags .gdb_index=readonly "$file" "$file"
116 +   rm -f "${file}.gdb-index"
117 +fi
118 +
119 +exit 0
120 -- 
121 1.6.2.5
122
This page took 0.03256 seconds and 3 git commands to generate.