From patchwork Wed Oct 2 17:45:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34794 Received: (qmail 93126 invoked by alias); 2 Oct 2019 17:45:40 -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 92184 invoked by uid 89); 2 Oct 2019 17:45:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 Oct 2019 17:45:27 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3DD2656036; Wed, 2 Oct 2019 13:45:22 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id RZaFaH6PvYzr; Wed, 2 Oct 2019 13:45:22 -0400 (EDT) Received: from murgatroyd (75-166-72-156.hlrn.qwest.net [75.166.72.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id BAE2956034; Wed, 2 Oct 2019 13:45:21 -0400 (EDT) From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: New ARI warning Wed Oct 2 01:56:22 UTC 2019 References: <20191002015622.GA57488@sourceware.org> <875zl7yvhy.fsf@tromey.com> <87zhijt5i5.fsf@tromey.com> <9eebf8fb-43f3-1c13-e557-a71c706b2b73@simark.ca> Date: Wed, 02 Oct 2019 11:45:21 -0600 In-Reply-To: <9eebf8fb-43f3-1c13-e557-a71c706b2b73@simark.ca> (Simon Marchi's message of "Wed, 2 Oct 2019 13:39:08 -0400") Message-ID: <87k19nt51q.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 >>>>> "Simon" == Simon Marchi writes: Simon> On 2019-10-02 1:35 p.m., Tom Tromey wrote: >> I believe that in most regexp syntax, a "]" doesn't need to be quoted in >> a character class, provided it is either the first character (like >> "[]...]") or comes immediately after the "^" (like "[^]...]"). >> >> The gawk manual mentions this, though it does also recommend using >> backslash, so maybe I should just do that. >> >> (info "(gawk) Bracket Expressions") >> >> To include one of the characters '\', ']', '-', or '^' in a bracket >> expression, put a '\' in front of it. For example: >> >> [d\]] >> >> matches either 'd' or ']'. Additionally, if you place ']' right after >> the opening '[', the closing bracket is treated as one of the characters >> to be matched. Simon> Well, as long as the regex does what it is meant to do, I am fine with it. Simon> I just thought that it would be nice to have a small comment that explains Simon> what it does, prevent using %p to print raw pointers, but allow the gdb Simon> extensions. I went ahead and made both changes. Tom commit ab3347cd98e02bb676e85279bc64684b48f4c609 Author: Tom Tromey Date: Wed Oct 2 10:13:33 2019 -0600 Let ARI allow gdb %p printf extensions As pointed out by Simon, this changes ARI to allow the gdb-specific %p printf extensions. gdb/ChangeLog 2019-10-02 Tom Tromey * contrib/ari/gdb_ari.sh (%p): Allow gdb-specific %p extensions. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cb450e28730..e79612696e6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2019-10-02 Tom Tromey + + * contrib/ari/gdb_ari.sh (%p): Allow gdb-specific %p extensions. + 2019-10-02 Tom Tromey * NEWS: Add $_ada_exception entry. diff --git a/gdb/contrib/ari/gdb_ari.sh b/gdb/contrib/ari/gdb_ari.sh index 4bd434c8fec..7202563f7a3 100755 --- a/gdb/contrib/ari/gdb_ari.sh +++ b/gdb/contrib/ari/gdb_ari.sh @@ -353,7 +353,8 @@ Do not use printf(\"%p\"), instead use printf(\"%s\",paddr()) to dump a \ target address, or host_address_to_string() for a host address" category["%p"] = ari_code } -/%p/ && !/%prec/ { +# Allow gdb %p extensions, but not other uses of %p. +/%p[^[\]sF]/ && !/%prec/ { fail("%p") }