This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Enable invoking overloaded operator() method on class and union values.
- From: Siva Chandra <sivachandra at google dot com>
- To: gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 20 Nov 2014 09:02:19 -0800
- Subject: Re: [PATCH] Enable invoking overloaded operator() method on class and union values.
- Authentication-results: sourceware.org; auth=none
- References: <CAGyQ6gxeuscNqvqgrt=Secw5C+dqyLyXebm_GuNgpjZZYddRgQ at mail dot gmail dot com>
On Thu, Nov 20, 2014 at 8:56 AM, Siva Chandra <sivachandra@google.com> wrote:
> Hello,
>
> The attached patch enables invoking overloaded operator() method on
> class and union values when evaluating expressions.
>
> [I expected that once this feature is in, invoking c++ lambdas would
> also be possible naturally. However, It does not happen and I am
> working on that.]
To clarify, I do not think it is because of a deficiency in my patch,
but because the debug info for lambdas is not read in and handled
appropriately in GDB.
> gdb/ChangeLog:
>
> 2014-11-20 Siva Chandra Reddy <sivachandra@google.com>
>
> * eval.c (evaluate_subexp_standard): Extend handling of
> OP_FUNCALL operation to enable invoking overloaded
> operator() methods.
> * gdbtypes.c (class_or_union_p): New function.
> * gdbtypes.h (class_or_union_p): Declare.
>
> gdb/testsuite/ChangeLog:
>
> 2014-11-20 Siva Chandra Reddy <sivachandra@google.com>
>
> * gdb.cp/member-ptr.exp: Modify expected pattern of
> "print diamond.*diamond_pfunc_ptr (20)" and
> "print diamond.*left_vpmf ()".
> * gdb.cp/paren-op.cc: New file.
> * gdb.cp/paren-op.exp: New file.
>
> Regression tested on x86_64 GNU/Linux.
>
> Thank you,
> Siva Chandra