This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] [PR python/18285] Fix.
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org, sivachandra at google dot com
- Date: Fri, 24 Apr 2015 23:22:15 +0300
- Subject: Re: [PATCH] [PR python/18285] Fix.
- Authentication-results: sourceware.org; auth=none
- References: <yjt2iocluxxc dot fsf at ruffy dot mtv dot corp dot google dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Doug Evans <dje@google.com>
> cc: sivachandra@google.com
> Date: Fri, 24 Apr 2015 12:30:07 -0700
>
> This patch fixes pr 18285 by adding a new get_result_type method
> to xmethod workers. This way we can fetch the result type without
> having to call the xmethod (which is important for ptype where
> we have EVAL_AVOID_SIDE_EFFECTS).
>
> Regression tested on amd64-linux.
>
> 2015-04-24 Doug Evans <dje@google.com>
>
> PR python/18285
> * NEWS: Document new gdb.XMethodWorker.get_result_type method.
> * eval.c (evaluate_subexp_standard) <OP_FUNCALL>: Handle
> EVAL_AVOID_SIDE_EFFECTS for xmethods.
> * extension-priv.h (struct extension_language_ops)
> <get_xmethod_result_type>: New member.
> * extension.c (get_xmethod_result_type): New function.
> * extension.h (get_xmethod_result_type): Declare.
> * python/py-xmethods.c (get_result_type_method_name): New static
> global.
> (py_get_result_type_method_name): Ditto.
> (gdbpy_get_xmethod_result_type): New function.
> (gdbpy_initialize_xmethods): Initialize py_get_result_type_method_name.
> * python/python-internal.h (gdbpy_get_xmethod_result_type): Declare.
> * python/python.c (python_extension_ops): Add
> gdbpy_get_xmethod_result_type.
> * valarith.c (value_x_binop): Handle EVAL_AVOID_SIDE_EFFECTS for
> xmethods.
> (value_x_unop): Ditto.
> * value.c (result_type_of_xmethod): New function.
> * value.h (result_type_of_xmethod): Declare.
>
> testsuite/
> * gdb.python/py-xmethods.exp: Add ptype tests.
> * gdb.python/py-xmethods.py (E_method_char_worker): Add
> get_result_type method.
>
> doc/
> * python.texi (Xmethod API) <gdb.XMethodWorker.get_result_type>:
> Document.
> (Writing an Xmethod): Add get_result_type to example.
The documentation parts are okay. Thanks.