[RFA-v2] Add scripts to generate ARI web pages to gdb/contrib/ari directory
Pierre Muller
pierre.muller@ics-cnrs.unistra.fr
Sat May 26 12:41:00 GMT 2012
> The patch is corrupted by line wrapping, 48 lines and some are not trivial
> to recover.
Sorry,
I hope the attached patch will apply correctly.
I made small changes, one of them is to remove completely
the email sending part of the update-web-ari.sh script
as several person spoke up against it in its present form.
Concerning the new create-web-ari-in-src.sh,
this is indeed a new script (hence the 2012 copyright only)
and it is just a way to be able to generate the ARI index.html web
page without any parameters.
It basically only give default parameters
to update-web-ari.sh script, which requires four parameters.
I hope this clarifies some of your questions.
Concerning Sergio's suggestion to separate out the awk script into
a separate file, I would like to minimize the changes relative to the
existing ss
cvs repository files.
About the use of dirname, I think that
direname is like basename part of
coreutils, and basename is already use several times
inside update-web-ari script in ss.
I agree that being made public and thus available to
many users, it would be nice to chack availability, and add a workaround,
but I have no
precise how to do it, probably using a configure or Makefile could help here
.
Note that gdb directory cvonfigure script seems to contain both
dirname and basename...
I hope you will be able to generate a ARI web page,
and give more feedbacks,
Pierre Muller
as unofficial ARI maintainer
The ChangeLog entry is unchanged:
2012-05-26 Pierre Muller <muller@ics.u-strasbg.fr>
* contrib/ari/create-web-ari-in-src.sh: New file.
* contrib/ari/gdb_ari.sh: New file.
* contrib/ari/gdb_find.sh: New file.
* contrib/ari/update-web-ari.sh: New file.
The patch is in the attached file ari.patch
To help to show what changed, here is the output of
diff -u -p -u ../../../ss ./contrib./ari
(../../../ss is the location of my ss checkout)
$ cat diff-to-ss
only in ./contrib/ari: create-web-ari-in-src.sh
diff -b -u -p ../../ss/gdb_ari.sh ./contrib/ari/gdb_ari.sh
--- ../../ss/gdb_ari.sh 2012-05-26 13:59:56.744837000 +0200
+++ ./contrib/ari/gdb_ari.sh 2012-05-26 13:47:46.183454200 +0200
@@ -1,9 +1,31 @@
#!/bin/sh
+# GDB script to list of problems using awk.
+#
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+#
+# This file is part of GDB.
+#
+# 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/>.
+
+# Make certain that the script is not running in an internationalized
+# environment.
+
LANG=c ; export LANG
LC_ALL=c ; export LC_ALL
-# Permenant checks take the form:
+# Permanent checks take the form:
# Do not use XXXX, ISO C 90 implies YYYY
# Do not use XXXX, instead use YYYY''.
@@ -564,7 +586,7 @@ Function name starts lower case but has
editCase_full_line = $0
}
-# Only function implemenation should be on first column
+# Only function implementation should be on first column
BEGIN { doc["function call in first column"] = "\
Function name in first column should be restricted to function
implementation"
category["function call in first column"] = ari_code
@@ -676,15 +698,16 @@ FNR == 1 {
}
}
-BEGIN { doc["inline"] = "\
-Do not use the inline attribute; \
-since the compiler generally ignores this, better algorithm selection \
-is needed to improved performance"
- category["inline"] = ari_code
-}
-/(^|[^_[:alnum:]])inline([^_[:alnum:]]|$)/ {
- fail("inline")
-}
+# Commented out, but left inside sources, just in case.
+# BEGIN { doc["inline"] = "\
+# Do not use the inline attribute; \
+# since the compiler generally ignores this, better algorithm selection \
+# is needed to improved performance"
+# category["inline"] = ari_code
+# }
+# /(^|[^_[:alnum:]])inline([^_[:alnum:]]|$)/ {
+# fail("inline")
+# }
# This test is obsolete as this type
# has been deprecated and finally suppressed from GDB sources
Seulement dans ../../ss: gdb_ari.sh~
Seulement dans ../../ss: gdb_copyright.sh
Seulement dans ../../ss: gdb_find.log
diff -b -u -p ../../ss/gdb_find.sh ./contrib/ari/gdb_find.sh
--- ../../ss/gdb_find.sh 2011-03-21 23:52:35.465984900 +0100
+++ ./contrib/ari/gdb_find.sh 2012-05-26 13:47:46.183454200 +0200
@@ -1,5 +1,31 @@
#!/bin/sh
+# GDB script to create list of files to check using gdb_ari.sh.
+#
+# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+#
+# This file is part of GDB.
+#
+# 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/>.
+
+# Make certain that the script is not running in an internationalized
+# environment.
+
+LANG=C ; export LANG
+LC_ALL=C ; export LC_ALL
+
+
# A find that prunes files that GDB users shouldn't be interested in.
# Use sort to order files alphabetically.
Only in ./contrib/ari: update-web-ari.sh
Only in ../../ss: update-web-cvs-ari
This is because I choose to add a .sh suffix to update-web-ari script.
$ diff -b -u -p ../../ss/update-web-ari ./contrib/ari/update-web-ari.sh
--- ../../ss/update-web-ari 2011-03-15 17:38:23.893984500 +0100
+++ ./contrib/ari/update-web-ari.sh 2012-05-26 13:47:46.199054300 +0200
@@ -1,10 +1,25 @@
#!/bin/sh -x
-# TODO: setjmp.h, setjmp and longjmp.
-
+# GDB script to create GDB ARI web page.
+#
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
+#
+# This file is part of GDB.
+#
+# 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/>.
-PATH=/bin:/usr/bin:/usr/local/bin:$HOME/bin
-export PATH
+# TODO: setjmp.h, setjmp and longjmp.
# Direct stderr into stdout but still hang onto stderr (/dev/fd/3)
exec 3>&2 2>&1
@@ -18,7 +33,7 @@ ECHO ()
# Really mindless usage
if test $# -ne 4
then
- echo "Usage: $0 <snapshot> <tmpdir> <destdir> <project>" 1>&2
+ echo "Usage: $0 <snapshot/sourcedir> <tmpdir> <destdir> <project>" 1>&2
exit 1
fi
snapshot=$1 ; shift
@@ -26,6 +41,13 @@ tmpdir=$1 ; shift
wwwdir=$1 ; shift
project=$1 ; shift
+# Try to create destination directory if it doesn't exist yet
+if [ ! -d ${wwwdir} ]
+then
+ mkdir -p ${wwwdir}
+fi
+
+# Fail if destination directory doesn't exist or is not writable
if [ ! -w ${wwwdir} -o ! -d ${wwwdir} ]
then
echo ERROR: Can not write to directory ${wwwdir} >&2
@@ -56,7 +78,6 @@ check_werror_p=true
update_doc_p=true
update_web_p=true
-
if awk --version 2>&1 </dev/null | grep -i gnu > /dev/null
then
AWK=awk
@@ -72,14 +93,25 @@ then
fi
-# unpack the tar-ball
-if ${unpack_source_p}
-then
+# If the first parameter is a directory,
+#we just use it as the extracted source
+if [ -d ${snapshot} ]
+then
+ module=${project}
+ srcdir=${snapshot}
+ aridir=${srcdir}/${module}/ari
+ unpack_source_p=false
+ delete_source_p=false
+ version_in=${srcdir}/${module}/version.in
+else
+ # unpack the tar-ball
+ if ${unpack_source_p}
+ then
# Was it previously unpacked?
if ${delete_source_p} || test ! -d ${tmpdir}/${module}*
then
/bin/rm -rf "${tmpdir}"
- /bin/mkdir ${tmpdir}
+ /bin/mkdir -p ${tmpdir}
if [ ! -d ${tmpdir} ]
then
echo "Problem creating work directory"
@@ -93,12 +125,16 @@ then
* ) ECHO Bad file ${snapshot} ; exit 1 ;;
esac | tar xf -
fi
+ fi
+
+ module=`basename ${snapshot}`
+ module=`basename ${module} .bz2`
+ module=`basename ${module} .tar`
+ srcdir=`echo ${tmpdir}/${module}*`
+ aridir=${HOME}/ss
+ version_in=${srcdir}/gdb/version.in
fi
-module=`basename ${snapshot}`
-module=`basename ${module} .bz2`
-module=`basename ${module} .tar`
-srcdir=`echo ${tmpdir}/${module}*`
-version_in=${srcdir}/gdb/version.in
+
if [ ! -r ${version_in} ]
then
echo ERROR: missing version file 1>&2
@@ -140,9 +176,9 @@ fi
if ${check_indent_p} && test -d "${srcdir}"
then
printf "Analizing file indentation:" 1>&2
- ( cd "${srcdir}" && /bin/sh $HOME/ss/gdb_find.sh ${project} | while
read f
+ ( cd "${srcdir}" && /bin/sh ${aridir}/gdb_find.sh ${project} | while
read f
do
- if /bin/sh $HOME/ss/gdb_indent.sh < ${f} 2>/dev/null | cmp -s - ${f}
+ if /bin/sh ${aridir}/gdb_indent.sh < ${f} 2>/dev/null | cmp -s -
${f}
then
:
else
@@ -173,8 +209,8 @@ then
node=`uname -n`
echo "`date`: Using source lines ${srcf}" 1>&2
echo "`date`: Checking source code" 1>&2
- ( cd "${srcdir}" && /bin/sh $HOME/ss/gdb_find.sh "${project}" | \
- xargs /bin/sh $HOME/ss/gdb_ari.sh -Werror -Wall --print-idx
--src=${srcf}
+ ( cd "${srcdir}" && /bin/sh ${aridir}/gdb_find.sh "${project}" | \
+ xargs /bin/sh ${aridir}/gdb_ari.sh -Werror -Wall --print-idx
--src=${srcf}
) > ${bugf}
# Remove things we are not interested in to signal by email
# gdbarch changes are not important here
@@ -213,24 +249,6 @@ then
email_suffix="`date`"
fi
- if [ "${node}" = "sourceware.org" ]; then
- warning_email=gdb-patches@sourceware.org
- else
- warning_email=muller@sourceware.org
- fi
-
- # Check if ${diff} is not empty
- if [ -s ${diff} ]; then
- # Send an email to muller@sourceware.org
- mutt -s "New ARI warning ${email_suffix}" \
- ${warning_email} < ${wwwdir}/mail-message
- else
- if [ -s ${wwwdir}/${mail-message} ]; then
- # Send an email to muller@sourceware.org
- mutt -s "ARI warning list change ${email_suffix}" \
- muller@sourceware.org < ${wwwdir}/mail-message
- fi
- fi
fi
@@ -363,7 +381,7 @@ then
cd ${wwwdir}
rm -f ari.doc ari.idx ari.doc.bug
# Generate an extra file containing all the bugs that the ARI can
detect.
- /bin/sh $HOME/ss/gdb_ari.sh -Werror -Wall --print-idx --print-doc >>
ari.doc.bug
+ /bin/sh ${aridir}/gdb_ari.sh -Werror -Wall --print-idx --print-doc >>
ari.doc.bug
cat ari.*.bug | $AWK > ari.idx '
BEGIN {
FS=": *"
@@ -701,7 +719,7 @@ END {
# Make the scripts available
-cp $HOME/ss/gdb_*.sh ${wwwdir}
+cp ${aridir}/gdb_*.sh ${wwwdir}
# Compute the ARI index - ratio of zero vs non-zero problems.
indexes=`awk '
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ari.patch
Type: application/octet-stream
Size: 68261 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120526/acc6c602/attachment.obj>
More information about the Gdb-patches
mailing list