]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-gdb-add-index-script.patch
updated to 7.7.1
[packages/gdb.git] / gdb-gdb-add-index-script.patch
CommitLineData
969912f7
JR
1http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html
2Subject: Re: [0/4] RFC: add DWARF index support
3
4Jan Kratochvil: Fixed $d -> $dir.
5Jan Kratochvil: Remove /dev/null redirection.
6
7>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
8
9Tom> This patch series adds support for a DWARF index to gdb.
10
11Roland suggested we wrap up the index-creation code into a helper
12script.
13
14I'm not sure if this is something people would want in gdb proper, but I
15figured I would send it here just in case.
16
17Tom
18
192010-07-09 Tom Tromey <tromey@redhat.com>
20
21 * Makefile.in (install-only): Install gdb-add-index.
22 * gdb-add-index: New file.
23
242010-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
29From: Tom Tromey <tromey@redhat.com>
30Date: Fri, 9 Jul 2010 11:17:54 -0600
31Subject: [PATCH 4/4] add gdb-add-index
32Subject: [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
321e94d6 43Index: gdb-7.7.1/gdb/Makefile.in
969912f7 44===================================================================
321e94d6
BS
45--- gdb-7.7.1/gdb/Makefile.in.orig 2014-06-05 10:44:16.899964423 +0200
46+++ gdb-7.7.1/gdb/Makefile.in 2014-06-05 10:50:47.084009619 +0200
47@@ -1093,6 +1093,15 @@
48 $(INSTALL_SCRIPT) gcore \
49 $(DESTDIR)$(bindir)/$$transformed_name; \
50 fi
969912f7
JR
51+ transformed_name=`t='$(program_transform_name)'; \
52+ echo gdb-add-index | sed -e "$$t"` ; \
53+ if test "x$$transformed_name" = x; then \
54+ transformed_name=gdb-add-index ; \
55+ else \
56+ true ; \
57+ fi ; \
58+ $(INSTALL_PROGRAM) $(srcdir)/gdb-add-index \
321e94d6 59+ $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT)
969912f7
JR
60 @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
61
321e94d6 62 install-strip:
969912f7
JR
63Index: gdb-7.5.91.20130407/gdb/doc/gdb.texinfo
64===================================================================
65--- gdb-7.5.91.20130407.orig/gdb/doc/gdb.texinfo 2013-04-11 16:53:00.000000000 +0200
66+++ gdb-7.5.91.20130407/gdb/doc/gdb.texinfo 2013-04-11 16:55:07.004278842 +0200
67@@ -17159,6 +17159,14 @@ There are currently some limitation on i
68 for DWARF debugging information, not stabs. And, they do not
69 currently work for programs using Ada.
70
71+@value{GDBN} comes with a program, @command{gdb-add-index}, which can
72+be used to add the index to a symbol file. It takes the symbol file
73+as its only argument:
74+
75+@smallexample
76+$ gdb-add-index symfile
77+@end smallexample
78+
79 @node Symbol Errors
80 @section Errors Reading Symbol Files
81
cd373095 82Index: gdb-7.4.50.20120103/gdb/gdb-add-index
969912f7
JR
83===================================================================
84--- /dev/null 1970-01-01 00:00:00.000000000 +0000
cd373095 85+++ gdb-7.4.50.20120103/gdb/gdb-add-index 2012-01-03 15:23:43.296231942 +0100
969912f7
JR
86@@ -0,0 +1,30 @@
87+#! /bin/sh
88+
89+# Add a .gdb_index section to a file.
90+
91+# Copyright (C) 2010 Free Software Foundation, Inc.
92+# This program is free software; you can redistribute it and/or modify
93+# it under the terms of the GNU General Public License as published by
94+# the Free Software Foundation; either version 3 of the License, or
95+# (at your option) any later version.
96+#
97+# This program is distributed in the hope that it will be useful,
98+# but WITHOUT ANY WARRANTY; without even the implied warranty of
99+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
100+# GNU General Public License for more details.
101+#
102+# You should have received a copy of the GNU General Public License
103+# along with this program. If not, see <http://www.gnu.org/licenses/>.
104+
105+file="$1"
106+dir="${file%/*}"
107+
108+# We don't care if gdb gives an error.
109+gdb -nx --batch-silent -ex "file $file" -ex "save gdb-index $dir"
110+
111+if test -f "${file}.gdb-index"; then
112+ objcopy --add-section .gdb_index="${file}.gdb-index" --set-section-flags .gdb_index=readonly "$file" "$file"
113+ rm -f "${file}.gdb-index"
114+fi
115+
116+exit 0
This page took 0.042942 seconds and 4 git commands to generate.