From patchwork Tue Jan 12 12:01:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 10348 Received: (qmail 1790 invoked by alias); 12 Jan 2016 12:01:29 -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 1773 invoked by uid 89); 12 Jan 2016 12:01:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*debian.org, 957, 95, 7, adapt X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Jan 2016 12:01:26 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1aIxda-0003aB-Gd from Thomas_Schwinge@mentor.com ; Tue, 12 Jan 2016 04:01:22 -0800 Received: from tftp-cs (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.224.2; Tue, 12 Jan 2016 04:01:22 -0800 Received: by tftp-cs (Postfix, from userid 49978) id 91EF9C2266; Tue, 12 Jan 2016 04:01:21 -0800 (PST) From: Thomas Schwinge To: , Samuel Thibault CC: , Subject: Hurd: Make gdb/reply_mig_hack.awk script compatible to "mawk" (was: [RFC] GDB Hurd Fixes) In-Reply-To: <87vbxxhww4.fsf@kepler.schwinge.homeip.net> References: <523C0B99.7080109@redhat.com> <20160112091222.GA4368@var.bordeaux.inria.fr> <87vbxxhww4.fsf@kepler.schwinge.homeip.net> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i586-pc-linux-gnu) Date: Tue, 12 Jan 2016 13:01:09 +0100 Message-ID: <87a8ob57ne.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Mon, 6 Jan 2014 17:56:27 +0100, I wrote: > On Fri, 20 Sep 2013 11:17:08 -0400, David Michael wrote: > > mig has stopped using the "auto" keyword in its output.[1] > > Without that keyword, gdb/reply_mig_hack.awk fails to match a > > necessary pattern and outputs a bad gdb/process_reply_S.c file. > commit d8131897afba28934ced82c507114123027a40f8 > Author: Thomas Schwinge > Date: Mon Jan 6 15:56:33 2014 +0100 > > Hurd: Adapt to changed MIG output. > > gdb/ > * reply_mig_hack.awk: Don't expect to see the auto keyword. > > Based on patch by David Michael . > > diff --git gdb/reply_mig_hack.awk gdb/reply_mig_hack.awk > index 97e080f..e137a27 100644 > --- gdb/reply_mig_hack.awk > +++ gdb/reply_mig_hack.awk > @@ -78,9 +78,9 @@ parse_phase == 4 { > print; next; > } > > -parse_phase == 5 && /^[ \t]*(auto|static) const mach_msg_type_t/ { > +parse_phase == 5 && /^[ \t]*(auto |static |)const mach_msg_type_t/ { > # The type check structure for an argument. > - arg_check_name[num_checks] = $4; > + arg_check_name[num_checks] = $(NF - 2); > num_checks++; > print; next; > } Turns out that the "mawk" AWK implementation doesn't like that regular expression: mawk: [...]/gdb/reply_mig_hack.awk: line 98: regular expression compile failed (missing operand) I didn't check it against the AWK language definition, but instead just made the gdb/reply_mig_hack.awk script compatible to "mawk"; pushed: commit 5eddd57823971bdb54f957d10c11ff3fc9f97b1e Author: Thomas Schwinge Date: Tue Jan 12 12:53:09 2016 +0100 Hurd: Make gdb/reply_mig_hack.awk script compatible to "mawk" The "mawk" AWK implementation did't like that regular expression: mawk: [...]/gdb/reply_mig_hack.awk: line 98: regular expression compile failed (missing operand) gdb/ * reply_mig_hack.awk: Rewrite one regular expression. --- gdb/ChangeLog | 4 ++++ gdb/reply_mig_hack.awk | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) Grüße Thomas diff --git gdb/ChangeLog gdb/ChangeLog index 099a9a9..73b001c 100644 --- gdb/ChangeLog +++ gdb/ChangeLog @@ -1,3 +1,7 @@ +2016-01-12 Thomas Schwinge + + * reply_mig_hack.awk: Rewrite one regular expression. + 2016-01-11 Mike Frysinger * acinclude.m4: Include new warning.m4 file. diff --git gdb/reply_mig_hack.awk gdb/reply_mig_hack.awk index 1e2387a..e4c513b 100644 --- gdb/reply_mig_hack.awk +++ gdb/reply_mig_hack.awk @@ -95,7 +95,7 @@ parse_phase == 4 { print; next; } -parse_phase == 5 && /^[ \t]*(auto |static |)const mach_msg_type_t/ { +parse_phase == 5 && /^[ \t]*(auto |static )?const mach_msg_type_t/ { # The type check structure for an argument. arg_check_name[num_checks] = $(NF - 2); num_checks++;