[PATCH] Resolve xmethods over dynamic types

Siva Chandra sivachandra@google.com
Wed Nov 19 00:01:00 GMT 2014


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.



More information about the Gdb-patches mailing list