From patchwork Sat Dec 29 17:03:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 30900 Received: (qmail 4729 invoked by alias); 29 Dec 2018 17:04:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 4712 invoked by uid 89); 29 Dec 2018 17:04:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=v3, relies, rot X-HELO: gateway36.websitewelcome.com Received: from gateway36.websitewelcome.com (HELO gateway36.websitewelcome.com) (192.185.187.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 29 Dec 2018 17:04:27 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 40E78400E7134 for ; Sat, 29 Dec 2018 10:15:03 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id dI1Qg5gaIYTGMdI1Qgt75L; Sat, 29 Dec 2018 11:03:36 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=E0+4iPLm35Slq5wqufT4SAEIVMLVgSN4pCMxvdjNNqo=; b=b7v9M3lE+xQZsJTuVm0iWEDTTp kC0JuzLWhyZNCco7Dn/ziQAzwUost2eCntEN7c+u6vyN52B/aQBu7qt1pipGrrwJJEI9JKmHlJFvY XDvBe25VGcwBCZYUxOyWtEhMe; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:51764 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gdI1Q-001NMg-Md; Sat, 29 Dec 2018 11:03:36 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Remove gdb_indent.sh Date: Sat, 29 Dec 2018 10:03:33 -0700 Message-Id: <20181229170333.24744-1-tom@tromey.com> gdb_indent.sh relies on GNU indent, which does not handle C++. This patch removes gdb_indent.sh and the (currently disabled) code that uses it in update-web-ari.sh. I've looked into using clang-format to indent gdb, but I think it is unsuitable. The way it reformats argument lists is truly ugly at times. gdb/ChangeLog 2018-12-29 Tom Tromey * contrib/ari/update-web-ari.sh: Remove indent code. * gdb_indent.sh: Remove. --- gdb/ChangeLog | 5 ++ gdb/contrib/ari/update-web-ari.sh | 20 +------ gdb/gdb_indent.sh | 92 ------------------------------- 3 files changed, 6 insertions(+), 111 deletions(-) delete mode 100755 gdb/gdb_indent.sh diff --git a/gdb/contrib/ari/update-web-ari.sh b/gdb/contrib/ari/update-web-ari.sh index 4356f6bb58..35e58adbe5 100644 --- a/gdb/contrib/ari/update-web-ari.sh +++ b/gdb/contrib/ari/update-web-ari.sh @@ -64,13 +64,12 @@ fi # ari.*.bug: :: : : # ari.*.idx: :: # ari.*.doc: ::: -# Where ``*'' is {source,warning,indent,doschk} +# Where ``*'' is {source,warning,doschk} unpack_source_p=true delete_source_p=true check_warning_p=false # broken -check_indent_p=false # too slow, too many fail check_source_p=true check_doschk_p=true check_werror_p=true @@ -173,23 +172,6 @@ END { ' > ${root}/ari.warning.bug fi -# THIS HAS SUFFERED BIT ROT -if ${check_indent_p} && test -d "${srcdir}" -then - printf "Analizing file indentation:" 1>&2 - ( cd "${srcdir}" && /bin/sh ${aridir}/gdb_find.sh ${project} | while read f - do - if /bin/sh ${aridir}/gdb_indent.sh < ${f} 2>/dev/null | cmp -s - ${f} - then - : - else - # ari.*.bug: :: : : - echo "${f}:0: info: indent: Indentation does not match GNU indent output" - fi - done ) > ${wwwdir}/ari.indent.bug - echo "" -fi - if ${check_source_p} && test -d "${srcdir}" then bugf=${wwwdir}/ari.source.bug diff --git a/gdb/gdb_indent.sh b/gdb/gdb_indent.sh deleted file mode 100755 index 115b99521f..0000000000 --- a/gdb/gdb_indent.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh - -# Try to find a GNU indent. There could be a BSD indent in front of a -# GNU gindent so when indent is found, keep looking. - -# Make certain that the script is not running in an internationalized -# environment. -LANG=c ; export LANG -LC_ALL=c ; export LC_ALL - -gindent= -indent= -paths=`echo $PATH | sed \ - -e 's/::/:.:/g' \ - -e 's/^:/.:/' \ - -e 's/:$/:./' \ - -e 's/:/ /g'` -for path in $paths -do - if test ! -n "${gindent}" -a -x ${path}/gindent - then - gindent=${path}/gindent - break - elif test ! -n "${indent}" -a -x ${path}/indent - then - indent=${path}/indent - fi -done - -if test -n "${gindent}" -then - indent=${gindent} -elif test -n "${indent}" -then - : -else - echo "Indent not found" 1>&2 -fi - - -# Check that the indent found is both GNU and a reasonable version. -# Different indent versions give different indentation. - -m1=2 -m2=2 -m3=9 - -version=`${indent} --version 2>/dev/null < /dev/null` -case "${version}" in - *GNU* ) ;; - * ) echo "error: GNU indent $m1.$m2.$m3 expected" 1>&2 ; exit 1;; -esac -v1=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\1/'` -v2=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\2/'` -v3=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\3/'` - -if test $m1 -ne $v1 -o $m2 -ne $v2 -o $m3 -gt $v3 -then - echo "error: Must be GNU indent version $m1.$m2.$m3 or later" 1>&2 - exit 1 -fi - -if test $m3 -ne $v3 -then - echo "warning: GNU indent version $m1.$m2.$m3 recommended" 1>&2 -fi - -# Check that we're in the GDB source directory - -case `pwd` in - */gdb ) ;; - */sim/* ) ;; - * ) echo "Not in GDB directory" 1>&2 ; exit 1 ;; -esac - - -# Run indent per GDB specs - -types="\ --T FILE \ --T bfd -T asection -T pid_t \ --T prgregset_t -T fpregset_t -T gregset_t -T sigset_t \ --T td_thrhandle_t -T td_event_msg_t -T td_thr_events_t \ --T td_notify_t -T td_thr_iter_f -T td_thrinfo_t \ --T caddr_t \ -`cat *.h | sed -n \ - -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_ftype\).*$/-T \1/p' \ - -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_func\).*$/-T \1/p' \ - -e 's/^typedef.*[^a-zA-Z0-9_]\([a-zA-Z0-9_]*[a-zA-Z0-9_]\);$/-T \1/p' \ - | sort -u`" - -${indent} ${types} "$@"