Summary: | ptype expr-with-xmethod -> SEGV | ||
---|---|---|---|
Product: | gdb | Reporter: | dje |
Component: | exp | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | sivachandra |
Priority: | P2 | ||
Version: | HEAD | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
dje
2015-04-20 22:04:24 UTC
Could we extend the xmethod API to add a method XMethodWorker.return_type() and use the returned gdb.Type object to evaluate TYPE_TARGET_TYPE of an xmethod value? A return_type method sounds good to me. The master branch has been updated by Doug Evans <devans@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2ce1cdbf84ce883b992bc8ffec3d29b4da229b72 commit 2ce1cdbf84ce883b992bc8ffec3d29b4da229b72 Author: Doug Evans <dje@google.com> Date: Wed Apr 29 13:24:21 2015 -0700 PR python/18285 gdb/ChangeLog: 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. * python/lib/gdb/xmethod.py (XMethodWorker): Add get_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. gdb/testsuite/ChangeLog: * gdb.python/py-xmethods.exp: Add ptype tests. * gdb.python/py-xmethods.py (E_method_char_worker): Add get_result_type method. gdb/doc/ChangeLog: * python.texi (Xmethod API) <gdb.XMethodWorker.get_result_type>: Document. (Writing an Xmethod): Add get_result_type to example. The gdb-7.9-branch branch has been updated by Doug Evans <devans@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6b2a76d583a91ae9dad0653c60c91b72f07ff941 commit 6b2a76d583a91ae9dad0653c60c91b72f07ff941 Author: Doug Evans <dje@google.com> Date: Tue May 12 09:18:06 2015 -0700 PR python/18285 gdb/ChangeLog: 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. * python/lib/gdb/xmethod.py (XMethodWorker): Add get_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. gdb/testsuite/ChangeLog: * gdb.python/py-xmethods.exp: Add ptype tests. * gdb.python/py-xmethods.py (E_method_char_worker): Add get_result_type method. gdb/doc/ChangeLog: * python.texi (Xmethod API) <gdb.XMethodWorker.get_result_type>: Document. (Writing an Xmethod): Add get_result_type to example. patch committed. |