From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18706 invoked by alias); 14 Jun 2012 12:36:18 -0000 Received: (qmail 18527 invoked by uid 22791); 14 Jun 2012 12:36:16 -0000 X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL,BAYES_20,FSL_RCVD_USER,KHOP_THREADED,MIME_QP_LONG_LINE,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Jun 2012 12:36:02 +0000 Received: from md15.u-strasbg.fr (md15.u-strasbg.fr [130.79.200.204]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id q5ECZRit068156 ; Thu, 14 Jun 2012 14:35:27 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms18.u-strasbg.fr [130.79.204.118]) by md15.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id q5ECZQNV007085 ; Thu, 14 Jun 2012 14:35:27 +0200 (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id q5ECZP9O027330 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Thu, 14 Jun 2012 14:35:25 +0200 (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Pedro Alves'" , "'Joel Brobecker'" Cc: , "'Jan Kratochvil'" , "'Sergio Durigan Junior'" References: <001201cd3547$377188b0$a6549a10$@muller@ics-cnrs.unistra.fr> <20120525194654.GA30472@host2.jankratochvil.net> <003c01cd3b3c$d85e07d0$891a1770$@muller@ics-cnrs.unistra.fr> <002101cd3c42$5473b670$fd5b2350$@muller@ics-cnrs.unistra.fr> <006701cd3d00$6b9566a0$42c033e0$@muller@ics-cnrs.unistra.fr> <20120529130144.GM5492@adacore.com> <4FC4CB35.5030503@redhat.com> In-Reply-To: <4FC4CB35.5030503@redhat.com> Subject: [RFA-v4] Add scripts to generate ARI web pages to gdb/contrib/ari directory Date: Thu, 14 Jun 2012 12:36:00 -0000 Message-ID: <001501cd4a2a$2b84d5a0$828e80e0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0016_01CD4A3A.EF0DA5A0" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00464.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_0016_01CD4A3A.EF0DA5A0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Content-length: 660 Here is a new version of my patch to insert ARI web page generation script into GDB sources. As requested I removed the references to emails for sourceware. Otherwise I also made a small change to generate the web page in a subdir called trunk/ari if no tag in found in CVS subdirectory and branch/ari otherwise. gdb/contrib./ChangeLog entry (New file) 2012-06-14 Pierre Muller Incorporate ARI web page generator into GDB sources. * ari/create-web-ari-in-src.sh: New file. * ari/gdb_ari.sh: New file. * ari/gdb_find.sh: New file. * ari/update-web-ari.sh: New file. Pierre Muller ------=_NextPart_000_0016_01CD4A3A.EF0DA5A0 Content-Type: application/octet-stream; name="contrib-ari.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="contrib-ari.patch" Content-length: 80771 projecttype:gdb=0A= revision:HEAD=0A= email:muller@ics.u-strasbg.fr=0A= =0A= 2012-06-14 Pierre Muller =0A= =0A= Incorporate ARI web page generator into GDB sources.=0A= * ari/create-web-ari-in-src.sh: New file.=0A= * ari/gdb_ari.sh: New file.=0A= * ari/gdb_find.sh: New file.=0A= * ari/update-web-ari.sh: New file.=0A= =0A= =0A= Index: src/gdb/contrib/ari/create-web-ari-in-src.sh=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: contrib/ari/create-web-ari-in-src.sh=0A= diff -N contrib/ari/create-web-ari-in-src.sh=0A= --- /dev/null 1 Jan 1970 00:00:00 -0000=0A= +++ src/gdb/contrib/ari/create-web-ari-in-src.sh 14 Jun 2012 10:20:54 -0000= =0A= @@ -0,0 +1,77 @@=0A= +#! /bin/sh=0A= +=0A= +# GDB script to create web ARI page directly from within gdb/ari directory= .=0A= +#=0A= +# Copyright (C) 2012 Free Software Foundation, Inc.=0A= +#=0A= +# This file is part of GDB.=0A= +#=0A= +# This program is free software; you can redistribute it and/or modify=0A= +# it under the terms of the GNU General Public License as published by=0A= +# the Free Software Foundation; either version 3 of the License, or=0A= +# (at your option) any later version.=0A= +#=0A= +# This program is distributed in the hope that it will be useful,=0A= +# but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= +# GNU General Public License for more details.=0A= +#=0A= +# You should have received a copy of the GNU General Public License=0A= +# along with this program. If not, see .=0A= +=0A= +# Determine directory of current script.=0A= +scriptpath=3D`dirname $0`=0A= +# If "scriptpath" is a relative path, then convert it to absolute.=0A= +if [ "`echo ${scriptpath} | cut -b1`" !=3D '/' ] ; then=0A= + scriptpath=3D"`pwd`/${scriptpath}"=0A= +fi=0A= +=0A= +# update-web-ari.sh script wants four parameters=0A= +# 1: directory of checkout src or gdb-RELEASE for release sources.=0A= +# 2: a temp directory.=0A= +# 3: a directory for generated web page.=0A= +# 4: The name of the current package, must be gdb here.=0A= +# Here we provide default values for these 4 parameters=0A= +=0A= +# srcdir parameter=0A= +if [ -z "${srcdir}" ] ; then=0A= + srcdir=3D${scriptpath}/../../..=0A= +fi=0A= +=0A= +# Determine location of a temporary directory to be used by=0A= +# update-web-ari.sh script.=0A= +if [ -z "${tempdir}" ] ; then=0A= + if [ ! -z "$TMP" ] ; then=0A= + tempdir=3D$TMP/create-ari=0A= + elif [ ! -z "$TEMP" ] ; then=0A= + tempdir=3D$TEMP/create-ari=0A= + else=0A= + tempdir=3D/tmp/create-ari=0A= + fi=0A= +fi=0A= +=0A= +# Default location of generate index.hmtl web page.=0A= +if [ -z "${webdir}" ] ; then=0A= +# Use 'branch' subdir name if Tag contains branch=0A= + if [ -f "${srcdir}/gdb/CVS/Tag" ] ; then=0A= + tagname=3D`cat "${srcdir}/gdb/CVS/Tag"`=0A= + else=0A= + tagname=3Dtrunk=0A= + fi=0A= + if [ "${tagname#branch}" !=3D "${tagname}" ] ; then=0A= + subdir=3Dbranch=0A= + else=0A= + subdir=3Dtrunk=0A= + fi=0A= + webdir=3D`pwd`/${subdir}/ari=0A= +fi=0A= +=0A= +# Launch update-web-ari.sh in same directory as current script.=0A= +${scriptpath}/update-web-ari.sh ${srcdir} ${tempdir} ${webdir} gdb=0A= +=0A= +if [ -f "${webdir}/index.html" ] ; then=0A= + echo "ARI output can be viewed in file \"${webdir}/index.html\""=0A= +else=0A= + echo "ARI script failed to generate file \"${webdir}/index.html\""=0A= +fi=0A= +=0A= Index: src/gdb/contrib/ari/gdb_ari.sh=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: contrib/ari/gdb_ari.sh=0A= diff -N contrib/ari/gdb_ari.sh=0A= --- /dev/null 1 Jan 1970 00:00:00 -0000=0A= +++ src/gdb/contrib/ari/gdb_ari.sh 14 Jun 2012 10:20:54 -0000=0A= @@ -0,0 +1,1351 @@=0A= +#!/bin/sh=0A= +=0A= +# GDB script to list of problems using awk.=0A= +#=0A= +# Copyright (C) 2002-2012 Free Software Foundation, Inc.=0A= +#=0A= +# This file is part of GDB.=0A= +#=0A= +# This program is free software; you can redistribute it and/or modify=0A= +# it under the terms of the GNU General Public License as published by=0A= +# the Free Software Foundation; either version 3 of the License, or=0A= +# (at your option) any later version.=0A= +#=0A= +# This program is distributed in the hope that it will be useful,=0A= +# but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= +# GNU General Public License for more details.=0A= +#=0A= +# You should have received a copy of the GNU General Public License=0A= +# along with this program. If not, see .=0A= +=0A= +# Make certain that the script is not running in an internationalized=0A= +# environment.=0A= +=0A= +LANG=3Dc ; export LANG=0A= +LC_ALL=3Dc ; export LC_ALL=0A= +=0A= +# Permanent checks take the form:=0A= +=0A= +# Do not use XXXX, ISO C 90 implies YYYY=0A= +# Do not use XXXX, instead use YYYY''.=0A= +=0A= +# and should never be removed.=0A= +=0A= +# Temporary checks take the form:=0A= +=0A= +# Replace XXXX with YYYY=0A= +=0A= +# and once they reach zero, can be eliminated.=0A= +=0A= +# FIXME: It should be able to override this on the command line=0A= +error=3D"regression"=0A= +warning=3D"regression"=0A= +ari=3D"regression eol code comment deprecated legacy obsolete gettext"=0A= +all=3D"regression eol code comment deprecated legacy obsolete gettext depr= ecate internal gdbarch macro"=0A= +print_doc=3D0=0A= +print_idx=3D0=0A= +=0A= +usage ()=0A= +{=0A= + cat <&2=0A= +Error: $1=0A= +=0A= +Usage:=0A= + $0 --print-doc --print-idx -Wall -Werror -W ...=0A= +Options:=0A= + --print-doc Print a list of all potential problems, then exit.=0A= + --print-idx Include the problems IDX (index or key) in every message.= =0A= + --src=3Dfile Write source lines to file.=0A= + -Werror Treat all problems as errors.=0A= + -Wall Report all problems.=0A= + -Wari Report problems that should be fixed in new code.=0A= + -W Report problems in the specifed category. Vaid categorie= s=0A= + are: ${all}=0A= +EOF=0A= + exit 1=0A= +}=0A= +=0A= +=0A= +# Parse the various options=0A= +Woptions=3D=0A= +srclines=3D""=0A= +while test $# -gt 0=0A= +do=0A= + case "$1" in=0A= + -Wall ) Woptions=3D"${all}" ;;=0A= + -Wari ) Woptions=3D"${ari}" ;;=0A= + -Werror ) Werror=3D1 ;;=0A= + -W* ) Woptions=3D"${Woptions} `echo x$1 | sed -e 's/x-W//'`" ;;=0A= + --print-doc ) print_doc=3D1 ;;=0A= + --print-idx ) print_idx=3D1 ;;=0A= + --src=3D* ) srclines=3D"`echo $1 | sed -e 's/--src=3D/srclines=3D\"/'`= \"" ;;=0A= + -- ) shift ; break ;;=0A= + - ) break ;;=0A= + -* ) usage "$1: unknown option" ;;=0A= + * ) break ;;=0A= + esac=0A= + shift=0A= +done=0A= +if test -n "$Woptions" ; then=0A= + warning=3D"$Woptions"=0A= + error=3D=0A= +fi=0A= +=0A= +=0A= +# -Werror implies treating all warnings as errors.=0A= +if test -n "${Werror}" ; then=0A= + error=3D"${error} ${warning}"=0A= +fi=0A= +=0A= +=0A= +# Validate all errors and warnings.=0A= +for w in ${warning} ${error}=0A= +do=0A= + case " ${all} " in=0A= + *" ${w} "* ) ;;=0A= + * ) usage "Unknown option -W${w}" ;;=0A= + esac=0A= +done=0A= +=0A= +=0A= +# make certain that there is at least one file.=0A= +if test $# -eq 0 -a ${print_doc} =3D 0=0A= +then=0A= + usage "Missing file."=0A= +fi=0A= +=0A= +=0A= +# Convert the errors/warnings into corresponding array entries.=0A= +for a in ${all}=0A= +do=0A= + aris=3D"${aris} ari_${a} =3D \"${a}\";"=0A= +done=0A= +for w in ${warning}=0A= +do=0A= + warnings=3D"${warnings} warning[ari_${w}] =3D 1;"=0A= +done=0A= +for e in ${error}=0A= +do=0A= + errors=3D"${errors} error[ari_${e}] =3D 1;"=0A= +done=0A= +=0A= +if [ "$AWK" =3D=3D "" ] ; then=0A= + AWK=3Dawk=0A= +fi=0A= +=0A= +${AWK} -- '=0A= +BEGIN {=0A= + # NOTE, for a per-file begin use "FNR =3D=3D 1".=0A= + '"${aris}"'=0A= + '"${errors}"'=0A= + '"${warnings}"'=0A= + '"${srclines}"'=0A= + print_doc =3D '$print_doc'=0A= + print_idx =3D '$print_idx'=0A= + PWD =3D "'`pwd`'"=0A= +}=0A= +=0A= +# Print the error message for BUG. Append SUPLEMENT if non-empty.=0A= +function print_bug(file,line,prefix,category,bug,doc,supplement, suffix,id= x) {=0A= + if (print_idx) {=0A= + idx =3D bug ": "=0A= + } else {=0A= + idx =3D ""=0A= + }=0A= + if (supplement) {=0A= + suffix =3D " (" supplement ")"=0A= + } else {=0A= + suffix =3D ""=0A= + }=0A= + # ari.*.bug: :: : : =0A= + print file ":" line ": " prefix category ": " idx doc suffix=0A= + if (srclines !=3D "") {=0A= + print file ":" line ":" $0 >> srclines=0A= + }=0A= +}=0A= +=0A= +function fix(bug,file,count) {=0A= + skip[bug, file] =3D count=0A= + skipped[bug, file] =3D 0=0A= +}=0A= +=0A= +function fail(bug,supplement) {=0A= + if (doc[bug] =3D=3D "") {=0A= + print_bug("", 0, "internal: ", "internal", "internal", "Missing doc for b= ug " bug)=0A= + exit=0A= + }=0A= + if (category[bug] =3D=3D "") {=0A= + print_bug("", 0, "internal: ", "internal", "internal", "Missing category = for bug " bug)=0A= + exit=0A= + }=0A= +=0A= + if (ARI_OK =3D=3D bug) {=0A= + return=0A= + }=0A= + # Trim the filename down to just DIRECTORY/FILE so that it can be=0A= + # robustly used by the FIX code.=0A= +=0A= + if (FILENAME ~ /^\//) {=0A= + canonicalname =3D FILENAME=0A= + } else {=0A= + canonicalname =3D PWD "/" FILENAME=0A= + }=0A= + shortname =3D gensub (/^.*\/([^\\]*\/[^\\]*)$/, "\\1", 1, canonicalnam= e)=0A= +=0A= + skipped[bug, shortname]++=0A= + if (skip[bug, shortname] >=3D skipped[bug, shortname]) {=0A= + # print FILENAME, FNR, skip[bug, FILENAME], skipped[bug, FILENAME], bug= =0A= + # Do nothing=0A= + } else if (error[category[bug]]) {=0A= + # ari.*.bug: :: : : =0A= + print_bug(FILENAME, FNR, "", category[bug], bug, doc[bug], supplement)=0A= + } else if (warning[category[bug]]) {=0A= + # ari.*.bug: :: : : =0A= + print_bug(FILENAME, FNR, "warning: ", category[bug], bug, doc[bug], suppl= ement)=0A= + }=0A= +}=0A= +=0A= +FNR =3D=3D 1 {=0A= + seen[FILENAME] =3D 1=0A= + if (match(FILENAME, "\\.[ly]$")) {=0A= + # FILENAME is a lex or yacc source=0A= + is_yacc_or_lex =3D 1=0A= + }=0A= + else {=0A= + is_yacc_or_lex =3D 0=0A= + }=0A= +}=0A= +END {=0A= + if (print_idx) {=0A= + idx =3D bug ": "=0A= + } else {=0A= + idx =3D ""=0A= + }=0A= + # Did we do only a partial skip?=0A= + for (bug_n_file in skip) {=0A= + split (bug_n_file, a, SUBSEP)=0A= + bug =3D a[1]=0A= + file =3D a[2]=0A= + if (seen[file] && (skipped[bug_n_file] < skip[bug_n_file])) {=0A= + # ari.*.bug: :: : : =0A= + b =3D file " missing " bug=0A= + print_bug(file, 0, "", "internal", file " missing " bug, "Expecting "= skip[bug_n_file] " occurances of bug " bug " in file " file ", only found = " skipped[bug_n_file])=0A= + }=0A= + }=0A= +}=0A= +=0A= +=0A= +# Skip OBSOLETE lines=0A= +/(^|[^_[:alnum:]])OBSOLETE([^_[:alnum:]]|$)/ { next; }=0A= +=0A= +# Skip ARI lines=0A= +=0A= +BEGIN {=0A= + ARI_OK =3D ""=0A= +}=0A= +=0A= +/\/\* ARI:[[:space:]]*(.*)[[:space:]]*\*\// {=0A= + ARI_OK =3D gensub(/^.*\/\* ARI:[[:space:]]*(.*[^[:space:]])[[:space:]]= *\*\/.*$/, "\\1", 1, $0)=0A= + # print "ARI line found \"" $0 "\""=0A= + # print "ARI_OK \"" ARI_OK "\""=0A= +}=0A= +! /\/\* ARI:[[:space:]]*(.*)[[:space:]]*\*\// {=0A= + ARI_OK =3D ""=0A= +}=0A= +=0A= +=0A= +# Things in comments=0A= +=0A= +BEGIN { doc["GNU/Linux"] =3D "\=0A= +Do not use `Linux'\'', instead use `Linux kernel'\'' or `GNU/Linux system'= \'';\=0A= + comments should clearly differentiate between the two (this test assumes = that\=0A= + word `Linux'\'' appears on the same line as the word `GNU'\'' or `kernel'= \''\=0A= + or a kernel version"=0A= + category["GNU/Linux"] =3D ari_comment=0A= +}=0A= +/(^|[^_[:alnum:]])Linux([^_[:alnum:]]|$)/ \=0A= +&& !/(^|[^_[:alnum:]])Linux\[sic\]([^_[:alnum:]]|$)/ \=0A= +&& !/(^|[^_[:alnum:]])GNU\/Linux([^_[:alnum:]]|$)/ \=0A= +&& !/(^|[^_[:alnum:]])Linux kernel([^_[:alnum:]]|$)/ \=0A= +&& !/(^|[^_[:alnum:]])Linux [:digit:]\.[:digit:]+)/ {=0A= + fail("GNU/Linux")=0A= +}=0A= +=0A= +BEGIN { doc["ARGSUSED"] =3D "\=0A= +Do not use ARGSUSED, unnecessary"=0A= + category["ARGSUSED"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])ARGSUSED([^_[:alnum:]]|$)/ {=0A= + fail("ARGSUSED")=0A= +}=0A= +=0A= +=0A= +# SNIP - Strip out comments - SNIP=0A= +=0A= +FNR =3D=3D 1 {=0A= + comment_p =3D 0=0A= +}=0A= +comment_p && /\*\// { gsub (/^([^\*]|\*+[^\/\*])*\*+\//, " "); comment_p = =3D 0; }=0A= +comment_p { next; }=0A= +!comment_p { gsub (/\/\*([^\*]|\*+[^\/\*])*\*+\//, " "); }=0A= +!comment_p && /(^|[^"])\/\*/ { gsub (/\/\*.*$/, " "); comment_p =3D 1; }= =0A= +=0A= +=0A= +BEGIN { doc["_ markup"] =3D "\=0A= +All messages should be marked up with _."=0A= + category["_ markup"] =3D ari_gettext=0A= +}=0A= +/^[^"]*[[:space:]](warning|error|error_no_arg|query|perror_with_name)[[:sp= ace:]]*\([^_\(a-z]/ {=0A= + if (! /\("%s"/) {=0A= + fail("_ markup")=0A= + }=0A= +}=0A= +=0A= +BEGIN { doc["trailing new line"] =3D "\=0A= +A message should not have a trailing new line"=0A= + category["trailing new line"] =3D ari_gettext=0A= +}=0A= +/(^|[^_[:alnum:]])(warning|error)[[:space:]]*\(_\(".*\\n"\)[\),]/ {=0A= + fail("trailing new line")=0A= +}=0A= +=0A= +# Include files for which GDB has a custom version.=0A= +=0A= +BEGIN { doc["assert.h"] =3D "\=0A= +Do not include assert.h, instead include \"gdb_assert.h\"";=0A= + category["assert.h"] =3D ari_regression=0A= + fix("assert.h", "gdb/gdb_assert.h", 0) # it does not use it=0A= +}=0A= +/^#[[:space:]]*include[[:space:]]+.assert\.h./ {=0A= + fail("assert.h")=0A= +}=0A= +=0A= +BEGIN { doc["dirent.h"] =3D "\=0A= +Do not include dirent.h, instead include gdb_dirent.h"=0A= + category["dirent.h"] =3D ari_regression=0A= +}=0A= +/^#[[:space:]]*include[[:space:]]*.dirent\.h./ {=0A= + fail("dirent.h")=0A= +}=0A= +=0A= +BEGIN { doc["regex.h"] =3D "\=0A= +Do not include regex.h, instead include gdb_regex.h"=0A= + category["regex.h"] =3D ari_regression=0A= + fix("regex.h", "gdb/gdb_regex.h", 1)=0A= +}=0A= +/^#[[:space:]]*include[[:space:]]*.regex\.h./ {=0A= + fail("regex.h")=0A= +}=0A= +=0A= +BEGIN { doc["xregex.h"] =3D "\=0A= +Do not include xregex.h, instead include gdb_regex.h"=0A= + category["xregex.h"] =3D ari_regression=0A= + fix("xregex.h", "gdb/gdb_regex.h", 1)=0A= +}=0A= +/^#[[:space:]]*include[[:space:]]*.xregex\.h./ {=0A= + fail("xregex.h")=0A= +}=0A= +=0A= +BEGIN { doc["gnu-regex.h"] =3D "\=0A= +Do not include gnu-regex.h, instead include gdb_regex.h"=0A= + category["gnu-regex.h"] =3D ari_regression=0A= +}=0A= +/^#[[:space:]]*include[[:space:]]*.gnu-regex\.h./ {=0A= + fail("gnu regex.h")=0A= +}=0A= +=0A= +BEGIN { doc["stat.h"] =3D "\=0A= +Do not include stat.h or sys/stat.h, instead include gdb_stat.h"=0A= + category["stat.h"] =3D ari_regression=0A= + fix("stat.h", "gdb/gdb_stat.h", 1)=0A= +}=0A= +/^#[[:space:]]*include[[:space:]]*.stat\.h./ \=0A= +|| /^#[[:space:]]*include[[:space:]]*.sys\/stat\.h./ {=0A= + fail("stat.h")=0A= +}=0A= +=0A= +BEGIN { doc["wait.h"] =3D "\=0A= +Do not include wait.h or sys/wait.h, instead include gdb_wait.h"=0A= + fix("wait.h", "gdb/gdb_wait.h", 2);=0A= + category["wait.h"] =3D ari_regression=0A= +}=0A= +/^#[[:space:]]*include[[:space:]]*.wait\.h./ \=0A= +|| /^#[[:space:]]*include[[:space:]]*.sys\/wait\.h./ {=0A= + fail("wait.h")=0A= +}=0A= +=0A= +BEGIN { doc["vfork.h"] =3D "\=0A= +Do not include vfork.h, instead include gdb_vfork.h"=0A= + fix("vfork.h", "gdb/gdb_vfork.h", 1);=0A= + category["vfork.h"] =3D ari_regression=0A= +}=0A= +/^#[[:space:]]*include[[:space:]]*.vfork\.h./ {=0A= + fail("vfork.h")=0A= +}=0A= +=0A= +BEGIN { doc["error not internal-warning"] =3D "\=0A= +Do not use error(\"internal-warning\"), instead use internal_warning"=0A= + category["error not internal-warning"] =3D ari_regression=0A= +}=0A= +/error.*\"[Ii]nternal.warning/ {=0A= + fail("error not internal-warning")=0A= +}=0A= +=0A= +BEGIN { doc["%p"] =3D "\=0A= +Do not use printf(\"%p\"), instead use printf(\"%s\",paddr()) to dump a \= =0A= +target address, or host_address_to_string() for a host address"=0A= + category["%p"] =3D ari_code=0A= +}=0A= +/%p/ && !/%prec/ {=0A= + fail("%p")=0A= +}=0A= +=0A= +BEGIN { doc["%ll"] =3D "\=0A= +Do not use printf(\"%ll\"), instead use printf(\"%s\",phex()) to dump a \= =0A= +`long long'\'' value"=0A= + category["%ll"] =3D ari_code=0A= +}=0A= +# Allow %ll in scanf=0A= +/%[0-9]*ll/ && !/scanf \(.*%[0-9]*ll/ {=0A= + fail("%ll")=0A= +}=0A= +=0A= +=0A= +# SNIP - Strip out strings - SNIP=0A= +=0A= +# Test on top.c, scm-valprint.c, remote-rdi.c, ada-lang.c=0A= +FNR =3D=3D 1 {=0A= + string_p =3D 0=0A= + trace_string =3D 0=0A= +}=0A= +# Strip escaped characters.=0A= +{ gsub(/\\./, "."); }=0A= +# Strip quoted quotes.=0A= +{ gsub(/'\''.'\''/, "'\''.'\''"); }=0A= +# End of multi-line string=0A= +string_p && /\"/ {=0A= + if (trace_string) print "EOS:" FNR, $0;=0A= + gsub (/^[^\"]*\"/, "'\''");=0A= + string_p =3D 0;=0A= +}=0A= +# Middle of multi-line string, discard line.=0A= +string_p {=0A= + if (trace_string) print "MOS:" FNR, $0;=0A= + $0 =3D ""=0A= +}=0A= +# Strip complete strings from the middle of the line=0A= +!string_p && /\"[^\"]*\"/ {=0A= + if (trace_string) print "COS:" FNR, $0;=0A= + gsub (/\"[^\"]*\"/, "'\''");=0A= +}=0A= +# Start of multi-line string=0A= +BEGIN { doc["multi-line string"] =3D "\=0A= +Multi-line string must have the newline escaped"=0A= + category["multi-line string"] =3D ari_regression=0A= +}=0A= +!string_p && /\"/ {=0A= + if (trace_string) print "SOS:" FNR, $0;=0A= + if (/[^\\]$/) {=0A= + fail("multi-line string")=0A= + }=0A= + gsub (/\"[^\"]*$/, "'\''");=0A= + string_p =3D 1;=0A= +}=0A= +# { print }=0A= +=0A= +# Multi-line string=0A= +string_p &&=0A= +=0A= +# Accumulate continuation lines=0A= +FNR =3D=3D 1 {=0A= + cont_p =3D 0=0A= +}=0A= +!cont_p { full_line =3D ""; }=0A= +/[^\\]\\$/ { gsub (/\\$/, ""); full_line =3D full_line $0; cont_p =3D 1; n= ext; }=0A= +cont_p { $0 =3D full_line $0; cont_p =3D 0; full_line =3D ""; }=0A= +=0A= +=0A= +# GDB uses ISO C 90. Check for any non pure ISO C 90 code=0A= +=0A= +BEGIN { doc["PARAMS"] =3D "\=0A= +Do not use PARAMS(), ISO C 90 implies prototypes"=0A= + category["PARAMS"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])PARAMS([^_[:alnum:]]|$)/ {=0A= + fail("PARAMS")=0A= +}=0A= +=0A= +BEGIN { doc["__func__"] =3D "\=0A= +Do not use __func__, ISO C 90 does not support this macro"=0A= + category["__func__"] =3D ari_regression=0A= + fix("__func__", "gdb/gdb_assert.h", 1)=0A= +}=0A= +/(^|[^_[:alnum:]])__func__([^_[:alnum:]]|$)/ {=0A= + fail("__func__")=0A= +}=0A= +=0A= +BEGIN { doc["__FUNCTION__"] =3D "\=0A= +Do not use __FUNCTION__, ISO C 90 does not support this macro"=0A= + category["__FUNCTION__"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])__FUNCTION__([^_[:alnum:]]|$)/ {=0A= + fail("__FUNCTION__")=0A= +}=0A= +=0A= +BEGIN { doc["__CYGWIN32__"] =3D "\=0A= +Do not use __CYGWIN32__, instead use __CYGWIN__ or, better, an explicit \= =0A= +autoconf tests"=0A= + category["__CYGWIN32__"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])__CYGWIN32__([^_[:alnum:]]|$)/ {=0A= + fail("__CYGWIN32__")=0A= +}=0A= +=0A= +BEGIN { doc["PTR"] =3D "\=0A= +Do not use PTR, ISO C 90 implies `void *'\''"=0A= + category["PTR"] =3D ari_regression=0A= + #fix("PTR", "gdb/utils.c", 6)=0A= +}=0A= +/(^|[^_[:alnum:]])PTR([^_[:alnum:]]|$)/ {=0A= + fail("PTR")=0A= +}=0A= +=0A= +BEGIN { doc["UCASE function"] =3D "\=0A= +Function name is uppercase."=0A= + category["UCASE function"] =3D ari_code=0A= + possible_UCASE =3D 0=0A= + UCASE_full_line =3D ""=0A= +}=0A= +(possible_UCASE) {=0A= + if (ARI_OK =3D=3D "UCASE function") {=0A= + possible_UCASE =3D 0=0A= + }=0A= + # Closing brace found?=0A= + else if (UCASE_full_line ~ \=0A= + /^[A-Z][[:alnum:]_]*[[:space:]]*\([^()]*\).*$/) {=0A= + if ((UCASE_full_line ~ \=0A= + /^[A-Z][[:alnum:]_]*[[:space:]]*\([^()]*\)[[:space:]]*$/) \=0A= + && ($0 ~ /^\{/) && (is_yacc_or_lex =3D=3D 0)) {=0A= + store_FNR =3D FNR=0A= + FNR =3D possible_FNR=0A= + store_0 =3D $0;=0A= + $0 =3D UCASE_full_line;=0A= + fail("UCASE function")=0A= + FNR =3D store_FNR=0A= + $0 =3D store_0;=0A= + }=0A= + possible_UCASE =3D 0=0A= + UCASE_full_line =3D ""=0A= + } else {=0A= + UCASE_full_line =3D UCASE_full_line $0;=0A= + }=0A= +}=0A= +/^[A-Z][[:alnum:]_]*[[:space:]]*\([^()]*(|\))[[:space:]]*$/ {=0A= + possible_UCASE =3D 1=0A= + if (ARI_OK =3D=3D "UCASE function") {=0A= + possible_UCASE =3D 0=0A= + }=0A= + possible_FNR =3D FNR=0A= + UCASE_full_line =3D $0=0A= +}=0A= +=0A= +=0A= +BEGIN { doc["editCase function"] =3D "\=0A= +Function name starts lower case but has uppercased letters."=0A= + category["editCase function"] =3D ari_code=0A= + possible_editCase =3D 0=0A= + editCase_full_line =3D ""=0A= +}=0A= +(possible_editCase) {=0A= + if (ARI_OK =3D=3D "ediCase function") {=0A= + possible_editCase =3D 0=0A= + }=0A= + # Closing brace found?=0A= + else if (editCase_full_line ~ \=0A= +/^[a-z][a-z0-9_]*[A-Z][a-z0-9A-Z_]*[[:space:]]*\([^()]*\).*$/) {=0A= + if ((editCase_full_line ~ \=0A= +/^[a-z][a-z0-9_]*[A-Z][a-z0-9A-Z_]*[[:space:]]*\([^()]*\)[[:space:]]*$/) \= =0A= + && ($0 ~ /^\{/) && (is_yacc_or_lex =3D=3D 0)) {=0A= + store_FNR =3D FNR=0A= + FNR =3D possible_FNR=0A= + store_0 =3D $0;=0A= + $0 =3D editCase_full_line;=0A= + fail("editCase function")=0A= + FNR =3D store_FNR=0A= + $0 =3D store_0;=0A= + }=0A= + possible_editCase =3D 0=0A= + editCase_full_line =3D ""=0A= + } else {=0A= + editCase_full_line =3D editCase_full_line $0;=0A= + }=0A= +}=0A= +/^[a-z][a-z0-9_]*[A-Z][a-z0-9A-Z_]*[[:space:]]*\([^()]*(|\))[[:space:]]*$/= {=0A= + possible_editCase =3D 1=0A= + if (ARI_OK =3D=3D "editCase function") {=0A= + possible_editCase =3D 0=0A= + }=0A= + possible_FNR =3D FNR=0A= + editCase_full_line =3D $0=0A= +}=0A= +=0A= +# Only function implementation should be on first column=0A= +BEGIN { doc["function call in first column"] =3D "\=0A= +Function name in first column should be restricted to function implementat= ion"=0A= + category["function call in first column"] =3D ari_code=0A= +}=0A= +/^[a-z][a-z0-9_]*[[:space:]]*\((|[^*][^()]*)\)[[:space:]]*[^ \t]+/ {=0A= + fail("function call in first column")=0A= +}=0A= +=0A= +=0A= +# Functions without any parameter should have (void)=0A= +# after their name not simply ().=0A= +BEGIN { doc["no parameter function"] =3D "\=0A= +Function having no parameter should be declared with funcname (void)."=0A= + category["no parameter function"] =3D ari_code=0A= +}=0A= +/^[a-zA-Z][a-z0-9A-Z_]*[[:space:]]*\(\)/ {=0A= + fail("no parameter function")=0A= +}=0A= +=0A= +BEGIN { doc["hash"] =3D "\=0A= +Do not use ` #...'\'', instead use `#...'\''(some compilers only correctly= \=0A= +parse a C preprocessor directive when `#'\'' is the first character on \= =0A= +the line)"=0A= + category["hash"] =3D ari_regression=0A= +}=0A= +/^[[:space:]]+#/ {=0A= + fail("hash")=0A= +}=0A= +=0A= +BEGIN { doc["OP eol"] =3D "\=0A= +Do not use &&, or || at the end of a line"=0A= + category["OP eol"] =3D ari_code=0A= +}=0A= +/(\|\||\&\&|=3D=3D|!=3D)[[:space:]]*$/ {=0A= + fail("OP eol")=0A= +}=0A= +=0A= +BEGIN { doc["strerror"] =3D "\=0A= +Do not use strerror(), instead use safe_strerror()"=0A= + category["strerror"] =3D ari_regression=0A= + fix("strerror", "gdb/gdb_string.h", 1)=0A= + fix("strerror", "gdb/mingw-hdep.c", 1)=0A= + fix("strerror", "gdb/posix-hdep.c", 1)=0A= +}=0A= +/(^|[^_[:alnum:]])strerror[[:space:]]*\(/ {=0A= + fail("strerror")=0A= +}=0A= +=0A= +BEGIN { doc["long long"] =3D "\=0A= +Do not use `long long'\'', instead use LONGEST"=0A= + category["long long"] =3D ari_code=0A= + # defs.h needs two such patterns for LONGEST and ULONGEST definitions= =0A= + fix("long long", "gdb/defs.h", 2)=0A= +}=0A= +/(^|[^_[:alnum:]])long[[:space:]]+long([^_[:alnum:]]|$)/ {=0A= + fail("long long")=0A= +}=0A= +=0A= +BEGIN { doc["ATTRIBUTE_UNUSED"] =3D "\=0A= +Do not use ATTRIBUTE_UNUSED, do not bother (GDB is compiled with -Werror a= nd, \=0A= +consequently, is not able to tolerate false warnings. Since -Wunused-para= m \=0A= +produces such warnings, neither that warning flag nor ATTRIBUTE_UNUSED \= =0A= +are used by GDB"=0A= + category["ATTRIBUTE_UNUSED"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])ATTRIBUTE_UNUSED([^_[:alnum:]]|$)/ {=0A= + fail("ATTRIBUTE_UNUSED")=0A= +}=0A= +=0A= +BEGIN { doc["ATTR_FORMAT"] =3D "\=0A= +Do not use ATTR_FORMAT, use ATTRIBUTE_PRINTF instead"=0A= + category["ATTR_FORMAT"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])ATTR_FORMAT([^_[:alnum:]]|$)/ {=0A= + fail("ATTR_FORMAT")=0A= +}=0A= +=0A= +BEGIN { doc["ATTR_NORETURN"] =3D "\=0A= +Do not use ATTR_NORETURN, use ATTRIBUTE_NORETURN instead"=0A= + category["ATTR_NORETURN"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])ATTR_NORETURN([^_[:alnum:]]|$)/ {=0A= + fail("ATTR_NORETURN")=0A= +}=0A= +=0A= +BEGIN { doc["NORETURN"] =3D "\=0A= +Do not use NORETURN, use ATTRIBUTE_NORETURN instead"=0A= + category["NORETURN"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])NORETURN([^_[:alnum:]]|$)/ {=0A= + fail("NORETURN")=0A= +}=0A= +=0A= +=0A= +# General problems=0A= +=0A= +BEGIN { doc["multiple messages"] =3D "\=0A= +Do not use multiple calls to warning or error, instead use a single call"= =0A= + category["multiple messages"] =3D ari_gettext=0A= +}=0A= +FNR =3D=3D 1 {=0A= + warning_fnr =3D -1=0A= +}=0A= +/(^|[^_[:alnum:]])(warning|error)[[:space:]]*\(/ {=0A= + if (FNR =3D=3D warning_fnr + 1) {=0A= + fail("multiple messages")=0A= + } else {=0A= + warning_fnr =3D FNR=0A= + }=0A= +}=0A= +=0A= +# Commented out, but left inside sources, just in case.=0A= +# BEGIN { doc["inline"] =3D "\=0A= +# Do not use the inline attribute; \=0A= +# since the compiler generally ignores this, better algorithm selection \= =0A= +# is needed to improved performance"=0A= +# category["inline"] =3D ari_code=0A= +# }=0A= +# /(^|[^_[:alnum:]])inline([^_[:alnum:]]|$)/ {=0A= +# fail("inline")=0A= +# }=0A= +=0A= +# This test is obsolete as this type=0A= +# has been deprecated and finally suppressed from GDB sources=0A= +#BEGIN { doc["obj_private"] =3D "\=0A= +#Replace obj_private with objfile_data"=0A= +# category["obj_private"] =3D ari_obsolete=0A= +#}=0A= +#/(^|[^_[:alnum:]])obj_private([^_[:alnum:]]|$)/ {=0A= +# fail("obj_private")=0A= +#}=0A= +=0A= +BEGIN { doc["abort"] =3D "\=0A= +Do not use abort, instead use internal_error; GDB should never abort"=0A= + category["abort"] =3D ari_regression=0A= + fix("abort", "gdb/utils.c", 3)=0A= +}=0A= +/(^|[^_[:alnum:]])abort[[:space:]]*\(/ {=0A= + fail("abort")=0A= +}=0A= +=0A= +BEGIN { doc["basename"] =3D "\=0A= +Do not use basename, instead use lbasename"=0A= + category["basename"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])basename[[:space:]]*\(/ {=0A= + fail("basename")=0A= +}=0A= +=0A= +BEGIN { doc["assert"] =3D "\=0A= +Do not use assert, instead use gdb_assert or internal_error; assert \=0A= +calls abort and GDB should never call abort"=0A= + category["assert"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])assert[[:space:]]*\(/ {=0A= + fail("assert")=0A= +}=0A= +=0A= +BEGIN { doc["TARGET_HAS_HARDWARE_WATCHPOINTS"] =3D "\=0A= +Replace TARGET_HAS_HARDWARE_WATCHPOINTS with nothing, not needed"=0A= + category["TARGET_HAS_HARDWARE_WATCHPOINTS"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])TARGET_HAS_HARDWARE_WATCHPOINTS([^_[:alnum:]]|$)/ {=0A= + fail("TARGET_HAS_HARDWARE_WATCHPOINTS")=0A= +}=0A= +=0A= +BEGIN { doc["ADD_SHARED_SYMBOL_FILES"] =3D "\=0A= +Replace ADD_SHARED_SYMBOL_FILES with nothing, not needed?"=0A= + category["ADD_SHARED_SYMBOL_FILES"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])ADD_SHARED_SYMBOL_FILES([^_[:alnum:]]|$)/ {=0A= + fail("ADD_SHARED_SYMBOL_FILES")=0A= +}=0A= +=0A= +BEGIN { doc["SOLIB_ADD"] =3D "\=0A= +Replace SOLIB_ADD with nothing, not needed?"=0A= + category["SOLIB_ADD"] =3D ari_deprecate=0A= +}=0A= +/(^|[^_[:alnum:]])SOLIB_ADD([^_[:alnum:]]|$)/ {=0A= + fail("SOLIB_ADD")=0A= +}=0A= +=0A= +BEGIN { doc["SOLIB_CREATE_INFERIOR_HOOK"] =3D "\=0A= +Replace SOLIB_CREATE_INFERIOR_HOOK with nothing, not needed?"=0A= + category["SOLIB_CREATE_INFERIOR_HOOK"] =3D ari_deprecate=0A= +}=0A= +/(^|[^_[:alnum:]])SOLIB_CREATE_INFERIOR_HOOK([^_[:alnum:]]|$)/ {=0A= + fail("SOLIB_CREATE_INFERIOR_HOOK")=0A= +}=0A= +=0A= +BEGIN { doc["SOLIB_LOADED_LIBRARY_PATHNAME"] =3D "\=0A= +Replace SOLIB_LOADED_LIBRARY_PATHNAME with nothing, not needed?"=0A= + category["SOLIB_LOADED_LIBRARY_PATHNAME"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])SOLIB_LOADED_LIBRARY_PATHNAME([^_[:alnum:]]|$)/ {=0A= + fail("SOLIB_LOADED_LIBRARY_PATHNAME")=0A= +}=0A= +=0A= +BEGIN { doc["REGISTER_U_ADDR"] =3D "\=0A= +Replace REGISTER_U_ADDR with nothing, not needed?"=0A= + category["REGISTER_U_ADDR"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])REGISTER_U_ADDR([^_[:alnum:]]|$)/ {=0A= + fail("REGISTER_U_ADDR")=0A= +}=0A= +=0A= +BEGIN { doc["PROCESS_LINENUMBER_HOOK"] =3D "\=0A= +Replace PROCESS_LINENUMBER_HOOK with nothing, not needed?"=0A= + category["PROCESS_LINENUMBER_HOOK"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])PROCESS_LINENUMBER_HOOK([^_[:alnum:]]|$)/ {=0A= + fail("PROCESS_LINENUMBER_HOOK")=0A= +}=0A= +=0A= +BEGIN { doc["PC_SOLIB"] =3D "\=0A= +Replace PC_SOLIB with nothing, not needed?"=0A= + category["PC_SOLIB"] =3D ari_deprecate=0A= +}=0A= +/(^|[^_[:alnum:]])PC_SOLIB([^_[:alnum:]]|$)/ {=0A= + fail("PC_SOLIB")=0A= +}=0A= +=0A= +BEGIN { doc["IN_SOLIB_DYNSYM_RESOLVE_CODE"] =3D "\=0A= +Replace IN_SOLIB_DYNSYM_RESOLVE_CODE with nothing, not needed?"=0A= + category["IN_SOLIB_DYNSYM_RESOLVE_CODE"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])IN_SOLIB_DYNSYM_RESOLVE_CODE([^_[:alnum:]]|$)/ {=0A= + fail("IN_SOLIB_DYNSYM_RESOLVE_CODE")=0A= +}=0A= +=0A= +BEGIN { doc["GCC_COMPILED_FLAG_SYMBOL"] =3D "\=0A= +Replace GCC_COMPILED_FLAG_SYMBOL with nothing, not needed?"=0A= + category["GCC_COMPILED_FLAG_SYMBOL"] =3D ari_deprecate=0A= +}=0A= +/(^|[^_[:alnum:]])GCC_COMPILED_FLAG_SYMBOL([^_[:alnum:]]|$)/ {=0A= + fail("GCC_COMPILED_FLAG_SYMBOL")=0A= +}=0A= +=0A= +BEGIN { doc["GCC2_COMPILED_FLAG_SYMBOL"] =3D "\=0A= +Replace GCC2_COMPILED_FLAG_SYMBOL with nothing, not needed?"=0A= + category["GCC2_COMPILED_FLAG_SYMBOL"] =3D ari_deprecate=0A= +}=0A= +/(^|[^_[:alnum:]])GCC2_COMPILED_FLAG_SYMBOL([^_[:alnum:]]|$)/ {=0A= + fail("GCC2_COMPILED_FLAG_SYMBOL")=0A= +}=0A= +=0A= +BEGIN { doc["FUNCTION_EPILOGUE_SIZE"] =3D "\=0A= +Replace FUNCTION_EPILOGUE_SIZE with nothing, not needed?"=0A= + category["FUNCTION_EPILOGUE_SIZE"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])FUNCTION_EPILOGUE_SIZE([^_[:alnum:]]|$)/ {=0A= + fail("FUNCTION_EPILOGUE_SIZE")=0A= +}=0A= +=0A= +BEGIN { doc["HAVE_VFORK"] =3D "\=0A= +Do not use HAVE_VFORK, instead include \"gdb_vfork.h\" and call vfork() \= =0A= +unconditionally"=0A= + category["HAVE_VFORK"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])HAVE_VFORK([^_[:alnum:]]|$)/ {=0A= + fail("HAVE_VFORK")=0A= +}=0A= +=0A= +BEGIN { doc["bcmp"] =3D "\=0A= +Do not use bcmp(), ISO C 90 implies memcmp()"=0A= + category["bcmp"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])bcmp[[:space:]]*\(/ {=0A= + fail("bcmp")=0A= +}=0A= +=0A= +BEGIN { doc["setlinebuf"] =3D "\=0A= +Do not use setlinebuf(), ISO C 90 implies setvbuf()"=0A= + category["setlinebuf"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])setlinebuf[[:space:]]*\(/ {=0A= + fail("setlinebuf")=0A= +}=0A= +=0A= +BEGIN { doc["bcopy"] =3D "\=0A= +Do not use bcopy(), ISO C 90 implies memcpy() and memmove()"=0A= + category["bcopy"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])bcopy[[:space:]]*\(/ {=0A= + fail("bcopy")=0A= +}=0A= +=0A= +BEGIN { doc["get_frame_base"] =3D "\=0A= +Replace get_frame_base with get_frame_id, get_frame_base_address, \=0A= +get_frame_locals_address, or get_frame_args_address."=0A= + category["get_frame_base"] =3D ari_obsolete=0A= +}=0A= +/(^|[^_[:alnum:]])get_frame_base([^_[:alnum:]]|$)/ {=0A= + fail("get_frame_base")=0A= +}=0A= +=0A= +BEGIN { doc["floatformat_to_double"] =3D "\=0A= +Do not use floatformat_to_double() from libierty, \=0A= +instead use floatformat_to_doublest()"=0A= + fix("floatformat_to_double", "gdb/doublest.c", 1)=0A= + category["floatformat_to_double"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])floatformat_to_double[[:space:]]*\(/ {=0A= + fail("floatformat_to_double")=0A= +}=0A= +=0A= +BEGIN { doc["floatformat_from_double"] =3D "\=0A= +Do not use floatformat_from_double() from libierty, \=0A= +instead use floatformat_from_doublest()"=0A= + category["floatformat_from_double"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])floatformat_from_double[[:space:]]*\(/ {=0A= + fail("floatformat_from_double")=0A= +}=0A= +=0A= +BEGIN { doc["BIG_ENDIAN"] =3D "\=0A= +Do not use BIG_ENDIAN, instead use BFD_ENDIAN_BIG"=0A= + category["BIG_ENDIAN"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])BIG_ENDIAN([^_[:alnum:]]|$)/ {=0A= + fail("BIG_ENDIAN")=0A= +}=0A= +=0A= +BEGIN { doc["LITTLE_ENDIAN"] =3D "\=0A= +Do not use LITTLE_ENDIAN, instead use BFD_ENDIAN_LITTLE";=0A= + category["LITTLE_ENDIAN"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])LITTLE_ENDIAN([^_[:alnum:]]|$)/ {=0A= + fail("LITTLE_ENDIAN")=0A= +}=0A= +=0A= +BEGIN { doc["BIG_ENDIAN"] =3D "\=0A= +Do not use BIG_ENDIAN, instead use BFD_ENDIAN_BIG"=0A= + category["BIG_ENDIAN"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])BIG_ENDIAN([^_[:alnum:]]|$)/ {=0A= + fail("BIG_ENDIAN")=0A= +}=0A= +=0A= +BEGIN { doc["sec_ptr"] =3D "\=0A= +Instead of sec_ptr, use struct bfd_section";=0A= + category["sec_ptr"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])sec_ptr([^_[:alnum:]]|$)/ {=0A= + fail("sec_ptr")=0A= +}=0A= +=0A= +BEGIN { doc["frame_unwind_unsigned_register"] =3D "\=0A= +Replace frame_unwind_unsigned_register with frame_unwind_register_unsigned= "=0A= + category["frame_unwind_unsigned_register"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])frame_unwind_unsigned_register([^_[:alnum:]]|$)/ {=0A= + fail("frame_unwind_unsigned_register")=0A= +}=0A= +=0A= +BEGIN { doc["frame_register_read"] =3D "\=0A= +Replace frame_register_read() with get_frame_register(), or \=0A= +possibly introduce a new method safe_get_frame_register()"=0A= + category["frame_register_read"] =3D ari_obsolete=0A= +}=0A= +/(^|[^_[:alnum:]])frame_register_read([^_[:alnum:]]|$)/ {=0A= + fail("frame_register_read")=0A= +}=0A= +=0A= +BEGIN { doc["read_register"] =3D "\=0A= +Replace read_register() with regcache_read() et.al."=0A= + category["read_register"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])read_register([^_[:alnum:]]|$)/ {=0A= + fail("read_register")=0A= +}=0A= +=0A= +BEGIN { doc["write_register"] =3D "\=0A= +Replace write_register() with regcache_read() et.al."=0A= + category["write_register"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])write_register([^_[:alnum:]]|$)/ {=0A= + fail("write_register")=0A= +}=0A= +=0A= +function report(name) {=0A= + # Drop any trailing _P.=0A= + name =3D gensub(/(_P|_p)$/, "", 1, name)=0A= + # Convert to lower case=0A= + name =3D tolower(name)=0A= + # Split into category and bug=0A= + cat =3D gensub(/^([[:alpha:]]+)_([_[:alnum:]]*)$/, "\\1", 1, name)=0A= + bug =3D gensub(/^([[:alpha:]]+)_([_[:alnum:]]*)$/, "\\2", 1, name)=0A= + # Report it=0A= + name =3D cat " " bug=0A= + doc[name] =3D "Do not use " cat " " bug ", see declaration for details= "=0A= + category[name] =3D cat=0A= + fail(name)=0A= +}=0A= +=0A= +/(^|[^_[:alnum:]])(DEPRECATED|deprecated|set_gdbarch_deprecated|LEGACY|leg= acy|set_gdbarch_legacy)_/ {=0A= + line =3D $0=0A= + # print "0 =3D", $0=0A= + while (1) {=0A= + name =3D gensub(/^(|.*[^_[:alnum:]])((DEPRECATED|deprecated|LEGACY|legacy= )_[_[:alnum:]]*)(.*)$/, "\\2", 1, line)=0A= + line =3D gensub(/^(|.*[^_[:alnum:]])((DEPRECATED|deprecated|LEGACY|legacy= )_[_[:alnum:]]*)(.*)$/, "\\1 \\4", 1, line)=0A= + # print "name =3D", name, "line =3D", line=0A= + if (name =3D=3D line) break;=0A= + report(name)=0A= + }=0A= +}=0A= +=0A= +# Count the number of times each architecture method is set=0A= +/(^|[^_[:alnum:]])set_gdbarch_[_[:alnum:]]*([^_[:alnum:]]|$)/ {=0A= + name =3D gensub(/^.*set_gdbarch_([_[:alnum:]]*).*$/, "\\1", 1, $0)=0A= + doc["set " name] =3D "\=0A= +Call to set_gdbarch_" name=0A= + category["set " name] =3D ari_gdbarch=0A= + fail("set " name)=0A= +}=0A= +=0A= +# Count the number of times each tm/xm/nm macro is defined or undefined=0A= +/^#[[:space:]]*(undef|define)[[:space:]]+[[:alnum:]_]+.*$/ \=0A= +&& !/^#[[:space:]]*(undef|define)[[:space:]]+[[:alnum:]_]+_H($|[[:space:]]= )/ \=0A= +&& FILENAME ~ /(^|\/)config\/(|[^\/]*\/)(tm-|xm-|nm-).*\.h$/ {=0A= + basename =3D gensub(/(^|.*\/)([^\/]*)$/, "\\2", 1, FILENAME)=0A= + type =3D gensub(/^(tm|xm|nm)-.*\.h$/, "\\1", 1, basename)=0A= + name =3D gensub(/^#[[:space:]]*(undef|define)[[:space:]]+([[:alnum:]_]= +).*$/, "\\2", 1, $0)=0A= + if (type =3D=3D basename) {=0A= + type =3D "macro"=0A= + }=0A= + doc[type " " name] =3D "\=0A= +Do not define macros such as " name " in a tm, nm or xm file, \=0A= +in fact do not provide a tm, nm or xm file"=0A= + category[type " " name] =3D ari_macro=0A= + fail(type " " name)=0A= +}=0A= +=0A= +BEGIN { doc["deprecated_registers"] =3D "\=0A= +Replace deprecated_registers with nothing, they have reached \=0A= +end-of-life"=0A= + category["deprecated_registers"] =3D ari_eol=0A= +}=0A= +/(^|[^_[:alnum:]])deprecated_registers([^_[:alnum:]]|$)/ {=0A= + fail("deprecated_registers")=0A= +}=0A= +=0A= +BEGIN { doc["read_pc"] =3D "\=0A= +Replace READ_PC() with frame_pc_unwind; \=0A= +at present the inferior function call code still uses this"=0A= + category["read_pc"] =3D ari_deprecate=0A= +}=0A= +/(^|[^_[:alnum:]])read_pc[[:space:]]*\(/ || \=0A= +/(^|[^_[:alnum:]])set_gdbarch_read_pc[[:space:]]*\(/ || \=0A= +/(^|[^_[:alnum:]])TARGET_READ_PC[[:space:]]*\(/ {=0A= + fail("read_pc")=0A= +}=0A= +=0A= +BEGIN { doc["write_pc"] =3D "\=0A= +Replace write_pc() with get_frame_base_address or get_frame_id; \=0A= +at present the inferior function call code still uses this when doing \=0A= +a DECR_PC_AFTER_BREAK"=0A= + category["write_pc"] =3D ari_deprecate=0A= +}=0A= +/(^|[^_[:alnum:]])write_pc[[:space:]]*\(/ || \=0A= +/(^|[^_[:alnum:]])set_gdbarch_write_pc[[:space:]]*\(/ || \=0A= +/(^|[^_[:alnum:]])TARGET_WRITE_PC[[:space:]]*\(/ {=0A= + fail("write_pc")=0A= +}=0A= +=0A= +BEGIN { doc["generic_target_write_pc"] =3D "\=0A= +Replace generic_target_write_pc with a per-architecture implementation, \= =0A= +this relies on PC_REGNUM which is being eliminated"=0A= + category["generic_target_write_pc"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])generic_target_write_pc([^_[:alnum:]]|$)/ {=0A= + fail("generic_target_write_pc")=0A= +}=0A= +=0A= +BEGIN { doc["read_sp"] =3D "\=0A= +Replace read_sp() with frame_sp_unwind"=0A= + category["read_sp"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])read_sp[[:space:]]*\(/ || \=0A= +/(^|[^_[:alnum:]])set_gdbarch_read_sp[[:space:]]*\(/ || \=0A= +/(^|[^_[:alnum:]])TARGET_READ_SP[[:space:]]*\(/ {=0A= + fail("read_sp")=0A= +}=0A= +=0A= +BEGIN { doc["register_cached"] =3D "\=0A= +Replace register_cached() with nothing, does not have a regcache parameter= "=0A= + category["register_cached"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])register_cached[[:space:]]*\(/ {=0A= + fail("register_cached")=0A= +}=0A= +=0A= +BEGIN { doc["set_register_cached"] =3D "\=0A= +Replace set_register_cached() with nothing, does not have a regcache param= eter"=0A= + category["set_register_cached"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])set_register_cached[[:space:]]*\(/ {=0A= + fail("set_register_cached")=0A= +}=0A= +=0A= +# Print functions: Use versions that either check for buffer overflow=0A= +# or safely allocate a fresh buffer.=0A= +=0A= +BEGIN { doc["sprintf"] =3D "\=0A= +Do not use sprintf, instead use xsnprintf or xstrprintf"=0A= + category["sprintf"] =3D ari_code=0A= +}=0A= +/(^|[^_[:alnum:]])sprintf[[:space:]]*\(/ {=0A= + fail("sprintf")=0A= +}=0A= +=0A= +BEGIN { doc["vsprintf"] =3D "\=0A= +Do not use vsprintf(), instead use xstrvprintf"=0A= + category["vsprintf"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])vsprintf[[:space:]]*\(/ {=0A= + fail("vsprintf")=0A= +}=0A= +=0A= +BEGIN { doc["asprintf"] =3D "\=0A= +Do not use asprintf(), instead use xstrprintf()"=0A= + category["asprintf"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])asprintf[[:space:]]*\(/ {=0A= + fail("asprintf")=0A= +}=0A= +=0A= +BEGIN { doc["vasprintf"] =3D "\=0A= +Do not use vasprintf(), instead use xstrvprintf"=0A= + fix("vasprintf", "gdb/utils.c", 1)=0A= + category["vasprintf"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])vasprintf[[:space:]]*\(/ {=0A= + fail("vasprintf")=0A= +}=0A= +=0A= +BEGIN { doc["xasprintf"] =3D "\=0A= +Do not use xasprintf(), instead use xstrprintf"=0A= + fix("xasprintf", "gdb/defs.h", 1)=0A= + fix("xasprintf", "gdb/utils.c", 1)=0A= + category["xasprintf"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])xasprintf[[:space:]]*\(/ {=0A= + fail("xasprintf")=0A= +}=0A= +=0A= +BEGIN { doc["xvasprintf"] =3D "\=0A= +Do not use xvasprintf(), instead use xstrvprintf"=0A= + fix("xvasprintf", "gdb/defs.h", 1)=0A= + fix("xvasprintf", "gdb/utils.c", 1)=0A= + category["xvasprintf"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])xvasprintf[[:space:]]*\(/ {=0A= + fail("xvasprintf")=0A= +}=0A= +=0A= +# More generic memory operations=0A= +=0A= +BEGIN { doc["bzero"] =3D "\=0A= +Do not use bzero(), instead use memset()"=0A= + category["bzero"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])bzero[[:space:]]*\(/ {=0A= + fail("bzero")=0A= +}=0A= +=0A= +BEGIN { doc["strdup"] =3D "\=0A= +Do not use strdup(), instead use xstrdup()";=0A= + category["strdup"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])strdup[[:space:]]*\(/ {=0A= + fail("strdup")=0A= +}=0A= +=0A= +BEGIN { doc["strsave"] =3D "\=0A= +Do not use strsave(), instead use xstrdup() et.al."=0A= + category["strsave"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])strsave[[:space:]]*\(/ {=0A= + fail("strsave")=0A= +}=0A= +=0A= +# String compare functions=0A= +=0A= +BEGIN { doc["strnicmp"] =3D "\=0A= +Do not use strnicmp(), instead use strncasecmp()"=0A= + category["strnicmp"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])strnicmp[[:space:]]*\(/ {=0A= + fail("strnicmp")=0A= +}=0A= +=0A= +# Boolean expressions and conditionals=0A= +=0A= +BEGIN { doc["boolean"] =3D "\=0A= +Do not use `boolean'\'', use `int'\'' instead"=0A= + category["boolean"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])boolean([^_[:alnum:]]|$)/ {=0A= + if (is_yacc_or_lex =3D=3D 0) {=0A= + fail("boolean")=0A= + }=0A= +}=0A= +=0A= +BEGIN { doc["false"] =3D "\=0A= +Definitely do not use `false'\'' in boolean expressions"=0A= + category["false"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])false([^_[:alnum:]]|$)/ {=0A= + if (is_yacc_or_lex =3D=3D 0) {=0A= + fail("false")=0A= + }=0A= +}=0A= +=0A= +BEGIN { doc["true"] =3D "\=0A= +Do not try to use `true'\'' in boolean expressions"=0A= + category["true"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])true([^_[:alnum:]]|$)/ {=0A= + if (is_yacc_or_lex =3D=3D 0) {=0A= + fail("true")=0A= + }=0A= +}=0A= +=0A= +# Typedefs that are either redundant or can be reduced to `struct=0A= +# type *''.=0A= +# Must be placed before if assignment otherwise ARI exceptions=0A= +# are not handled correctly.=0A= +=0A= +BEGIN { doc["d_namelen"] =3D "\=0A= +Do not use dirent.d_namelen, instead use NAMELEN"=0A= + category["d_namelen"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])d_namelen([^_[:alnum:]]|$)/ {=0A= + fail("d_namelen")=0A= +}=0A= +=0A= +BEGIN { doc["strlen d_name"] =3D "\=0A= +Do not use strlen dirent.d_name, instead use NAMELEN"=0A= + category["strlen d_name"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])strlen[[:space:]]*\(.*[^_[:alnum:]]d_name([^_[:alnum:]]|= $)/ {=0A= + fail("strlen d_name")=0A= +}=0A= +=0A= +BEGIN { doc["var_boolean"] =3D "\=0A= +Replace var_boolean with add_setshow_boolean_cmd"=0A= + category["var_boolean"] =3D ari_regression=0A= + fix("var_boolean", "gdb/command.h", 1)=0A= + # fix only uses the last directory level=0A= + fix("var_boolean", "cli/cli-decode.c", 2)=0A= +}=0A= +/(^|[^_[:alnum:]])var_boolean([^_[:alnum:]]|$)/ {=0A= + if ($0 !~ /(^|[^_[:alnum:]])case *var_boolean:/) {=0A= + fail("var_boolean")=0A= + }=0A= +}=0A= +=0A= +BEGIN { doc["generic_use_struct_convention"] =3D "\=0A= +Replace generic_use_struct_convention with nothing, \=0A= +EXTRACT_STRUCT_VALUE_ADDRESS is a predicate"=0A= + category["generic_use_struct_convention"] =3D ari_regression=0A= +}=0A= +/(^|[^_[:alnum:]])generic_use_struct_convention([^_[:alnum:]]|$)/ {=0A= + fail("generic_use_struct_convention")=0A= +}=0A= +=0A= +BEGIN { doc["if assignment"] =3D "\=0A= +An IF statement'\''s expression contains an assignment (the GNU coding \= =0A= +standard discourages this)"=0A= + category["if assignment"] =3D ari_code=0A= +}=0A= +BEGIN { doc["if clause more than 50 lines"] =3D "\=0A= +An IF statement'\''s expression expands over 50 lines"=0A= + category["if clause more than 50 lines"] =3D ari_code=0A= +}=0A= +#=0A= +# Accumulate continuation lines=0A= +FNR =3D=3D 1 {=0A= + in_if =3D 0=0A= +}=0A= +=0A= +/(^|[^_[:alnum:]])if / {=0A= + in_if =3D 1;=0A= + if_brace_level =3D 0;=0A= + if_cont_p =3D 0;=0A= + if_count =3D 0;=0A= + if_brace_end_pos =3D 0;=0A= + if_full_line =3D "";=0A= +}=0A= +(in_if) {=0A= + # We want everything up to closing brace of same level=0A= + if_count++;=0A= + if (if_count > 50) {=0A= + print "multiline if: " if_full_line $0=0A= + fail("if clause more than 50 lines")=0A= + if_brace_level =3D 0;=0A= + if_full_line =3D "";=0A= + } else {=0A= + if (if_count =3D=3D 1) {=0A= + i =3D index($0,"if ");=0A= + } else {=0A= + i =3D 1;=0A= + }=0A= + for (i=3Di; i <=3D length($0); i++) {=0A= + char =3D substr($0,i,1);=0A= + if (char =3D=3D "(") { if_brace_level++; }=0A= + if (char =3D=3D ")") {=0A= + if_brace_level--;=0A= + if (!if_brace_level) {=0A= + if_brace_end_pos =3D i;=0A= + after_if =3D substr($0,i+1,length($0));=0A= + # Do not parse what is following=0A= + break;=0A= + }=0A= + }=0A= + }=0A= + if (if_brace_level =3D=3D 0) {=0A= + $0 =3D substr($0,1,i);=0A= + in_if =3D 0;=0A= + } else {=0A= + if_full_line =3D if_full_line $0;=0A= + if_cont_p =3D 1;=0A= + next;=0A= + }=0A= + }=0A= +}=0A= +# if we arrive here, we need to concatenate, but we are at brace level 0= =0A= +=0A= +(if_brace_end_pos) {=0A= + $0 =3D if_full_line substr($0,1,if_brace_end_pos);=0A= + if (if_count > 1) {=0A= + # print "IF: multi line " if_count " found at " FILENAME ":" FNR " \"" $0= "\""=0A= + }=0A= + if_cont_p =3D 0;=0A= + if_full_line =3D "";=0A= +}=0A= +/(^|[^_[:alnum:]])if .* =3D / {=0A= + # print "fail in if " $0=0A= + fail("if assignment")=0A= +}=0A= +(if_brace_end_pos) {=0A= + $0 =3D $0 after_if;=0A= + if_brace_end_pos =3D 0;=0A= + in_if =3D 0;=0A= +}=0A= +=0A= +# Printout of all found bug=0A= +=0A= +BEGIN {=0A= + if (print_doc) {=0A= + for (bug in doc) {=0A= + fail(bug)=0A= + }=0A= + exit=0A= + }=0A= +}' "$@"=0A= +=0A= Index: src/gdb/contrib/ari/gdb_find.sh=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: contrib/ari/gdb_find.sh=0A= diff -N contrib/ari/gdb_find.sh=0A= --- /dev/null 1 Jan 1970 00:00:00 -0000=0A= +++ src/gdb/contrib/ari/gdb_find.sh 14 Jun 2012 10:20:54 -0000=0A= @@ -0,0 +1,41 @@=0A= +#!/bin/sh=0A= +=0A= +# GDB script to create list of files to check using gdb_ari.sh.=0A= +#=0A= +# Copyright (C) 2003-2012 Free Software Foundation, Inc.=0A= +#=0A= +# This file is part of GDB.=0A= +#=0A= +# This program is free software; you can redistribute it and/or modify=0A= +# it under the terms of the GNU General Public License as published by=0A= +# the Free Software Foundation; either version 3 of the License, or=0A= +# (at your option) any later version.=0A= +#=0A= +# This program is distributed in the hope that it will be useful,=0A= +# but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= +# GNU General Public License for more details.=0A= +#=0A= +# You should have received a copy of the GNU General Public License=0A= +# along with this program. If not, see .=0A= +=0A= +# Make certain that the script is not running in an internationalized=0A= +# environment.=0A= +=0A= +LANG=3DC ; export LANG=0A= +LC_ALL=3DC ; export LC_ALL=0A= +=0A= +=0A= +# A find that prunes files that GDB users shouldn't be interested in.=0A= +# Use sort to order files alphabetically.=0A= +=0A= +find "$@" \=0A= + -name testsuite -prune -o \=0A= + -name gdbserver -prune -o \=0A= + -name gnulib -prune -o \=0A= + -name osf-share -prune -o \=0A= + -name '*-stub.c' -prune -o \=0A= + -name '*-exp.c' -prune -o \=0A= + -name ada-lex.c -prune -o \=0A= + -name cp-name-parser.c -prune -o \=0A= + -type f -name '*.[lyhc]' -print | sort=0A= Index: src/gdb/contrib/ari/update-web-ari.sh=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: contrib/ari/update-web-ari.sh=0A= diff -N contrib/ari/update-web-ari.sh=0A= --- /dev/null 1 Jan 1970 00:00:00 -0000=0A= +++ src/gdb/contrib/ari/update-web-ari.sh 14 Jun 2012 10:20:54 -0000=0A= @@ -0,0 +1,921 @@=0A= +#!/bin/sh -x=0A= +=0A= +# GDB script to create GDB ARI web page.=0A= +#=0A= +# Copyright (C) 2001-2012 Free Software Foundation, Inc.=0A= +#=0A= +# This file is part of GDB.=0A= +#=0A= +# This program is free software; you can redistribute it and/or modify=0A= +# it under the terms of the GNU General Public License as published by=0A= +# the Free Software Foundation; either version 3 of the License, or=0A= +# (at your option) any later version.=0A= +#=0A= +# This program is distributed in the hope that it will be useful,=0A= +# but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= +# GNU General Public License for more details.=0A= +#=0A= +# You should have received a copy of the GNU General Public License=0A= +# along with this program. If not, see .=0A= +=0A= +# TODO: setjmp.h, setjmp and longjmp.=0A= +=0A= +# Direct stderr into stdout but still hang onto stderr (/dev/fd/3)=0A= +exec 3>&2 2>&1=0A= +ECHO ()=0A= +{=0A= +# echo "$@" | tee /dev/fd/3 1>&2=0A= + echo "$@" 1>&2=0A= + echo "$@" 1>&3=0A= +}=0A= +=0A= +# Really mindless usage=0A= +if test $# -ne 4=0A= +then=0A= + echo "Usage: $0 " 1>&= 2=0A= + exit 1=0A= +fi=0A= +snapshot=3D$1 ; shift=0A= +tmpdir=3D$1 ; shift=0A= +wwwdir=3D$1 ; shift=0A= +project=3D$1 ; shift=0A= +=0A= +# Try to create destination directory if it doesn't exist yet=0A= +if [ ! -d ${wwwdir} ]=0A= +then=0A= + mkdir -p ${wwwdir}=0A= +fi=0A= +=0A= +# Fail if destination directory doesn't exist or is not writable=0A= +if [ ! -w ${wwwdir} -o ! -d ${wwwdir} ]=0A= +then=0A= + echo ERROR: Can not write to directory ${wwwdir} >&2=0A= + exit 2=0A= +fi=0A= +=0A= +if [ ! -r ${snapshot} ]=0A= +then=0A= + echo ERROR: Can not read snapshot file 1>&2=0A= + exit 1=0A= +fi=0A= +=0A= +# FILE formats=0A= +# ari.*.bug: :: : : =0A= +# ari.*.idx: ::=0A= +# ari.*.doc: :::=0A= +# Where ``*'' is {source,warning,indent,doschk}=0A= +=0A= +unpack_source_p=3Dtrue=0A= +delete_source_p=3Dtrue=0A= +=0A= +check_warning_p=3Dfalse # broken=0A= +check_indent_p=3Dfalse # too slow, too many fail=0A= +check_source_p=3Dtrue=0A= +check_doschk_p=3Dtrue=0A= +check_werror_p=3Dtrue=0A= +=0A= +update_doc_p=3Dtrue=0A= +update_web_p=3Dtrue=0A= +=0A= +if awk --version 2>&1 /dev/null=0A= +then=0A= + AWK=3Dawk=0A= +else=0A= + AWK=3Dgawk=0A= +fi=0A= +export AWK=0A= +=0A= +# Set up a few cleanups=0A= +if ${delete_source_p}=0A= +then=0A= + trap "cd /tmp; rm -rf ${tmpdir}; exit" 0 1 2 15=0A= +fi=0A= +=0A= +=0A= +# If the first parameter is a directory,=0A= +#we just use it as the extracted source=0A= +if [ -d ${snapshot} ]=0A= +then=0A= + module=3D${project}=0A= + srcdir=3D${snapshot}=0A= + aridir=3D${srcdir}/${module}/contrib/ari=0A= + unpack_source_p=3Dfalse=0A= + delete_source_p=3Dfalse=0A= + version_in=3D${srcdir}/${module}/version.in=0A= +else=0A= + # unpack the tar-ball=0A= + if ${unpack_source_p}=0A= + then=0A= + # Was it previously unpacked?=0A= + if ${delete_source_p} || test ! -d ${tmpdir}/${module}*=0A= + then=0A= + /bin/rm -rf "${tmpdir}"=0A= + /bin/mkdir -p ${tmpdir}=0A= + if [ ! -d ${tmpdir} ]=0A= + then=0A= + echo "Problem creating work directory"=0A= + exit 1=0A= + fi=0A= + cd ${tmpdir} || exit 1=0A= + echo `date`: Unpacking tar-ball ...=0A= + case ${snapshot} in=0A= + *.tar.bz2 ) bzcat ${snapshot} ;;=0A= + *.tar ) cat ${snapshot} ;;=0A= + * ) ECHO Bad file ${snapshot} ; exit 1 ;;=0A= + esac | tar xf -=0A= + fi=0A= + fi=0A= +=0A= + module=3D`basename ${snapshot}`=0A= + module=3D`basename ${module} .bz2`=0A= + module=3D`basename ${module} .tar`=0A= + srcdir=3D`echo ${tmpdir}/${module}*`=0A= + aridir=3D${HOME}/ss=0A= + version_in=3D${srcdir}/gdb/version.in=0A= +fi=0A= +=0A= +if [ ! -r ${version_in} ]=0A= +then=0A= + echo ERROR: missing version file 1>&2=0A= + exit 1=0A= +fi=0A= +version=3D`cat ${version_in}`=0A= +=0A= +=0A= +# THIS HAS SUFFERED BIT ROT=0A= +if ${check_warning_p} && test -d "${srcdir}"=0A= +then=0A= + echo `date`: Parsing compiler warnings 1>&2=0A= + cat ${root}/ari.compile | $AWK '=0A= +BEGIN {=0A= + FS=3D":";=0A= +}=0A= +/^[^:]*:[0-9]*: warning:/ {=0A= + file =3D $1;=0A= + #sub (/^.*\//, "", file);=0A= + warning[file] +=3D 1;=0A= +}=0A= +/^[^:]*:[0-9]*: error:/ {=0A= + file =3D $1;=0A= + #sub (/^.*\//, "", file);=0A= + error[file] +=3D 1;=0A= +}=0A= +END {=0A= + for (file in warning) {=0A= + print file ":warning:" level[file]=0A= + }=0A= + for (file in error) {=0A= + print file ":error:" level[file]=0A= + }=0A= +}=0A= +' > ${root}/ari.warning.bug=0A= +fi=0A= +=0A= +# THIS HAS SUFFERED BIT ROT=0A= +if ${check_indent_p} && test -d "${srcdir}"=0A= +then=0A= + printf "Analizing file indentation:" 1>&2=0A= + ( cd "${srcdir}" && /bin/sh ${aridir}/gdb_find.sh ${project} | while r= ead f=0A= + do=0A= + if /bin/sh ${aridir}/gdb_indent.sh < ${f} 2>/dev/null | cmp -s - ${f}=0A= + then=0A= + :=0A= + else=0A= + # ari.*.bug: :: : : =0A= + echo "${f}:0: info: indent: Indentation does not match GNU indent out= put"=0A= + fi=0A= + done ) > ${wwwdir}/ari.indent.bug=0A= + echo ""=0A= +fi=0A= +=0A= +if ${check_source_p} && test -d "${srcdir}"=0A= +then=0A= + bugf=3D${wwwdir}/ari.source.bug=0A= + oldf=3D${wwwdir}/ari.source.old=0A= + srcf=3D${wwwdir}/ari.source.lines=0A= + oldsrcf=3D${wwwdir}/ari.source.lines-old=0A= +=0A= + diff=3D${wwwdir}/ari.source.diff=0A= + diffin=3D${diff}-in=0A= + newf1=3D${bugf}1=0A= + oldf1=3D${oldf}1=0A= + oldpruned=3D${oldf1}-pruned=0A= + newpruned=3D${newf1}-pruned=0A= +=0A= + cp -f ${bugf} ${oldf}=0A= + cp -f ${srcf} ${oldsrcf}=0A= + rm -f ${srcf}=0A= + node=3D`uname -n`=0A= + echo "`date`: Using source lines ${srcf}" 1>&2=0A= + echo "`date`: Checking source code" 1>&2=0A= + ( cd "${srcdir}" && /bin/sh ${aridir}/gdb_find.sh "${project}" | \=0A= + xargs /bin/sh ${aridir}/gdb_ari.sh -Werror -Wall --print-idx --src=3D${sr= cf}=0A= + ) > ${bugf}=0A= + # Remove things we are not interested in to signal by email=0A= + # gdbarch changes are not important here=0A= + # Also convert ` into ' to avoid command substitution in script below= =0A= + sed -e "/.*: gdbarch:.*/d" -e "s:\`:':g" ${oldf} > ${oldf1}=0A= + sed -e "/.*: gdbarch:.*/d" -e "s:\`:':g" ${bugf} > ${newf1}=0A= + # Remove line number info so that code inclusion/deletion=0A= + # has no impact on the result=0A= + sed -e "s/\([^:]*\):\([^:]*\):\(.*\)/\1:0:\3/" ${oldf1} > ${oldpruned}= =0A= + sed -e "s/\([^:]*\):\([^:]*\):\(.*\)/\1:0:\3/" ${newf1} > ${newpruned}= =0A= + # Use diff without option to get normal diff output that=0A= + # is reparsed after=0A= + diff ${oldpruned} ${newpruned} > ${diffin}=0A= + # Only keep new warnings=0A= + sed -n -e "/^>.*/p" ${diffin} > ${diff}=0A= + sedscript=3D${wwwdir}/sedscript=0A= + script=3D${wwwdir}/script=0A= + sed -n -e "s|\(^[0-9,]*\)a\(.*\)|echo \1a\2 \n \=0A= + sed -n \'\2s:\\\\(.*\\\\):> \\\\1:p\' ${newf1}|p" \=0A= + -e "s|\(^[0-9,]*\)d\(.*\)|echo \1d\2\n \=0A= + sed -n \'\1s:\\\\(.*\\\\):< \\\\1:p\' ${oldf1}|p" \=0A= + -e "s|\(^[0-9,]*\)c\(.*\)|echo \1c\2\n \=0A= + sed -n \'\1s:\\\\(.*\\\\):< \\\\1:p\' ${oldf1} \n \=0A= + sed -n \"\2s:\\\\(.*\\\\):> \\\\1:p\" ${newf1}|p" \=0A= + ${diffin} > ${sedscript}=0A= + ${SHELL} ${sedscript} > ${wwwdir}/message=0A= + sed -n \=0A= + -e "s;\(.*\);echo \\\"\1\\\";p" \=0A= + -e "s;.*< \([^:]*\):\([0-9]*\):.*;grep \"^\1:\2:\" ${oldsrcf};p" \=0A= + -e "s;.*> \([^:]*\):\([0-9]*\):.*;grep \"^\1:\2:\" ${srcf};p" \=0A= + ${wwwdir}/message > ${script}=0A= + ${SHELL} ${script} > ${wwwdir}/mail-message=0A= + if [ "x${branch}" !=3D "x" ]; then=0A= + email_suffix=3D"`date` in ${branch}"=0A= + else=0A= + email_suffix=3D"`date`"=0A= + fi=0A= +=0A= +fi=0A= +=0A= +=0A= +=0A= +=0A= +if ${check_doschk_p} && test -d "${srcdir}"=0A= +then=0A= + echo "`date`: Checking for doschk" 1>&2=0A= + rm -f "${wwwdir}"/ari.doschk.*=0A= + fnchange_lst=3D"${srcdir}"/gdb/config/djgpp/fnchange.lst=0A= + fnchange_awk=3D"${wwwdir}"/ari.doschk.awk=0A= + doschk_in=3D"${wwwdir}"/ari.doschk.in=0A= + doschk_out=3D"${wwwdir}"/ari.doschk.out=0A= + doschk_bug=3D"${wwwdir}"/ari.doschk.bug=0A= + doschk_char=3D"${wwwdir}"/ari.doschk.char=0A= +=0A= + # Transform fnchange.lst into fnchange.awk. The program DJTAR=0A= + # does a textual substitution of each file name using the list.=0A= + # Generate an awk script that does the equivalent - matches an=0A= + # exact line and then outputs the replacement.=0A= +=0A= + sed -e 's;@[^@]*@[/]*\([^ ]*\) @[^@]*@[/]*\([^ ]*\);\$0 =3D=3D "\1" { = print "\2"\; next\; };' \=0A= + < "${fnchange_lst}" > "${fnchange_awk}"=0A= + echo '{ print }' >> "${fnchange_awk}"=0A= +=0A= + # Do the raw analysis - transform the list of files into the DJGPP=0A= + # equivalents putting it in the .in file=0A= + ( cd "${srcdir}" && find * \=0A= + -name '*.info-[0-9]*' -prune \=0A= + -o -name tcl -prune \=0A= + -o -name itcl -prune \=0A= + -o -name tk -prune \=0A= + -o -name libgui -prune \=0A= + -o -name tix -prune \=0A= + -o -name dejagnu -prune \=0A= + -o -name expect -prune \=0A= + -o -type f -print ) \=0A= + | $AWK -f ${fnchange_awk} > ${doschk_in}=0A= +=0A= + # Start with a clean slate=0A= + rm -f ${doschk_bug}=0A= +=0A= + # Check for any invalid characters.=0A= + grep '[\+\,\;\=3D\[\]\|\<\>\\\"\:\?\*]' < ${doschk_in} > ${doschk_char= }=0A= + # ari.*.bug: :: : : =0A= + sed < ${doschk_char} >> ${doschk_bug} \=0A= + -e s'/$/:0: dos: DOSCHK: Invalid DOS character/'=0A= +=0A= + # Magic to map ari.doschk.out to ari.doschk.bug goes here=0A= + doschk < ${doschk_in} > ${doschk_out}=0A= + cat ${doschk_out} | $AWK >> ${doschk_bug} '=0A= +BEGIN {=0A= + state =3D 1;=0A= + invalid_dos =3D state++; bug[invalid_dos] =3D "invalid DOS file name";= category[invalid_dos] =3D "dos";=0A= + same_dos =3D state++; bug[same_dos] =3D "DOS 8.3"; = category[same_dos] =3D "dos";=0A= + same_sysv =3D state++; bug[same_sysv] =3D "SysV";=0A= + long_sysv =3D state++; bug[long_sysv] =3D "long SysV";=0A= + internal =3D state++; bug[internal] =3D "internal doschk"; = category[internal] =3D "internal";=0A= + state =3D 0;=0A= +}=0A= +/^$/ { state =3D 0; next; }=0A= +/^The .* not valid DOS/ { state =3D invalid_dos; next; }=0A= +/^The .* same DOS/ { state =3D same_dos; next; }=0A= +/^The .* same SysV/ { state =3D same_sysv; next; }=0A= +/^The .* too long for SysV/ { state =3D long_sysv; next; }=0A= +/^The .* / { state =3D internal; next; }=0A= +=0A= +NF =3D=3D 0 { next }=0A= +=0A= +NF =3D=3D 3 { name =3D $1 ; file =3D $3 }=0A= +NF =3D=3D 1 { file =3D $1 }=0A= +NF > 3 && $2 =3D=3D "-" { file =3D $1 ; name =3D gensub(/^.* - /, "", 1) }= =0A= +=0A= +state =3D=3D same_dos {=0A= + # ari.*.bug: :: : : =0A= + print file ":0: " category[state] ": " \=0A= + name " " bug[state] " " " dup: " \=0A= + " DOSCHK - the names " name " and " file " resolve to the same" \=0A= + " file on a " bug[state] \=0A= + " system.
For DOS, this can be fixed by modifying the file" \=0A= + " fnchange.lst."=0A= + next=0A= +}=0A= +state =3D=3D invalid_dos {=0A= + # ari.*.bug: :: : : =0A= + print file ":0: " category[state] ": " name ": DOSCHK - " name=0A= + next=0A= +}=0A= +state =3D=3D internal {=0A= + # ari.*.bug: :: : : =0A= + print file ":0: " category[state] ": " bug[state] ": DOSCHK - a " \= =0A= + bug[state] " problem"=0A= +}=0A= +'=0A= +fi=0A= +=0A= +=0A= +=0A= +if ${check_werror_p} && test -d "${srcdir}"=0A= +then=0A= + echo "`date`: Checking Makefile.in for non- -Werror rules"=0A= + rm -f ${wwwdir}/ari.werror.*=0A= + cat "${srcdir}/${project}/Makefile.in" | $AWK > ${wwwdir}/ari.werror.b= ug '=0A= +BEGIN {=0A= + count =3D 0=0A= + cont_p =3D 0=0A= + full_line =3D ""=0A= +}=0A= +/^[-_[:alnum:]]+\.o:/ {=0A= + file =3D gensub(/.o:.*/, "", 1) ".c"=0A= +}=0A= +=0A= +/[^\\]\\$/ { gsub (/\\$/, ""); full_line =3D full_line $0; cont_p =3D 1; n= ext; }=0A= +cont_p { $0 =3D full_line $0; cont_p =3D 0; full_line =3D ""; }=0A= +=0A= +/\$\(COMPILE\.pre\)/ {=0A= + print file " has line " $0=0A= + if (($0 !~ /\$\(.*ERROR_CFLAGS\)/) && ($0 !~ /\$\(INTERNAL_CFLAGS\)/))= {=0A= + # ari.*.bug: :: : : =0A= + print "'"${project}"'/" file ":0: info: Werror: The file is not being com= piled with -Werror"=0A= + }=0A= +}=0A= +'=0A= +fi=0A= +=0A= +=0A= +# From the warnings, generate the doc and indexed bug files=0A= +if ${update_doc_p}=0A= +then=0A= + cd ${wwwdir}=0A= + rm -f ari.doc ari.idx ari.doc.bug=0A= + # Generate an extra file containing all the bugs that the ARI can dete= ct.=0A= + /bin/sh ${aridir}/gdb_ari.sh -Werror -Wall --print-idx --print-doc >> = ari.doc.bug=0A= + cat ari.*.bug | $AWK > ari.idx '=0A= +BEGIN {=0A= + FS=3D": *"=0A= +}=0A= +{=0A= + # ari.*.bug: :: : : =0A= + file =3D $1=0A= + line =3D $2=0A= + category =3D $3=0A= + bug =3D $4=0A= + if (! (bug in cat)) {=0A= + cat[bug] =3D category=0A= + # strip any trailing .... (supplement)=0A= + doc[bug] =3D gensub(/ \([^\)]*\)$/, "", 1, $5)=0A= + count[bug] =3D 0=0A= + }=0A= + if (file !=3D "") {=0A= + count[bug] +=3D 1=0A= + # ari.*.idx: ::=0A= + print bug ":" file ":" category=0A= + }=0A= + # Also accumulate some categories as obsolete=0A= + if (category =3D=3D "deprecated") {=0A= + # ari.*.idx: ::=0A= + if (file !=3D "") {=0A= + print category ":" file ":" "obsolete"=0A= + }=0A= + #count[category]++=0A= + #doc[category] =3D "Contains " category " code"=0A= + }=0A= +}=0A= +END {=0A= + i =3D 0;=0A= + for (bug in count) {=0A= + # ari.*.doc: :::=0A= + print bug ":" count[bug] ":" cat[bug] ":" doc[bug] >> "ari.doc"=0A= + }=0A= +}=0A= +'=0A= +fi=0A= +=0A= +=0A= +# print_toc BIAS MIN_COUNT CATEGORIES TITLE=0A= +=0A= +# Print a table of contents containing the bugs CATEGORIES. If the=0A= +# BUG count >=3D MIN_COUNT print it in the table-of-contents. If=0A= +# MIN_COUNT is non -ve, also include a link to the table.Adjust the=0A= +# printed BUG count by BIAS.=0A= +=0A= +all=3D=0A= +=0A= +print_toc ()=0A= +{=0A= + bias=3D"$1" ; shift=0A= + min_count=3D"$1" ; shift=0A= +=0A= + all=3D" $all $1 "=0A= + categories=3D""=0A= + for c in $1; do=0A= + categories=3D"${categories} categories[\"${c}\"] =3D 1 ;"=0A= + done=0A= + shift=0A= +=0A= + title=3D"$@" ; shift=0A= +=0A= + echo "

" >> ${newari}=0A= + echo "" | tr '[A-Z]' '[a-z]' >> ${newari}=0A= + echo "

${title}

" >> ${newari}=0A= + cat >> ${newari} # description=0A= +=0A= + cat >> ${newari} <=0A= +=0A= +=0A= +EOF=0A= + # ari.*.doc: :::=0A= + cat ${wwwdir}/ari.doc \=0A= + | sort -t: +1rn -2 +0d \=0A= + | $AWK >> ${newari} '=0A= +BEGIN {=0A= + FS=3D":"=0A= + '"$categories"'=0A= + MIN_COUNT =3D '${min_count}'=0A= + BIAS =3D '${bias}'=0A= + total =3D 0=0A= + nr =3D 0=0A= +}=0A= +{=0A= + # ari.*.doc: :::=0A= + bug =3D $1=0A= + count =3D $2=0A= + category =3D $3=0A= + doc =3D $4=0A= + if (count < MIN_COUNT) next=0A= + if (!(category in categories)) next=0A= + nr +=3D 1=0A= + total +=3D count=0A= + printf ""=0A= + printf ""=0A= + printf "", bug, count + BIAS=0A= + } else {=0A= + printf "%d", count + BIAS=0A= + }=0A= + printf ""=0A= + printf "", doc=0A= + printf ""=0A= + print ""=0A= +}=0A= +END {=0A= + print ""=0A= +}=0A= +'=0A= +cat >> ${newari} <=0A= +

=0A= +EOF=0A= +}=0A= +=0A= +=0A= +print_table ()=0A= +{=0A= + categories=3D""=0A= + for c in $1; do=0A= + categories=3D"${categories} categories[\"${c}\"] =3D 1 ;"=0A= + done=0A= + # Remember to prune the dir prefix from projects files=0A= + # ari.*.idx: ::=0A= + cat ${wwwdir}/ari.idx | $AWK >> ${newari} '=0A= +function qsort (table,=0A= + middle, tmp, left, nr_left, right, nr_right, result) {=0A= + middle =3D ""=0A= + for (middle in table) { break; }=0A= + nr_left =3D 0;=0A= + nr_right =3D 0;=0A= + for (tmp in table) {=0A= + if (tolower(tmp) < tolower(middle)) {=0A= + nr_left++=0A= + left[tmp] =3D tmp=0A= + } else if (tolower(tmp) > tolower(middle)) {=0A= + nr_right++=0A= + right[tmp] =3D tmp=0A= + }=0A= + }=0A= + #print "qsort " nr_left " " middle " " nr_right > "/dev/stderr"=0A= + result =3D ""=0A= + if (nr_left > 0) {=0A= + result =3D qsort(left) SUBSEP=0A= + }=0A= + result =3D result middle=0A= + if (nr_right > 0) {=0A= + result =3D result SUBSEP qsort(right)=0A= + }=0A= + return result=0A= +}=0A= +function print_heading (where, bug_i) {=0A= + print ""=0A= + print "

"=0A= + print ""=0A= + print ""=0A= + print ""=0A= + for (bug_i =3D 1; bug_i <=3D nr_bug; bug_i++) {=0A= + bug =3D i2bug[bug_i];=0A= + printf "\n"=0A= + }=0A= + #print ""=0A= + printf "\n", i2bug[bug_i-1]=0A= + print ""=0A= + print ""=0A= + print ""=0A= +}=0A= +function print_totals (where, bug_i) {=0A= + print ""=0A= + printf "\n"=0A= + print "";=0A= + for (bug_i =3D 1; bug_i <=3D nr_bug; bug_i++) {=0A= + bug =3D i2bug[bug_i];=0A= + printf "";=0A= + print ""=0A= + }=0A= + print ""=0A= + printf "\n"=0A= + print ""=0A= + print ""=0A= +}=0A= +BEGIN {=0A= + FS =3D ":"=0A= + '"${categories}"'=0A= + nr_file =3D 0;=0A= + nr_bug =3D 0;=0A= +}=0A= +{=0A= + # ari.*.idx: ::=0A= + bug =3D $1=0A= + file =3D $2=0A= + category =3D $3=0A= + # Interested in this=0A= + if (!(category in categories)) next=0A= + # Totals=0A= + db[bug, file] +=3D 1=0A= + bug_total[bug] +=3D 1=0A= + file_total[file] +=3D 1=0A= + total +=3D 1=0A= +}=0A= +END {=0A= +=0A= + # Sort the files and bugs creating indexed lists.=0A= + nr_bug =3D split(qsort(bug_total), i2bug, SUBSEP);=0A= + nr_file =3D split(qsort(file_total), i2file, SUBSEP);=0A= +=0A= + # Dummy entries for first/last=0A= + i2file[0] =3D 0=0A= + i2file[-1] =3D -1=0A= + i2bug[0] =3D 0=0A= + i2bug[-1] =3D -1=0A= +=0A= + # Construct a cycle of next/prev links. The file/bug "0" and "-1"=0A= + # are used to identify the start/end of the cycle. Consequently,=0A= + # prev(0) =3D -1 (prev of start is the end) and next(-1) =3D 0 (next= =0A= + # of end is the start).=0A= +=0A= + # For all the bugs, create a cycle that goes to the prev / next file.= =0A= + for (bug_i =3D 1; bug_i <=3D nr_bug; bug_i++) {=0A= + bug =3D i2bug[bug_i]=0A= + prev =3D 0=0A= + prev_file[bug, 0] =3D -1=0A= + next_file[bug, -1] =3D 0=0A= + for (file_i =3D 1; file_i <=3D nr_file; file_i++) {=0A= + file =3D i2file[file_i]=0A= + if ((bug, file) in db) {=0A= + prev_file[bug, file] =3D prev=0A= + next_file[bug, prev] =3D file=0A= + prev =3D file=0A= + }=0A= + }=0A= + prev_file[bug, -1] =3D prev=0A= + next_file[bug, prev] =3D -1=0A= + }=0A= +=0A= + # For all the files, create a cycle that goes to the prev / next bug.= =0A= + for (file_i =3D 1; file_i <=3D nr_file; file_i++) {=0A= + file =3D i2file[file_i]=0A= + prev =3D 0=0A= + prev_bug[file, 0] =3D -1=0A= + next_bug[file, -1] =3D 0=0A= + for (bug_i =3D 1; bug_i <=3D nr_bug; bug_i++) {=0A= + bug =3D i2bug[bug_i]=0A= + if ((bug, file) in db) {=0A= + prev_bug[file, bug] =3D prev=0A= + next_bug[file, prev] =3D bug=0A= + prev =3D bug=0A= + }=0A= + }=0A= + prev_bug[file, -1] =3D prev=0A= + next_bug[file, prev] =3D -1=0A= + }=0A= +=0A= + print "
BUGTotalDescription
", bug=0A= + printf "%s", gensub(/_/, " ", "g", bug)=0A= + printf ""=0A= + if (count > 0 && MIN_COUNT >=3D 0) {=0A= + printf "%d%s
" nr "" total "
FileTotal"=0A= + # The title names are offset by one. Otherwize, when the browser=0A= + # jumps to the name it leaves out half the relevant column.=0A= + #printf " ", bug=0A= + printf " ", i2bug[bug_i-1]=0A= + printf "", bug=0A= + printf "%s", gensub(/_/, " ", "g", bug)=0A= + printf "\n"=0A= + printf " TotalFile
Totals"=0A= + printf "%s", total=0A= + printf ">"=0A= + printf ""=0A= + printf ""=0A= + printf "%d", bug, bug_total[bug]=0A= + printf "";=0A= + printf "^", prev_file[bug, where], bug=0A= + printf "v", next_file[bug, where], bug=0A= + printf " ", where, bug=0A= + printf ""=0A= + printf "%s", total=0A= + printf "<"=0A= + printf "Totals
"=0A= + print ""=0A= + print_heading(0);=0A= + print ""=0A= + print_totals(0);=0A= + print ""=0A= +=0A= + for (file_i =3D 1; file_i <=3D nr_file; file_i++) {=0A= + file =3D i2file[file_i];=0A= + pfile =3D gensub(/^'${project}'\//, "", 1, file)=0A= + print ""=0A= + print ""=0A= + print ""=0A= + printf "\n"=0A= + print ""=0A= + for (bug_i =3D 1; bug_i <=3D nr_bug; bug_i++) {=0A= + bug =3D i2bug[bug_i];=0A= + if ((bug, file) in db) {=0A= + printf ""=0A= + print ""=0A= + } else {=0A= + print ""=0A= + #print ""=0A= + }=0A= + }=0A= + print ""=0A= + printf "\n"=0A= + print ""=0A= + print ""=0A= + }=0A= +=0A= + print ""=0A= + print_totals(-1)=0A= + print ""=0A= + print_heading(-1);=0A= + print ""=0A= + print ""=0A= + print "
" pfile ""=0A= + printf "%s", file_total[file]=0A= + printf ">", file, next_bug[file, 0]=0A= + printf ""=0A= + printf "%d", bug, db[bug, file]=0A= + printf "^", prev_file[bug, file], bug=0A= + printf "v", next_file[bug, file], bug=0A= + printf " ", file, bug=0A= + printf " "=0A= + printf "%s", file_total[file]=0A= + printf "<", file, prev_bug[file, -1]=0A= + printf "" pfile "
"=0A= + print ""=0A= +}=0A= +'=0A= +}=0A= +=0A= +=0A= +# Make the scripts available=0A= +cp ${aridir}/gdb_*.sh ${wwwdir}=0A= +=0A= +# Compute the ARI index - ratio of zero vs non-zero problems.=0A= +indexes=3D`${AWK} '=0A= +BEGIN {=0A= + FS=3D":"=0A= +}=0A= +{=0A= + # ari.*.doc: :::=0A= + bug =3D $1; count =3D $2; category =3D $3; doc =3D $4=0A= +=0A= + if (bug ~ /^legacy_/) legacy++=0A= + if (bug ~ /^deprecated_/) deprecated++=0A= +=0A= + if (category !~ /^gdbarch$/) {=0A= + bugs +=3D count=0A= + }=0A= + if (count =3D=3D 0) {=0A= + oks++=0A= + }=0A= +}=0A= +END {=0A= + #print "tests/ok:", nr / ok=0A= + #print "bugs/tests:", bugs / nr=0A= + #print "bugs/ok:", bugs / ok=0A= + print bugs / ( oks + legacy + deprecated )=0A= +}=0A= +' ${wwwdir}/ari.doc`=0A= +=0A= +# Merge, generating the ARI tables.=0A= +if ${update_web_p}=0A= +then=0A= + echo "Create the ARI table" 1>&2=0A= + oldari=3D${wwwdir}/old.html=0A= + ari=3D${wwwdir}/index.html=0A= + newari=3D${wwwdir}/new.html=0A= + rm -f ${newari} ${newari}.gz=0A= + cat <> ${newari}=0A= +=0A= +=0A= +A.R. Index for GDB version ${version}=0A= +=0A= +=0A= +=0A= +

A.R. Index for GDB version ${version}

=0A= +=0A= +=0A= +=0A= +=0A= +=0A= +

${indexes}

=0A= +

You can not take this seriously!

=0A= +=0A= +
=0A= +Also available:=0A= +most recent branch=0A= +|=0A= +current=0A= +|=0A= +last release=0A= +
=0A= +=0A= +
=0A= +Last updated: `date -u`=0A= +
=0A= +EOF=0A= +=0A= + print_toc 0 1 "internal regression" Critical <> ${newari} '=0A= +BEGIN {=0A= + FS =3D ":"=0A= + '"$alls"'=0A= +}=0A= +{=0A= + # ari.*.doc: :::=0A= + bug =3D $1=0A= + count =3D $2=0A= + category =3D $3=0A= + doc =3D $4=0A= + if (!(category in all)) {=0A= + print "" category ": no documentation
"=0A= + }=0A= +}=0A= +'=0A= +=0A= + cat >> ${newari} <=0A= +Input files:=0A= +`( cd ${wwwdir} && ls ari.*.bug ari.idx ari.doc ) | while read f=0A= +do=0A= + echo "${f}"=0A= +done`=0A= +=0A= +=0A= +
=0A= +Scripts:=0A= +`( cd ${wwwdir} && ls *.sh ) | while read f=0A= +do=0A= + echo "${f}"=0A= +done`=0A= +
=0A= +=0A= +=0A= +=0A= +=0A= +EOF=0A= +=0A= + for i in . .. ../..; do=0A= + x=3D${wwwdir}/${i}/index.sh=0A= + if test -x $x; then=0A= + $x ${newari}=0A= + break=0A= + fi=0A= + done=0A= +=0A= + gzip -c -v -9 ${newari} > ${newari}.gz=0A= +=0A= + cp ${ari} ${oldari}=0A= + cp ${ari}.gz ${oldari}.gz=0A= + cp ${newari} ${ari}=0A= + cp ${newari}.gz ${ari}.gz=0A= +=0A= +fi # update_web_p=0A= +=0A= +# ls -l ${wwwdir}=0A= +=0A= +exit 0=0A= ------=_NextPart_000_0016_01CD4A3A.EF0DA5A0--