GDB (xrefs)
|
#include "defs.h"
#include "charset.h"
#include "value.h"
#include "language.h"
#include "dfp.h"
#include "valprint.h"
#include "infcall.h"
#include "expression.h"
#include "cp-abi.h"
#include "python.h"
#include "python-internal.h"
Go to the source code of this file.
Classes | |
struct | value_object |
Macros | |
#define | builtin_type_pyint builtin_type (python_gdbarch)->builtin_long |
#define | builtin_type_pyfloat builtin_type (python_gdbarch)->builtin_double |
#define | builtin_type_pylong builtin_type (python_gdbarch)->builtin_long_long |
#define | builtin_type_upylong |
#define | builtin_type_pybool language_bool_type (python_language, python_gdbarch) |
#define | builtin_type_pychar language_string_char_type (python_language, python_gdbarch) |
#define | STRIP_REFERENCE(TYPE) ((TYPE_CODE (TYPE) == TYPE_CODE_REF) ? (TYPE_TARGET_TYPE (TYPE)) : (TYPE)) |
Typedefs | |
typedef struct value_object | value_object |
Enumerations | |
enum | valpy_opcode { VALPY_ADD, VALPY_SUB, VALPY_MUL, VALPY_DIV, VALPY_REM, VALPY_POW, VALPY_LSH, VALPY_RSH, VALPY_BITAND, VALPY_BITOR, VALPY_BITXOR } |
Functions | |
static void | valpy_dealloc (PyObject *obj) |
static void | note_value (value_object *value_obj) |
static PyObject * | valpy_new (PyTypeObject *subtype, PyObject *args, PyObject *keywords) |
void | gdbpy_preserve_values (const struct extension_language_defn *extlang, struct objfile *objfile, htab_t copied_types) |
static PyObject * | valpy_dereference (PyObject *self, PyObject *args) |
static PyObject * | valpy_referenced_value (PyObject *self, PyObject *args) |
static PyObject * | valpy_reference_value (PyObject *self, PyObject *args) |
static PyObject * | valpy_const_value (PyObject *self, PyObject *args) |
static PyObject * | valpy_get_address (PyObject *self, void *closure) |
static PyObject * | valpy_get_type (PyObject *self, void *closure) |
static PyObject * | valpy_get_dynamic_type (PyObject *self, void *closure) |
static PyObject * | valpy_lazy_string (PyObject *self, PyObject *args, PyObject *kw) |
static PyObject * | valpy_string (PyObject *self, PyObject *args, PyObject *kw) |
static PyObject * | valpy_do_cast (PyObject *self, PyObject *args, enum exp_opcode op) |
static PyObject * | valpy_cast (PyObject *self, PyObject *args) |
static PyObject * | valpy_dynamic_cast (PyObject *self, PyObject *args) |
static PyObject * | valpy_reinterpret_cast (PyObject *self, PyObject *args) |
static Py_ssize_t | valpy_length (PyObject *self) |
static int | value_has_field (struct value *v, PyObject *field) |
static int | get_field_flag (PyObject *field, const char *flag_name) |
static struct type * | get_field_type (PyObject *field) |
static PyObject * | valpy_getitem (PyObject *self, PyObject *key) |
static int | valpy_setitem (PyObject *self, PyObject *key, PyObject *value) |
static PyObject * | valpy_call (PyObject *self, PyObject *args, PyObject *keywords) |
static PyObject * | valpy_str (PyObject *self) |
static PyObject * | valpy_get_is_optimized_out (PyObject *self, void *closure) |
static PyObject * | valpy_get_is_lazy (PyObject *self, void *closure) |
static PyObject * | valpy_fetch_lazy (PyObject *self, PyObject *args) |
static Py_hash_t | valpy_hash (PyObject *self) |
static PyObject * | valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other) |
static PyObject * | valpy_add (PyObject *self, PyObject *other) |
static PyObject * | valpy_subtract (PyObject *self, PyObject *other) |
static PyObject * | valpy_multiply (PyObject *self, PyObject *other) |
static PyObject * | valpy_divide (PyObject *self, PyObject *other) |
static PyObject * | valpy_remainder (PyObject *self, PyObject *other) |
static PyObject * | valpy_power (PyObject *self, PyObject *other, PyObject *unused) |
static PyObject * | valpy_negative (PyObject *self) |
static PyObject * | valpy_positive (PyObject *self) |
static PyObject * | valpy_absolute (PyObject *self) |
static int | valpy_nonzero (PyObject *self) |
static PyObject * | valpy_invert (PyObject *self) |
static PyObject * | valpy_lsh (PyObject *self, PyObject *other) |
static PyObject * | valpy_rsh (PyObject *self, PyObject *other) |
static PyObject * | valpy_and (PyObject *self, PyObject *other) |
static PyObject * | valpy_or (PyObject *self, PyObject *other) |
static PyObject * | valpy_xor (PyObject *self, PyObject *other) |
static PyObject * | valpy_richcompare (PyObject *self, PyObject *other, int op) |
static PyObject * | valpy_int (PyObject *self) |
static PyObject * | valpy_long (PyObject *self) |
static PyObject * | valpy_float (PyObject *self) |
PyObject * | value_to_value_object (struct value *val) |
struct value * | value_object_to_value (PyObject *self) |
struct value * | convert_value_from_python (PyObject *obj) |
PyObject * | gdbpy_history (PyObject *self, PyObject *args) |
int | gdbpy_is_value_object (PyObject *obj) |
int | gdbpy_initialize_values (void) |
Variables | |
static value_object * | values_in_python = NULL |
static PyGetSetDef | value_object_getset [] |
static PyMethodDef | value_object_methods [] |
static PyNumberMethods | value_object_as_number |
static PyMappingMethods | value_object_as_mapping |
PyTypeObject | value_object_type |
#define builtin_type_pybool language_bool_type (python_language, python_gdbarch) |
Definition at line 50 of file py-value.c.
Referenced by convert_value_from_python().
#define builtin_type_pychar language_string_char_type (python_language, python_gdbarch) |
Definition at line 53 of file py-value.c.
Referenced by convert_value_from_python().
#define builtin_type_pyfloat builtin_type (python_gdbarch)->builtin_double |
Definition at line 41 of file py-value.c.
Referenced by convert_value_from_python().
#define builtin_type_pyint builtin_type (python_gdbarch)->builtin_long |
Definition at line 38 of file py-value.c.
Referenced by convert_value_from_python(), and valpy_binop().
#define builtin_type_pylong builtin_type (python_gdbarch)->builtin_long_long |
Definition at line 44 of file py-value.c.
Referenced by convert_value_from_python().
#define builtin_type_upylong |
Definition at line 47 of file py-value.c.
Referenced by convert_value_from_python().
#define STRIP_REFERENCE | ( | TYPE | ) | ((TYPE_CODE (TYPE) == TYPE_CODE_REF) ? (TYPE_TARGET_TYPE (TYPE)) : (TYPE)) |
Definition at line 1018 of file py-value.c.
Referenced by valpy_binop().
typedef struct value_object value_object |
enum valpy_opcode |
Enumerator | |
---|---|
VALPY_ADD | |
VALPY_SUB | |
VALPY_MUL | |
VALPY_DIV | |
VALPY_REM | |
VALPY_POW | |
VALPY_LSH | |
VALPY_RSH | |
VALPY_BITAND | |
VALPY_BITOR | |
VALPY_BITXOR |
Definition at line 1002 of file py-value.c.
struct value* convert_value_from_python | ( | PyObject * | obj | ) |
Definition at line 1559 of file py-value.c.
References _, builtin_type_pybool, builtin_type_pychar, builtin_type_pyfloat, builtin_type_pyint, builtin_type_pylong, builtin_type_upylong, CATCH, do_cleanups(), END_CATCH, gdb_assert, gdbpy_is_lazy_string(), gdbpy_is_string(), gdbpy_value_cst, make_cleanup(), Py_DECREF, python_string_to_target_string(), RETURN_MASK_ALL, RETURN_QUIT, TRY, value_copy(), value_cstring(), value_from_double(), value_from_longest(), value_from_ulongest(), value_object_type, and xfree().
Referenced by extract_value(), fnpy_call(), gdbpy_invoke_xmethod(), pretty_print_one_value(), print_children(), py_varobj_iter_next(), valpy_binop(), valpy_call(), valpy_getitem(), valpy_new(), and valpy_richcompare().
PyObject* gdbpy_history | ( | PyObject * | self, |
PyObject * | args | ||
) |
Definition at line 1676 of file py-value.c.
References access_value_history(), CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, and value_to_value_object().
int gdbpy_initialize_values | ( | void | ) |
Definition at line 1706 of file py-value.c.
References gdb_module, gdb_pymodule_addobject(), and value_object_type.
Referenced by _initialize_python().
int gdbpy_is_value_object | ( | PyObject * | obj | ) |
Definition at line 1700 of file py-value.c.
References value_object_type.
Referenced by get_addr_from_python().
void gdbpy_preserve_values | ( | const struct extension_language_defn * | extlang, |
struct objfile * | objfile, | ||
htab_t | copied_types | ||
) |
Definition at line 162 of file py-value.c.
References value_object::next, preserve_one_value(), and value_object::value.
Definition at line 626 of file py-value.c.
References Py_DECREF, and PyObject_GetAttrString.
Referenced by valpy_getitem().
|
static |
Definition at line 644 of file py-value.c.
References _, Py_DECREF, PyObject_GetAttrString, and type_object_to_type().
Referenced by valpy_getitem().
|
static |
Definition at line 110 of file py-value.c.
References value_object::next, value_object::prev, and values_in_python.
Referenced by valpy_new(), and value_to_value_object().
|
static |
Definition at line 1235 of file py-value.c.
References CATCH, do_cleanups(), END_CATCH, GDB_PY_HANDLE_EXCEPTION, make_cleanup_value_free_to_mark(), not_lval, RETURN_MASK_ALL, TRY, valpy_negative(), valpy_positive(), value_less(), value_mark(), value_type(), and value_zero().
|
static |
Definition at line 1159 of file py-value.c.
References VALPY_ADD, and valpy_binop().
|
static |
Definition at line 1335 of file py-value.c.
References valpy_binop(), and VALPY_BITAND.
|
static |
Definition at line 1025 of file py-value.c.
References binop_user_defined_p(), builtin_type_pyint, CATCH, CHECK_TYPEDEF, convert_value_from_python(), do_cleanups(), END_CATCH, EVAL_NORMAL, GDB_PY_HANDLE_EXCEPTION, is_integral_type(), make_cleanup_value_free_to_mark(), RETURN_MASK_ALL, STRIP_REFERENCE, TRY, TYPE_CODE, TYPE_CODE_PTR, VALPY_ADD, VALPY_BITAND, VALPY_BITOR, VALPY_BITXOR, VALPY_DIV, VALPY_LSH, VALPY_MUL, VALPY_POW, VALPY_REM, VALPY_RSH, VALPY_SUB, value_as_long(), value_binop(), value_from_longest(), value_mark(), value_ptradd(), value_ptrdiff(), value_to_value_object(), value_type(), and value_x_binop().
Referenced by valpy_add(), valpy_and(), valpy_divide(), valpy_lsh(), valpy_multiply(), valpy_or(), valpy_power(), valpy_remainder(), valpy_rsh(), valpy_subtract(), and valpy_xor().
|
static |
Definition at line 823 of file py-value.c.
References _, call_function_by_hand(), CATCH, check_typedef(), convert_value_from_python(), do_cleanups(), END_CATCH, GDB_PY_HANDLE_EXCEPTION, make_cleanup_value_free_to_mark(), RETURN_MASK_ALL, TRY, TYPE_CODE, TYPE_CODE_FUNC, value_mark(), value_to_value_object(), and value_type().
|
static |
Definition at line 543 of file py-value.c.
References valpy_do_cast().
|
static |
Definition at line 268 of file py-value.c.
References CATCH, do_cleanups(), END_CATCH, GDB_PY_HANDLE_EXCEPTION, make_cleanup_value_free_to_mark(), make_cv_value(), RETURN_MASK_ALL, TRY, value_mark(), and value_to_value_object().
|
static |
Definition at line 75 of file py-value.c.
References gdb_assert, value_object::next, value_object::prev, Py_DECREF, Py_TYPE, and value_free().
|
static |
Definition at line 173 of file py-value.c.
References CATCH, do_cleanups(), END_CATCH, GDB_PY_HANDLE_EXCEPTION, make_cleanup_value_free_to_mark(), RETURN_MASK_ALL, TRY, value_ind(), value_mark(), and value_to_value_object().
|
static |
Definition at line 1177 of file py-value.c.
References valpy_binop(), and VALPY_DIV.
|
static |
Definition at line 496 of file py-value.c.
References _, CATCH, do_cleanups(), END_CATCH, gdb_assert, GDB_PY_HANDLE_EXCEPTION, make_cleanup_value_free_to_mark(), RETURN_MASK_ALL, TRY, type, type_object_to_type(), value_cast(), value_dynamic_cast(), value_mark(), value_reinterpret_cast(), and value_to_value_object().
Referenced by valpy_cast(), valpy_dynamic_cast(), and valpy_reinterpret_cast().
|
static |
Definition at line 551 of file py-value.c.
References valpy_do_cast().
|
static |
Definition at line 976 of file py-value.c.
References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, value_fetch_lazy(), and value_lazy().
|
static |
Definition at line 1496 of file py-value.c.
References _, CATCH, CHECK_TYPEDEF, END_CATCH, error(), GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, TYPE_CODE, TYPE_CODE_FLT, value_as_double(), and value_type().
|
static |
Definition at line 294 of file py-value.c.
References value_object::address, CATCH, do_cleanups(), END_CATCH, make_cleanup_value_free_to_mark(), RETURN_MASK_ALL, TRY, value_object::value, value_addr(), value_mark(), and value_to_value_object().
|
static |
Definition at line 342 of file py-value.c.
References CATCH, CHECK_TYPEDEF, coerce_ref(), do_cleanups(), value_object::dynamic_type, END_CATCH, GDB_PY_HANDLE_EXCEPTION, lookup_pointer_type(), lookup_reference_type(), make_cleanup_value_free_to_mark(), RETURN_MASK_ALL, TRY, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_REF, TYPE_CODE_STRUCT, TYPE_TARGET_TYPE, type_to_type_object(), valpy_get_type(), value_object::value, value_ind(), value_mark(), value_rtti_type(), and value_type().
|
static |
Definition at line 953 of file py-value.c.
References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, and value_lazy().
|
static |
Definition at line 930 of file py-value.c.
References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, and value_optimized_out().
|
static |
Definition at line 325 of file py-value.c.
References value_object::type, type_to_type_object(), value_object::value, and value_type().
Referenced by valpy_get_dynamic_type().
|
static |
Definition at line 666 of file py-value.c.
References _, CATCH, check_typedef(), coerce_ref(), convert_value_from_python(), do_cleanups(), END_CATCH, error(), exception_none, GDB_PY_HANDLE_EXCEPTION, gdb_py_int_as_long(), gdbpy_is_field(), gdbpy_is_string(), get_field_flag(), get_field_type(), lookup_pointer_type(), lookup_reference_type(), make_cleanup_value_free_to_mark(), Py_DECREF, PyObject_GetAttrString, PyObject_HasAttrString, python_string_to_host_string(), RETURN_MASK_ALL, TRY, type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_PTR, TYPE_CODE_REF, value_object::value, value_as_long(), value_cast(), value_has_field(), value_mark(), value_struct_elt(), value_struct_elt_bitpos(), value_subscript(), value_to_value_object(), value_type(), and xfree().
|
static |
Definition at line 997 of file py-value.c.
|
static |
Definition at line 1444 of file py-value.c.
References _, CATCH, END_CATCH, error(), GDB_PY_HANDLE_EXCEPTION, gdb_py_object_from_longest(), is_integral_type(), RETURN_MASK_ALL, TRY, value_as_long(), and value_type().
|
static |
Definition at line 1302 of file py-value.c.
References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, value_complement(), and value_to_value_object().
|
static |
Definition at line 416 of file py-value.c.
References CATCH, do_cleanups(), END_CATCH, GDB_PY_HANDLE_EXCEPTION, GDB_PY_LL_ARG, gdbpy_create_lazy_string_object(), make_cleanup_value_free_to_mark(), RETURN_MASK_ALL, TRY, TYPE_CODE, TYPE_CODE_PTR, value_address(), value_ind(), value_mark(), and value_type().
|
static |
Definition at line 565 of file py-value.c.
References _.
|
static |
Definition at line 1469 of file py-value.c.
References _, CATCH, CHECK_TYPEDEF, END_CATCH, error(), GDB_PY_HANDLE_EXCEPTION, gdb_py_long_from_longest, is_integral_type(), RETURN_MASK_ALL, TRY, TYPE_CODE, TYPE_CODE_PTR, value_as_long(), and value_type().
|
static |
Definition at line 1321 of file py-value.c.
References valpy_binop(), and VALPY_LSH.
|
static |
Definition at line 1171 of file py-value.c.
References valpy_binop(), and VALPY_MUL.
|
static |
Definition at line 1205 of file py-value.c.
References CATCH, do_cleanups(), END_CATCH, GDB_PY_HANDLE_EXCEPTION, make_cleanup_value_free_to_mark(), RETURN_MASK_ALL, TRY, value_mark(), value_neg(), and value_to_value_object().
Referenced by valpy_absolute().
|
static |
Definition at line 122 of file py-value.c.
References _, value_object::address, convert_value_from_python(), value_object::dynamic_type, note_value(), release_value_or_incref(), value_object::type, and value_object::value.
|
static |
Definition at line 1263 of file py-value.c.
References CATCH, check_typedef(), decimal_is_zero(), END_CATCH, exception_none, GDB_PY_SET_HANDLE_EXCEPTION, gdbarch_byte_order(), get_type_arch(), is_integral_type(), RETURN_MASK_ALL, TRY, type, TYPE_CODE, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_CODE_PTR, TYPE_LENGTH, value_object::value, value_as_double(), value_as_long(), value_contents(), and value_type().
|
static |
Definition at line 1342 of file py-value.c.
References valpy_binop(), and VALPY_BITOR.
|
static |
Definition at line 1229 of file py-value.c.
References value_to_value_object().
Referenced by valpy_absolute().
|
static |
Definition at line 1189 of file py-value.c.
References valpy_binop(), and VALPY_POW.
|
static |
Definition at line 242 of file py-value.c.
References CATCH, do_cleanups(), END_CATCH, GDB_PY_HANDLE_EXCEPTION, make_cleanup_value_free_to_mark(), RETURN_MASK_ALL, TRY, value_mark(), value_ref(), and value_to_value_object().
|
static |
Definition at line 204 of file py-value.c.
References _, CATCH, check_typedef(), coerce_ref(), do_cleanups(), END_CATCH, error(), GDB_PY_HANDLE_EXCEPTION, make_cleanup_value_free_to_mark(), RETURN_MASK_ALL, TRY, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_REF, value_ind(), value_mark(), value_to_value_object(), and value_type().
|
static |
Definition at line 559 of file py-value.c.
References valpy_do_cast().
|
static |
Definition at line 1183 of file py-value.c.
References valpy_binop(), and VALPY_REM.
|
static |
Definition at line 1357 of file py-value.c.
References _, CATCH, convert_value_from_python(), do_cleanups(), END_CATCH, GDB_PY_HANDLE_EXCEPTION, make_cleanup_value_free_to_mark(), RETURN_MASK_ALL, TRY, value_equal(), value_less(), and value_mark().
|
static |
Definition at line 1328 of file py-value.c.
References valpy_binop(), and VALPY_RSH.
|
static |
Definition at line 813 of file py-value.c.
References _.
|
static |
Definition at line 896 of file py-value.c.
References CATCH, common_val_print(), value_print_options::deref_ref, do_cleanups(), END_CATCH, GDB_PY_HANDLE_EXCEPTION, get_user_print_options(), host_charset(), make_cleanup_ui_file_delete(), mem_fileopen(), python_language, RETURN_MASK_ALL, TRY, ui_file_xstrdup(), and xfree().
|
static |
Definition at line 457 of file py-value.c.
References CATCH, encoding, END_CATCH, GDB_PY_HANDLE_EXCEPTION, LA_GET_STRING, RETURN_MASK_ALL, TRY, TYPE_LENGTH, and xfree().
|
static |
Definition at line 1165 of file py-value.c.
References valpy_binop(), and VALPY_SUB.
|
static |
Definition at line 1349 of file py-value.c.
References valpy_binop(), and VALPY_BITXOR.
Definition at line 577 of file py-value.c.
References _, CATCH, check_typedef(), END_CATCH, GDB_PY_SET_HANDLE_EXCEPTION, gdb.types::has_field(), Py_DECREF, PyObject_GetAttrString, RETURN_MASK_ALL, TRY, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_REF, TYPE_CODE_STRUCT, TYPE_CODE_UNION, type_object_to_type(), TYPE_TARGET_TYPE, types_equal(), and value_type().
Referenced by valpy_getitem().
struct value* value_object_to_value | ( | PyObject * | self | ) |
Definition at line 1544 of file py-value.c.
References value_object::value, and value_object_type.
Referenced by bpfinishpy_pre_stop_hook(), gdbpy_default_visualizer(), get_addr_from_python(), pyuw_sniffer(), pyuw_value_obj_to_pointer(), unwind_infopy_add_saved_register(), and unwind_infopy_str().
PyObject* value_to_value_object | ( | struct value * | val | ) |
Definition at line 1523 of file py-value.c.
References value_object::address, value_object::dynamic_type, note_value(), release_value_or_incref(), value_object::type, value_object::value, and value_object_type.
Referenced by bpfinishpy_init(), bpfinishpy_pre_stop_hook(), convert_values_to_python(), frapy_read_register(), frapy_read_var(), gdbpy_apply_val_pretty_printer(), gdbpy_get_varobj_pretty_printer(), gdbpy_get_xmethod_result_type(), gdbpy_history(), gdbpy_invoke_xmethod(), gdbpy_parse_and_eval(), instantiate_pretty_printer(), pending_framepy_read_register(), stpy_convert_to_value(), sympy_value(), typy_optimized_out(), typy_template_argument(), valpy_binop(), valpy_call(), valpy_const_value(), valpy_dereference(), valpy_do_cast(), valpy_get_address(), valpy_getitem(), valpy_invert(), valpy_negative(), valpy_positive(), valpy_reference_value(), and valpy_referenced_value().
|
static |
Definition at line 1811 of file py-value.c.
|
static |
Definition at line 1764 of file py-value.c.
|
static |
Definition at line 1717 of file py-value.c.
|
static |
Definition at line 1734 of file py-value.c.
PyTypeObject value_object_type |
Definition at line 1817 of file py-value.c.
Referenced by convert_value_from_python(), gdbpy_initialize_values(), gdbpy_is_value_object(), value_object_to_value(), and value_to_value_object().
|
static |
Definition at line 71 of file py-value.c.
Referenced by note_value().