Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: <gdb-patches@sourceware.org>, Samuel Thibault <sthibault@debian.org>
Cc: <bug-hurd@gnu.org>, <debian-hurd@lists.debian.org>
Subject: Hurd: Make gdb/reply_mig_hack.awk script compatible to "mawk" (was: [RFC] GDB Hurd Fixes)
Date: Tue, 12 Jan 2016 12:01:00 -0000	[thread overview]
Message-ID: <87a8ob57ne.fsf@kepler.schwinge.homeip.net> (raw)
In-Reply-To: <87vbxxhww4.fsf@kepler.schwinge.homeip.net>

[-- Attachment #1: Type: text/plain, Size: 3003 bytes --]

Hi!

On Mon, 6 Jan 2014 17:56:27 +0100, I wrote:
> On Fri, 20 Sep 2013 11:17:08 -0400, David Michael <fedora.dm0@gmail.com> 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 <thomas@codesourcery.com>
> 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 <fedora.dm0@gmail.com>.
> 
> 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 <thomas@codesourcery.com>
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(-)

diff --git gdb/ChangeLog gdb/ChangeLog
index 099a9a9..73b001c 100644
--- gdb/ChangeLog
+++ gdb/ChangeLog
@@ -1,3 +1,7 @@
+2016-01-12  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* reply_mig_hack.awk: Rewrite one regular expression.
+
 2016-01-11  Mike Frysinger  <vapier@gentoo.org>
 
 	* 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++;


Grüße
 Thomas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

      parent reply	other threads:[~2016-01-12 12:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20  0:43 [RFC] GDB Hurd Fixes David Michael
2013-09-20  8:47 ` Pedro Alves
2013-09-20  8:55   ` Thomas Schwinge
2013-09-20 15:17   ` David Michael
2014-01-06 16:56     ` Thomas Schwinge
2014-01-06 17:25       ` Pedro Alves
2014-05-06  3:49       ` Samuel Bronson
2014-05-06  6:42         ` Thomas Schwinge
2016-01-12 12:01       ` Thomas Schwinge [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8ob57ne.fsf@kepler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=bug-hurd@gnu.org \
    --cc=debian-hurd@lists.debian.org \
    --cc=gdb-patches@sourceware.org \
    --cc=sthibault@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox