This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb/gdb-8.2-branch] contrib/gdb-add-index.sh -dwarf-5
- From: Jan Kratochvil <jkratoch at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 7 Jul 2018 21:20:25 -0000
- Subject: [binutils-gdb/gdb-8.2-branch] contrib/gdb-add-index.sh -dwarf-5
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=dbc864ae0befb776deae11a6e420ba7f1c6b80c4
commit dbc864ae0befb776deae11a6e420ba7f1c6b80c4
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Sat Jul 7 23:02:36 2018 +0200
contrib/gdb-add-index.sh -dwarf-5
------------------------------------------------------------------------------
(gdb) help save gdb-index
Save a gdb-index file.
Usage: save gdb-index [-dwarf-5] DIRECTORY
No options create one file with .gdb-index extension for pre-DWARF-5
compatible .gdb_index section. With -dwarf-5 creates two files with
extension .debug_names and .debug_str for DWARF-5 .debug_names section.
------------------------------------------------------------------------------
But gdb-add-index command provided no way how to pass the -dwarf-5 option.
gdb/ChangeLog
2018-07-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* contrib/gdb-add-index.sh ($dwarf5): New, use it.
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/contrib/gdb-add-index.sh | 10 ++++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8313252..9920aa7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2018-07-07 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * contrib/gdb-add-index.sh ($dwarf5): New, use it.
+
2018-07-04 Joel Brobecker <brobecker@adacore.com>
* version.in: Set GDB version number to 8.1.90.DATE-git.
diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh
index 7114696..8e260d7 100755
--- a/gdb/contrib/gdb-add-index.sh
+++ b/gdb/contrib/gdb-add-index.sh
@@ -23,8 +23,14 @@ OBJCOPY=${OBJCOPY:=objcopy}
myname="${0##*/}"
+dwarf5=""
+if [ "$1" = "-dwarf-5" ]; then
+ dwarf5="$1"
+ shift
+fi
+
if test $# != 1; then
- echo "usage: $myname FILE" 1>&2
+ echo "usage: $myname [-dwarf-5] FILE" 1>&2
exit 1
fi
@@ -48,7 +54,7 @@ rm -f $index4 $index5 $debugstr $debugstrmerge $debugstrerr
trap "rm -f $index4 $index5 $debugstr $debugstrmerge $debugstrerr" 0
$GDB --batch -nx -iex 'set auto-load no' \
- -ex "file $file" -ex "save gdb-index $dir" || {
+ -ex "file $file" -ex "save gdb-index $dwarf5 $dir" || {
# Just in case.
status=$?
echo "$myname: gdb error generating index for $file" 1>&2