This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Resolve xmethods over dynamic types
- From: Siva Chandra <sivachandra at google dot com>
- To: gdb-patches <gdb-patches at sourceware dot org>
- Date: Tue, 18 Nov 2014 16:01:12 -0800
- Subject: Re: [PATCH] Resolve xmethods over dynamic types
- Authentication-results: sourceware.org; auth=none
- References: <CAGyQ6gykDjttpbH0RvGzz4poeCNCH9B8qp1WnwfAVYCiWN5pLA at mail dot gmail dot com>
On Fri, Oct 31, 2014 at 12:50 PM, Siva Chandra <sivachandra@google.com> wrote:
> [I am not sure if the title is really appropriate.]
>
> Currently, if an xmethod is defined for a virtual method, then the
> dynamic type of the object is ignored. The attached patch removes this
> limitation. That is, if the xmethod of the static type has an equal
> method in C++ which is virtual, then further look up is done to check
> if the dynamic type also has an xmethod for the virtual method. If so,
> then the xmethod of the dynamic type is invoked.
>
> [Note that xmethods cannot be virtual.]
>
> gdb/ChangeLog:
>
> 2014-10-31 Siva Chandra Reddy <sivachandra@google.com>
>
> * valops.c (find_overload_match): Lookup xmethods on the
> dynamic type if the best match is a virtual method.
> (value_has_indirect_dynamic_type, cast_args_to_param_types)
> (equal_param_types_p, derived_hides_base_method): New functions.
>
> gdb/testsuite/ChangeLog:
>
> 2014-10-31 Siva Chandra Reddy <sivachandra@google.com>
>
> * gdb.python/py-xmethods.cc: New test cases.
> * gdb.python/py-xmethods.exp: New tests.
> * gdb.python/py-xmethods.py: New XMethods.
Ping.