This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Resurrect gdb-add-index as a contrib script
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Samuel Bronson <naesten at gmail dot com>
- Cc: gdb-patches at sourceware dot org, Tom Tromey <tromey at redhat dot com>
- Date: Thu, 7 Nov 2013 20:57:12 +0100
- Subject: Re: [PATCH] Resurrect gdb-add-index as a contrib script
- Authentication-results: sourceware.org; auth=none
On Sun, 03 Nov 2013 23:52:17 +0100, Samuel Bronson wrote:
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,8 @@
> +2013-11-03 Samuel Bronson <naesten@gmail.com>
Here should be listed also primarily Tom, not sure if you imported some Doug's
changes and also myself.
> --- /dev/null
> +++ b/gdb/contrib/gdb-add-index.sh
> @@ -0,0 +1,33 @@
> +#! /bin/sh
> +
> +# Add a .gdb_index section to a file.
> +
> +# Copyright (C) 2010 Free Software Foundation, Inc.
2010-2013
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program. If not, see <http://www.gnu.org/licenses/>.
> +
> +file="$1"
> +dir="${file%/*}"
You could fix the execution with no / in $1.
> +
> +# We don't care if gdb gives an error.
> +gdb -nx -iex 'set auto-load no' --batch-silent \
> + -ex "file $file" \
> + -ex "save gdb-index $dir"
> +
> +if test -f "${file}.gdb-index"; then
> + objcopy --add-section .gdb_index="${file}.gdb-index" \
> + --set-section-flags .gdb_index=readonly "$file" "$file"
> + rm -f "${file}.gdb-index"
> +fi
> +
> +exit 0
> --
> 1.8.4.rc3
On Mon, 04 Nov 2013 03:04:48 +0100, Samuel Bronson wrote:
> It also occurs to me that people might want to use fragments of this
> in their build systems, so it might be better to use the simple
> permissive license from
> <http://www.gnu.org/prep/maintain/maintain.html#License-Notices-for-Other-Files>;
> would that be okay?
I do not see a reason to make such exception although it is Tom's script so it
is more up to him. I find such a possible request can be considered if it
ever appears.
On Mon, 04 Nov 2013 20:33:20 +0100, Samuel Bronson wrote:
> Oops. My last email was supposed to say something about "gdb-add-index
> foo" not working when foo had no / in it. This is the problem which
> the "this" in the next part was meant to refer to.
I did not find too clear from the archives why Tom has removed the script.
I found only
Re: [patch] gdb-add-index tweaks
https://sourceware.org/ml/gdb-patches/2010-09/msg00133.html
so IIUC the script still was far from perfect so it was not acceptable for FSF
GDB distribution. So the newly existing gdb/contrib/ directory seems as an
appropriate place for the script to me.
Thanks,
Jan