GDB (xrefs)
|
#include "defs.h"
#include "arch-utils.h"
#include "extension-priv.h"
#include "objfiles.h"
#include "value.h"
#include "language.h"
#include "python.h"
#include "python-internal.h"
Go to the source code of this file.
Classes | |
struct | gdbpy_worker_data |
Functions | |
static struct xmethod_worker * | new_python_xmethod_worker (PyObject *item, PyObject *py_obj_type) |
void | gdbpy_free_xmethod_worker_data (const struct extension_language_defn *extlang, void *data) |
void * | gdbpy_clone_xmethod_worker_data (const struct extension_language_defn *extlang, void *data) |
static PyObject * | invoke_match_method (PyObject *matcher, PyObject *py_obj_type, const char *xmethod_name) |
enum ext_lang_rc | gdbpy_get_matching_xmethod_workers (const struct extension_language_defn *extlang, struct type *obj_type, const char *method_name, xmethod_worker_vec **dm_vec) |
enum ext_lang_rc | gdbpy_get_xmethod_arg_types (const struct extension_language_defn *extlang, struct xmethod_worker *worker, int *nargs, struct type ***arg_types) |
enum ext_lang_rc | gdbpy_get_xmethod_result_type (const struct extension_language_defn *extlang, struct xmethod_worker *worker, struct value *obj, struct value **args, int nargs, struct type **result_type_ptr) |
struct value * | gdbpy_invoke_xmethod (const struct extension_language_defn *extlang, struct xmethod_worker *worker, struct value *obj, struct value **args, int nargs) |
int | gdbpy_initialize_xmethods (void) |
Variables | |
static const char | enabled_field_name [] = "enabled" |
static const char | match_method_name [] = "match" |
static const char | get_arg_types_method_name [] = "get_arg_types" |
static const char | get_result_type_method_name [] = "get_result_type" |
static const char | invoke_method_name [] = "invoke" |
static const char | matchers_attr_str [] = "xmethods" |
static PyObject * | py_match_method_name = NULL |
static PyObject * | py_get_arg_types_method_name = NULL |
static PyObject * | py_get_result_type_method_name = NULL |
static PyObject * | py_invoke_method_name = NULL |
void* gdbpy_clone_xmethod_worker_data | ( | const struct extension_language_defn * | extlang, |
void * | data | ||
) |
Definition at line 75 of file py-xmethods.c.
References current_language, do_cleanups(), ensure_python_env(), gdb_assert, get_current_arch(), gdbpy_worker_data::this_type, and gdbpy_worker_data::worker.
void gdbpy_free_xmethod_worker_data | ( | const struct extension_language_defn * | extlang, |
void * | data | ||
) |
Definition at line 54 of file py-xmethods.c.
References current_language, do_cleanups(), ensure_python_env(), gdb_assert, get_current_arch(), Py_DECREF, gdbpy_worker_data::this_type, gdbpy_worker_data::worker, and xfree().
enum ext_lang_rc gdbpy_get_matching_xmethod_workers | ( | const struct extension_language_defn * | extlang, |
struct type * | obj_type, | ||
const char * | method_name, | ||
xmethod_worker_vec ** | dm_vec | ||
) |
Definition at line 163 of file py-xmethods.c.
References ALL_OBJFILES, current_language, current_program_space, do_cleanups(), ensure_python_env(), EXT_LANG_RC_ERROR, EXT_LANG_RC_OK, gdb_assert, gdb_python_module, gdbpy_print_stack(), get_current_arch(), invoke_match_method(), make_cleanup_py_decref(), matchers_attr_str, new_python_xmethod_worker(), objfile_to_objfile_object(), objfpy_get_xmethods(), pspace_to_pspace_object(), pspy_get_xmethods(), Py_DECREF, PyObject_GetAttrString, PyObject_HasAttrString, type_to_type_object(), VEC, and VEC_safe_push.
enum ext_lang_rc gdbpy_get_xmethod_arg_types | ( | const struct extension_language_defn * | extlang, |
struct xmethod_worker * | worker, | ||
int * | nargs, | ||
struct type *** | arg_types | ||
) |
Definition at line 378 of file py-xmethods.c.
References _, current_language, xmethod_worker::data, do_cleanups(), ensure_python_env(), EXT_LANG_RC_ERROR, EXT_LANG_RC_OK, gdbpy_print_stack(), get_arg_types_method_name, get_current_arch(), lookup_pointer_type(), make_cleanup_py_decref(), make_cv_type(), Py_DECREF, py_get_arg_types_method_name, PyObject_GetAttrString, gdbpy_worker_data::this_type, type_object_to_type(), gdbpy_worker_data::worker, and xfree().
enum ext_lang_rc gdbpy_get_xmethod_result_type | ( | const struct extension_language_defn * | extlang, |
struct xmethod_worker * | worker, | ||
struct value * | obj, | ||
struct value ** | args, | ||
int | nargs, | ||
struct type ** | result_type_ptr | ||
) |
Definition at line 510 of file py-xmethods.c.
References _, check_typedef(), current_language, xmethod_worker::data, do_cleanups(), ensure_python_env(), EXT_LANG_RC_ERROR, EXT_LANG_RC_OK, gdbpy_print_stack(), get_current_arch(), get_result_type_method_name, lookup_pointer_type(), lookup_reference_type(), make_cleanup_py_decref(), PyObject_GetAttrString, gdbpy_worker_data::this_type, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_REF, type_object_to_type(), types_equal(), value_cast(), value_to_value_object(), value_type(), and gdbpy_worker_data::worker.
int gdbpy_initialize_xmethods | ( | void | ) |
Definition at line 728 of file py-xmethods.c.
References get_arg_types_method_name, get_result_type_method_name, invoke_method_name, match_method_name, py_get_arg_types_method_name, py_get_result_type_method_name, py_invoke_method_name, and py_match_method_name.
Referenced by _initialize_python().
struct value* gdbpy_invoke_xmethod | ( | const struct extension_language_defn * | extlang, |
struct xmethod_worker * | worker, | ||
struct value * | obj, | ||
struct value ** | args, | ||
int | nargs | ||
) |
Definition at line 610 of file py-xmethods.c.
References _, allocate_value(), check_typedef(), convert_value_from_python(), current_language, xmethod_worker::data, do_cleanups(), ensure_python_env(), error(), gdbpy_print_stack(), get_current_arch(), lookup_pointer_type(), lookup_reference_type(), lookup_typename(), make_cleanup_py_decref(), python_gdbarch, python_language, gdbpy_worker_data::this_type, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_REF, type_object_to_type(), types_equal(), value_cast(), value_to_value_object(), value_type(), and gdbpy_worker_data::worker.
|
static |
Definition at line 101 of file py-xmethods.c.
References do_cleanups(), enabled_field_name, make_cleanup(), make_cleanup_py_decref(), match_method_name, null_cleanup(), py_match_method_name, and PyObject_GetAttrString.
Referenced by gdbpy_get_matching_xmethod_workers().
|
static |
Definition at line 712 of file py-xmethods.c.
References extension_language_python, gdb_assert, new_xmethod_worker(), gdbpy_worker_data::this_type, and gdbpy_worker_data::worker.
Referenced by gdbpy_get_matching_xmethod_workers().
|
static |
Definition at line 30 of file py-xmethods.c.
Referenced by invoke_match_method().
|
static |
Definition at line 32 of file py-xmethods.c.
Referenced by gdbpy_get_xmethod_arg_types(), and gdbpy_initialize_xmethods().
|
static |
Definition at line 33 of file py-xmethods.c.
Referenced by gdbpy_get_xmethod_result_type(), and gdbpy_initialize_xmethods().
|
static |
Definition at line 34 of file py-xmethods.c.
Referenced by gdbpy_initialize_xmethods().
|
static |
Definition at line 31 of file py-xmethods.c.
Referenced by gdbpy_initialize_xmethods(), and invoke_match_method().
|
static |
Definition at line 35 of file py-xmethods.c.
Referenced by gdbpy_get_matching_xmethod_workers().
|
static |
Definition at line 38 of file py-xmethods.c.
Referenced by gdbpy_get_xmethod_arg_types(), and gdbpy_initialize_xmethods().
|
static |
Definition at line 39 of file py-xmethods.c.
Referenced by gdbpy_initialize_xmethods().
|
static |
Definition at line 40 of file py-xmethods.c.
Referenced by gdbpy_initialize_xmethods().
|
static |
Definition at line 37 of file py-xmethods.c.
Referenced by gdbpy_initialize_xmethods(), and invoke_match_method().