Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Leszek Swirski <leszeks@google.com>, gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH v4] Do not classify C struct members as a filename
Date: Fri, 02 Feb 2018 03:35:00 -0000	[thread overview]
Message-ID: <8fd13493-de62-5fea-ebca-13668aa1580b@polymtl.ca> (raw)
In-Reply-To: <20180125162047.126498-1-leszeks@google.com>

On 2018-01-25 11:20 AM, Leszek Swirski wrote:
> There is existing logic in C/C++ expression parsing to avoid classifying
> names as a filename when they are a field on the this object. This
> change extends this logic to also avoid classifying names after a
> struct-op (-> or .) as a filename, which otherwise causes a syntax
> error.
> 
> Thus, it is now possible in the file
> 
>     #include <map>
>     struct D {
>         void map();
>     }
>     D d;
> 
> to call
> 
>     (gdb) print d.map()
> 
> where previously this would have been a syntax error.
> 
> Tested on gdb.cp/*.exp
> 
> gdb/ChangeLog:
> 
>         * c-exp.y (lex_one_token, classify_name, yylex): Don't classify
>         names after a structop as a filename
> 
> gdb/testsuite/ChangeLog:
> 
>         * gdb.cp/filename.cc, gdb.cp/filename.exp: Test that member
>         functions with the same name as an include file are parsed
>         correctly.
> ---
> 
> Fix completion token to only appear on completion.
> 
>  gdb/ChangeLog                     |  5 +++++
>  gdb/c-exp.y                       | 45 +++++++++++++++++++++------------------
>  gdb/testsuite/ChangeLog           |  6 ++++++
>  gdb/testsuite/gdb.cp/filename.cc  | 22 ++++++++++++++++++-
>  gdb/testsuite/gdb.cp/filename.exp | 20 +++++++++++++++--
>  5 files changed, 74 insertions(+), 24 deletions(-)

Thanks for the update, I have pushed it.

Simon


  reply	other threads:[~2018-02-02  3:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 16:51 [PATCH v2] " Leszek Swirski via gdb-patches
2018-01-25  2:39 ` Simon Marchi
2018-01-25 10:04   ` Leszek Swirski via gdb-patches
2018-01-25 14:52     ` Simon Marchi
2018-01-25 15:09       ` [PATCH v3] " Leszek Swirski via gdb-patches
2018-01-25 16:00 ` [PATCH v2] " Tom Tromey
2018-01-25 16:20   ` [PATCH v4] " Leszek Swirski via gdb-patches
2018-02-02  3:35     ` Simon Marchi [this message]
2018-01-25 16:39   ` [PATCH v2] " Leszek Swirski via gdb-patches

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=8fd13493-de62-5fea-ebca-13668aa1580b@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=leszeks@google.com \
    --cc=tom@tromey.com \
    /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