GDB (xrefs)

Classes | Macros | Typedefs | Enumerations | Functions | Variables
py-value.c File Reference
`#include "defs.h"`
`#include "charset.h"`
`#include "value.h"`
`#include "language.h"`
`#include "target-float.h"`
`#include "valprint.h"`
`#include "infcall.h"`
`#include "expression.h"`
`#include "cp-abi.h"`
`#include "python.h"`
`#include "python-internal.h"`
`#include "py-ref.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_IS_REFERENCE (TYPE) ? (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, enum type_code refcode)
static PyObject * | valpy_lvalue_reference_value (PyObject *self, PyObject *args)
static PyObject * | valpy_rvalue_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_throw (enum valpy_opcode opcode, PyObject *self, PyObject *other)
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 int | valpy_richcompare_throw (PyObject *self, PyObject *other, int op)
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 gdb_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

## Macro Definition Documentation

## ◆ builtin_type_pybool

#define builtin_type_pybool language_bool_type (python_language, python_gdbarch)

Definition at line 51 of file py-value.c.

Referenced by convert_value_from_python().

## ◆ builtin_type_pychar

#define builtin_type_pychar language_string_char_type (python_language, python_gdbarch)

Definition at line 54 of file py-value.c.

Referenced by convert_value_from_python().

## ◆ builtin_type_pyfloat

#define builtin_type_pyfloat builtin_type (python_gdbarch)->builtin_double

Definition at line 42 of file py-value.c.

Referenced by convert_value_from_python().

## ◆ builtin_type_pyint

#define builtin_type_pyint builtin_type (python_gdbarch)->builtin_long

Definition at line 39 of file py-value.c.

Referenced by convert_value_from_python(), and valpy_binop_throw().

## ◆ builtin_type_pylong

#define builtin_type_pylong builtin_type (python_gdbarch)->builtin_long_long

Definition at line 45 of file py-value.c.

Referenced by convert_value_from_python().

## ◆ builtin_type_upylong

#define builtin_type_upylong

Value:
builtin_type \
(python_gdbarch)->builtin_unsigned_long_long
builtin_type
Definition: gdbtypes.h:1495
python_gdbarch
struct gdbarch * python_gdbarch
Definition: python.c:203

Definition at line 48 of file py-value.c.

Referenced by convert_value_from_python().

## ◆ STRIP_REFERENCE

#define STRIP_REFERENCE | ( |  | TYPE | ) | (TYPE_IS_REFERENCE (TYPE) ? (TYPE_TARGET_TYPE (TYPE)) : (TYPE))

Definition at line 1056 of file py-value.c.

Referenced by valpy_binop_throw().

## Typedef Documentation

## ◆ value_object

typedef struct value_object value_object

## Enumeration Type Documentation

## ◆ valpy_opcode

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 1040 of file py-value.c.

## Function Documentation

## ◆ convert_value_from_python()

struct value* convert_value_from_python | ( | PyObject * | obj | ) |

Definition at line 1615 of file py-value.c.

References _, allocate_value(), builtin_type_pybool, builtin_type_pychar, builtin_type_pyfloat, builtin_type_pyint, builtin_type_pylong, builtin_type_upylong, CATCH, END_CATCH, gdb_assert, gdbpy_is_lazy_string(), gdbpy_is_string(), gdbpy_value_cst, gdb::ref_ptr< T, Policy >::get(), python_string_to_target_string(), RETURN_MASK_ALL, RETURN_QUIT, target_float_from_host_double(), TRY, value_contents_raw(), value_copy(), value_cstring(), value_from_longest(), value_from_ulongest(), value_object_type, and value_type().

Referenced by extract_value(), fnpy_call(), gdbpy_invoke_xmethod(), pretty_print_one_value(), print_children(), py_varobj_iter_next(), valpy_binop_throw(), valpy_call(), valpy_getitem(), valpy_new(), and valpy_richcompare_throw().

## ◆ gdbpy_history()

PyObject* gdbpy_history | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |

Definition at line 1730 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().

## ◆ gdbpy_initialize_values()

int gdbpy_initialize_values | ( | void |  | ) |

Definition at line 1760 of file py-value.c.

References gdb_module, gdb_pymodule_addobject(), and value_object_type.

Referenced by do_start_initialization().

## ◆ gdbpy_is_value_object()

int gdbpy_is_value_object | ( | PyObject * | obj | ) |

Definition at line 1754 of file py-value.c.

References value_object_type.

Referenced by get_addr_from_python(), and infpy_thread_from_thread_handle().

## ◆ gdbpy_preserve_values()

void gdbpy_preserve_values | ( | const struct extension_language_defn * | extlang,
|  | struct objfile * | objfile,
|  | htab_t | copied_types
| ) |  |

Definition at line 163 of file py-value.c.

References value_object::next, preserve_one_value(), value_object::value, and values_in_python.

## ◆ get_field_flag()

static int get_field_flag | ( | PyObject * | field,
|  | const char * | flag_name
| ) |  |
| static

Definition at line 684 of file py-value.c.

References gdb::ref_ptr< T, Policy >::get(), and PyObject_GetAttrString.

Referenced by valpy_getitem().

## ◆ get_field_type()

static struct type* get_field_type | ( | PyObject * | field | ) |
| static

Definition at line 698 of file py-value.c.

References _, gdb::ref_ptr< T, Policy >::get(), PyObject_GetAttrString, and type_object_to_type().

Referenced by valpy_getitem().

## ◆ note_value()

static void note_value | ( | value_object * | value_obj | ) |
| static

Definition at line 111 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().

## ◆ valpy_absolute()

static PyObject* valpy_absolute | ( | PyObject * | self | ) |
| static

Definition at line 1280 of file py-value.c.

References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, not_lval, RETURN_MASK_ALL, TRY, valpy_negative(), valpy_positive(), value_less(), value_type(), and value_zero().

## ◆ valpy_add()

static PyObject* valpy_add | ( | PyObject * | self,
|  | PyObject * | other
| ) |  |
| static

Definition at line 1205 of file py-value.c.

References VALPY_ADD, and valpy_binop().

## ◆ valpy_and()

static PyObject* valpy_and | ( | PyObject * | self,
|  | PyObject * | other
| ) |  |
| static

Definition at line 1375 of file py-value.c.

References valpy_binop(), and VALPY_BITAND.

## ◆ valpy_binop()

static PyObject* valpy_binop | ( | enum valpy_opcode | opcode,
|  | PyObject * | self,
|  | PyObject * | other
| ) |  |
| static

Definition at line 1187 of file py-value.c.

References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, and valpy_binop_throw().

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().

## ◆ valpy_binop_throw()

static PyObject* valpy_binop_throw | ( | enum valpy_opcode | opcode,
|  | PyObject * | self,
|  | PyObject * | other
| ) |  |
| static

Definition at line 1064 of file py-value.c.

References binop_user_defined_p(), builtin_type_pyint, check_typedef(), convert_value_from_python(), EVAL_NORMAL, is_integral_type(), STRIP_REFERENCE, 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_ptradd(), value_ptrdiff(), value_to_value_object(), value_type(), and value_x_binop().

Referenced by valpy_binop().

## ◆ valpy_call()

static PyObject* valpy_call | ( | PyObject * | self,
|  | PyObject * | args,
|  | PyObject * | keywords
| ) |  |
| static

Definition at line 871 of file py-value.c.

References _, call_function_by_hand(), CATCH, check_typedef(), convert_value_from_python(), END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, TYPE_CODE, TYPE_CODE_FUNC, value_to_value_object(), and value_type().

## ◆ valpy_cast()

static PyObject* valpy_cast | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 603 of file py-value.c.

References valpy_do_cast().

## ◆ valpy_const_value()

static PyObject* valpy_const_value | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 278 of file py-value.c.

References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, make_cv_value(), RETURN_MASK_ALL, TRY, and value_to_value_object().

## ◆ valpy_dealloc()

static void valpy_dealloc | ( | PyObject * | obj | ) |
| static

Definition at line 76 of file py-value.c.

References gdb_assert, value_object::next, value_object::prev, Py_DECREF, Py_TYPE, value_free(), and values_in_python.

## ◆ valpy_dereference()

static PyObject* valpy_dereference | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 174 of file py-value.c.

References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, value_ind(), and value_to_value_object().

## ◆ valpy_divide()

static PyObject* valpy_divide | ( | PyObject * | self,
|  | PyObject * | other
| ) |  |
| static

Definition at line 1223 of file py-value.c.

References valpy_binop(), and VALPY_DIV.

## ◆ valpy_do_cast()

static PyObject* valpy_do_cast | ( | PyObject * | self,
|  | PyObject * | args,
|  | enum exp_opcode | op
| ) |  |
| static

Definition at line 557 of file py-value.c.

References _, CATCH, END_CATCH, gdb_assert, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, type, type_object_to_type(), value_cast(), value_dynamic_cast(), value_reinterpret_cast(), and value_to_value_object().

Referenced by valpy_cast(), valpy_dynamic_cast(), and valpy_reinterpret_cast().

## ◆ valpy_dynamic_cast()

static PyObject* valpy_dynamic_cast | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 611 of file py-value.c.

References valpy_do_cast().

## ◆ valpy_fetch_lazy()

static PyObject* valpy_fetch_lazy | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 1014 of file py-value.c.

References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, value_fetch_lazy(), and value_lazy().

## ◆ valpy_float()

static PyObject* valpy_float | ( | PyObject * | self | ) |
| static

Definition at line 1552 of file py-value.c.

References _, CATCH, check_typedef(), END_CATCH, error(), GDB_PY_HANDLE_EXCEPTION, is_floating_value(), RETURN_MASK_ALL, target_float_to_host_double(), TRY, TYPE_CODE, TYPE_CODE_FLT, value_contents(), and value_type().

## ◆ valpy_get_address()

static PyObject* valpy_get_address | ( | PyObject * | self,
|  | void * | closure
| ) |  |
| static

Definition at line 302 of file py-value.c.

References value_object::address, CATCH, END_CATCH, RETURN_MASK_ALL, TRY, value_object::value, value_addr(), and value_to_value_object().

## ◆ valpy_get_dynamic_type()

static PyObject* valpy_get_dynamic_type | ( | PyObject * | self,
|  | void * | closure
| ) |  |
| static

Definition at line 348 of file py-value.c.

References CATCH, check_typedef(), coerce_ref(), value_object::dynamic_type, END_CATCH, GDB_PY_HANDLE_EXCEPTION, lookup_lvalue_reference_type(), lookup_pointer_type(), RETURN_MASK_ALL, TRY, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_IS_REFERENCE, TYPE_TARGET_TYPE, type_to_type_object(), valpy_get_type(), value_object::value, value_ind(), value_rtti_type(), and value_type().

## ◆ valpy_get_is_lazy()

static PyObject* valpy_get_is_lazy | ( | PyObject * | self,
|  | void * | closure
| ) |  |
| static

Definition at line 991 of file py-value.c.

References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, and value_lazy().

## ◆ valpy_get_is_optimized_out()

static PyObject* valpy_get_is_optimized_out | ( | PyObject * | self,
|  | void * | closure
| ) |  |
| static

Definition at line 968 of file py-value.c.

References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, and value_optimized_out().

## ◆ valpy_get_type()

static PyObject* valpy_get_type | ( | PyObject * | self,
|  | void * | closure
| ) |  |
| static

Definition at line 331 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().

## ◆ valpy_getitem()

static PyObject* valpy_getitem | ( | PyObject * | self,
|  | PyObject * | key
| ) |  |
| static

Definition at line 719 of file py-value.c.

References _, value::bitpos, CATCH, check_typedef(), coerce_ref(), convert_value_from_python(), END_CATCH, error(), exception_none, GDB_PY_HANDLE_EXCEPTION, gdb_py_int_as_long(), gdbpy_is_field(), gdbpy_is_string(), gdb::ref_ptr< T, Policy >::get(), get_field_flag(), get_field_type(), lookup_lvalue_reference_type(), lookup_pointer_type(), lookup_rvalue_reference_type(), 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, TYPE_CODE_RVALUE_REF, value_object::value, value_as_long(), value_cast(), value_has_field(), value_struct_elt(), value_struct_elt_bitpos(), value_subscript(), value_to_value_object(), and value_type().

## ◆ valpy_hash()

static Py_hash_t valpy_hash | ( | PyObject * | self | ) |
| static

Definition at line 1035 of file py-value.c.

## ◆ valpy_int()

static PyObject* valpy_int | ( | PyObject * | self | ) |
| static

Definition at line 1497 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().

## ◆ valpy_invert()

static PyObject* valpy_invert | ( | PyObject * | self | ) |
| static

Definition at line 1342 of file py-value.c.

References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, value_complement(), and value_to_value_object().

## ◆ valpy_lazy_string()

static PyObject* valpy_lazy_string | ( | PyObject * | self,
|  | PyObject * | args,
|  | PyObject * | kw
| ) |  |
| static

Definition at line 429 of file py-value.c.

References _, CATCH, check_typedef(), END_CATCH, error(), GDB_PY_HANDLE_EXCEPTION, GDB_PY_LL_ARG, gdb_PyArg_ParseTupleAndKeywords(), gdbpy_create_lazy_string_object(), get_array_bounds(), type::length, lookup_array_range_type(), RETURN_MASK_ALL, TRY, type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_PTR, TYPE_TARGET_TYPE, value_address(), value_as_address(), and value_type().

## ◆ valpy_length()

static Py_ssize_t valpy_length | ( | PyObject * | self | ) |
| static

Definition at line 625 of file py-value.c.

References _.

## ◆ valpy_long()

static PyObject* valpy_long | ( | PyObject * | self | ) |
| static

Definition at line 1522 of file py-value.c.

References _, CATCH, check_typedef(), END_CATCH, error(), GDB_PY_HANDLE_EXCEPTION, gdb_py_long_from_longest, gdb_py_long_from_ulongest, is_integral_type(), RETURN_MASK_ALL, TRY, TYPE_CODE, TYPE_CODE_PTR, TYPE_UNSIGNED, value_as_long(), and value_type().

## ◆ valpy_lsh()

static PyObject* valpy_lsh | ( | PyObject * | self,
|  | PyObject * | other
| ) |  |
| static

Definition at line 1361 of file py-value.c.

References valpy_binop(), and VALPY_LSH.

## ◆ valpy_lvalue_reference_value()

static PyObject* valpy_lvalue_reference_value | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 264 of file py-value.c.

References TYPE_CODE_REF, and valpy_reference_value().

## ◆ valpy_multiply()

static PyObject* valpy_multiply | ( | PyObject * | self,
|  | PyObject * | other
| ) |  |
| static

Definition at line 1217 of file py-value.c.

References valpy_binop(), and VALPY_MUL.

## ◆ valpy_negative()

static PyObject* valpy_negative | ( | PyObject * | self | ) |
| static

Definition at line 1251 of file py-value.c.

References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, value_neg(), and value_to_value_object().

Referenced by valpy_absolute().

## ◆ valpy_new()

static PyObject* valpy_new | ( | PyTypeObject * | subtype,
|  | PyObject * | args,
|  | PyObject * | keywords
| ) |  |
| static

Definition at line 123 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.

## ◆ valpy_nonzero()

static int valpy_nonzero | ( | PyObject * | self | ) |
| static

Definition at line 1306 of file py-value.c.

References CATCH, check_typedef(), END_CATCH, exception_none, GDB_PY_SET_HANDLE_EXCEPTION, is_floating_value(), is_integral_type(), RETURN_MASK_ALL, target_float_is_zero(), TRY, type, TYPE_CODE, TYPE_CODE_PTR, value_object::value, value_as_long(), value_contents(), and value_type().

## ◆ valpy_or()

static PyObject* valpy_or | ( | PyObject * | self,
|  | PyObject * | other
| ) |  |
| static

Definition at line 1382 of file py-value.c.

References valpy_binop(), and VALPY_BITOR.

## ◆ valpy_positive()

static PyObject* valpy_positive | ( | PyObject * | self | ) |
| static

Definition at line 1274 of file py-value.c.

References value_to_value_object().

Referenced by valpy_absolute().

## ◆ valpy_power()

static PyObject* valpy_power | ( | PyObject * | self,
|  | PyObject * | other,
|  | PyObject * | unused
| ) |  |
| static

Definition at line 1235 of file py-value.c.

References valpy_binop(), and VALPY_POW.

## ◆ valpy_reference_value()

static PyObject* valpy_reference_value | ( | PyObject * | self,
|  | PyObject * | args,
|  | enum type_code | refcode
| ) |  |
| static

Definition at line 242 of file py-value.c.

References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, value_ref(), and value_to_value_object().

Referenced by valpy_lvalue_reference_value(), and valpy_rvalue_reference_value().

## ◆ valpy_referenced_value()

static PyObject* valpy_referenced_value | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 204 of file py-value.c.

References _, CATCH, check_typedef(), coerce_ref(), END_CATCH, error(), GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_REF, TYPE_CODE_RVALUE_REF, value_ind(), value_to_value_object(), and value_type().

## ◆ valpy_reinterpret_cast()

static PyObject* valpy_reinterpret_cast | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 619 of file py-value.c.

References valpy_do_cast().

## ◆ valpy_remainder()

static PyObject* valpy_remainder | ( | PyObject * | self,
|  | PyObject * | other
| ) |  |
| static

Definition at line 1229 of file py-value.c.

References valpy_binop(), and VALPY_REM.

## ◆ valpy_richcompare()

static PyObject* valpy_richcompare | ( | PyObject * | self,
|  | PyObject * | other,
|  | int | op
| ) |  |
| static

Definition at line 1451 of file py-value.c.

References _, CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY, and valpy_richcompare_throw().

## ◆ valpy_richcompare_throw()

static int valpy_richcompare_throw | ( | PyObject * | self,
|  | PyObject * | other,
|  | int | op
| ) |  |
| static

Definition at line 1400 of file py-value.c.

References _, convert_value_from_python(), value_equal(), and value_less().

Referenced by valpy_richcompare().

## ◆ valpy_rsh()

static PyObject* valpy_rsh | ( | PyObject * | self,
|  | PyObject * | other
| ) |  |
| static

Definition at line 1368 of file py-value.c.

References valpy_binop(), and VALPY_RSH.

## ◆ valpy_rvalue_reference_value()

static PyObject* valpy_rvalue_reference_value | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 270 of file py-value.c.

References TYPE_CODE_RVALUE_REF, and valpy_reference_value().

## ◆ valpy_setitem()

static int valpy_setitem | ( | PyObject * | self,
|  | PyObject * | key,
|  | PyObject * | value
| ) |  |
| static

Definition at line 861 of file py-value.c.

References _.

## ◆ valpy_str()

static PyObject* valpy_str | ( | PyObject * | self | ) |
| static

Definition at line 943 of file py-value.c.

References string_file::c_str(), CATCH, common_val_print(), value_print_options::deref_ref, END_CATCH, GDB_PY_HANDLE_EXCEPTION, get_user_print_options(), host_charset(), python_language, RETURN_MASK_ALL, string_file::size(), and TRY.

## ◆ valpy_string()

static PyObject* valpy_string | ( | PyObject * | self,
|  | PyObject * | args,
|  | PyObject * | kw
| ) |  |
| static

Definition at line 518 of file py-value.c.

References CATCH, END_CATCH, GDB_PY_HANDLE_EXCEPTION, gdb_PyArg_ParseTupleAndKeywords(), LA_GET_STRING, type::length, RETURN_MASK_ALL, TRY, TYPE_LENGTH, and xfree().

## ◆ valpy_subtract()

static PyObject* valpy_subtract | ( | PyObject * | self,
|  | PyObject * | other
| ) |  |
| static

Definition at line 1211 of file py-value.c.

References valpy_binop(), and VALPY_SUB.

## ◆ valpy_xor()

static PyObject* valpy_xor | ( | PyObject * | self,
|  | PyObject * | other
| ) |  |
| static

Definition at line 1389 of file py-value.c.

References valpy_binop(), and VALPY_BITXOR.

## ◆ value_has_field()

static int value_has_field | ( | struct value * | v,
|  | PyObject * | field
| ) |  |
| static

Definition at line 637 of file py-value.c.

References _, CATCH, check_typedef(), END_CATCH, GDB_PY_SET_HANDLE_EXCEPTION, gdb.types::has_field(), PyObject_GetAttrString, RETURN_MASK_ALL, TRY, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_IS_REFERENCE, type_object_to_type(), TYPE_TARGET_TYPE, types_equal(), and value_type().

Referenced by valpy_getitem().

## ◆ value_object_to_value()

struct value* value_object_to_value | ( | PyObject * | self | ) |

Definition at line 1600 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(), infpy_thread_from_thread_handle(), pyuw_sniffer(), pyuw_value_obj_to_pointer(), unwind_infopy_add_saved_register(), and unwind_infopy_str().

## ◆ value_to_value_object()

PyObject* value_to_value_object | ( | struct value * | val | ) |

Definition at line 1579 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_throw(), 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().

## Variable Documentation

## ◆ value_object_as_mapping

PyMappingMethods value_object_as_mapping
| static

Initial value:
= {
valpy_length,
valpy_getitem,
valpy_setitem
}
valpy_getitem
static PyObject * valpy_getitem(PyObject *self, PyObject *key)
Definition: py-value.c:719
valpy_setitem
static int valpy_setitem(PyObject *self, PyObject *key, PyObject *value)
Definition: py-value.c:861
valpy_length
static Py_ssize_t valpy_length(PyObject *self)
Definition: py-value.c:625

Definition at line 1876 of file py-value.c.

## ◆ value_object_as_number

PyNumberMethods value_object_as_number
| static

Definition at line 1820 of file py-value.c.

## ◆ value_object_getset

gdb_PyGetSetDef value_object_getset[]
| static

Initial value:
= {
{ "address", valpy_get_address, NULL, "The address of the value.",
NULL },
{ "is_optimized_out", valpy_get_is_optimized_out, NULL,
"Boolean telling whether the value is optimized "
"out (i.e., not available).",
NULL },
{ "type", valpy_get_type, NULL, "Type of the value.", NULL },
{ "dynamic_type", valpy_get_dynamic_type, NULL,
"Dynamic type of the value.", NULL },
{ "is_lazy", valpy_get_is_lazy, NULL,
"Boolean telling whether the value is lazy (not fetched yet\n\
from the inferior). A lazy value is fetched when needed, or when\n\
the \"fetch_lazy()\" method is called.", NULL },
{NULL}
}
valpy_get_dynamic_type
static PyObject * valpy_get_dynamic_type(PyObject *self, void *closure)
Definition: py-value.c:348
valpy_get_type
static PyObject * valpy_get_type(PyObject *self, void *closure)
Definition: py-value.c:331
valpy_get_is_optimized_out
static PyObject * valpy_get_is_optimized_out(PyObject *self, void *closure)
Definition: py-value.c:968
valpy_get_address
static PyObject * valpy_get_address(PyObject *self, void *closure)
Definition: py-value.c:302
valpy_get_is_lazy
static PyObject * valpy_get_is_lazy(PyObject *self, void *closure)
Definition: py-value.c:991

Definition at line 1771 of file py-value.c.

## ◆ value_object_methods

PyMethodDef value_object_methods[]
| static

Definition at line 1788 of file py-value.c.

## ◆ value_object_type

PyTypeObject value_object_type

Definition at line 1882 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().

## ◆ values_in_python

value_object* values_in_python = NULL
| static

Definition at line 72 of file py-value.c.

Referenced by gdbpy_preserve_values(), note_value(), and valpy_dealloc().