GDB (xrefs)
|
#include "defs.h"
#include "value.h"
#include "exceptions.h"
#include "python-internal.h"
#include "charset.h"
#include "gdbtypes.h"
#include "cp-support.h"
#include "demangle.h"
#include "objfiles.h"
#include "language.h"
#include "vec.h"
#include "bcache.h"
#include "dwarf2loc.h"
#include "typeprint.h"
Go to the source code of this file.
Definition at line 88 of file py-type.c.
Referenced by lex_one_token().
typedef struct pyty_field_object field_object |
typedef struct type_equality_entry type_equality_entry_d |
typedef struct pyty_type_object type_object |
static int check_types_equal | ( | struct type * | type1, |
struct type * | type2, | ||
VEC(type_equality_entry_d)** | worklist | ||
) | [static] |
Definition at line 993 of file py-type.c.
References _, CHECK_TYPEDEF, compare_maybe_null_strings(), dwarf2_locexpr_baton::data, FIELD_ARTIFICIAL, FIELD_BITPOS, FIELD_BITSIZE, FIELD_DWARF_BLOCK, FIELD_ENUMVAL, FIELD_LOC_KIND, FIELD_LOC_KIND_BITPOS, FIELD_LOC_KIND_DWARF_BLOCK, FIELD_LOC_KIND_ENUMVAL, FIELD_LOC_KIND_PHYSADDR, FIELD_LOC_KIND_PHYSNAME, FIELD_NAME, FIELD_STATIC_PHYSADDR, FIELD_STATIC_PHYSNAME, FIELD_TYPE, internal_error(), memcmp(), dwarf2_locexpr_baton::per_cu, dwarf2_locexpr_baton::size, type_equality_entry::type1, type_equality_entry::type2, TYPE_CODE, TYPE_CODE_RANGE, TYPE_FIELD, TYPE_INSTANCE_FLAGS, TYPE_LENGTH, TYPE_NAME, TYPE_NFIELDS, TYPE_NOSIGN, TYPE_NOTTEXT, TYPE_RANGE_DATA, TYPE_TAG_NAME, TYPE_TARGET_TYPE, TYPE_UNSIGNED, TYPE_VARARGS, TYPE_VECTOR, and VEC_safe_push.
Referenced by check_types_worklist().
static int check_types_worklist | ( | VEC(type_equality_entry_d)** | worklist, |
struct bcache * | cache | ||
) | [static] |
Definition at line 1107 of file py-type.c.
References bcache_full(), check_types_equal(), type_equality_entry::type1, type_equality_entry::type2, VEC_empty, VEC_last, and VEC_pop.
Referenced by typy_richcompare().
static int compare_maybe_null_strings | ( | const char * | s, |
const char * | t | ||
) | [static] |
Definition at line 977 of file py-type.c.
Referenced by check_types_equal().
static PyObject* convert_field | ( | struct type * | type, |
int | field | ||
) | [static] |
Definition at line 164 of file py-type.c.
References field_is_static(), field_new(), gdb_py_long_from_longest, Py_DECREF, TYPE_CODE, TYPE_CODE_CLASS, TYPE_CODE_ENUM, TYPE_FIELD, TYPE_FIELD_ARTIFICIAL, TYPE_FIELD_BITPOS, TYPE_FIELD_BITSIZE, TYPE_FIELD_ENUMVAL, TYPE_FIELD_NAME, TYPE_FIELD_TYPE, TYPE_N_BASECLASSES, and type_to_type_object().
Referenced by make_fielditem(), typy_fields(), and typy_getitem().
static PyTypeObject type_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF | ( | "type_object" | ) | [static] |
static PyTypeObject field_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF | ( | "field_object" | ) | [static] |
static PyTypeObject type_iterator_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF | ( | "typy_iterator_object" | ) | [static] |
static void field_dealloc | ( | PyObject * | obj | ) | [static] |
Definition at line 124 of file py-type.c.
References pyty_field_object::dict.
static PyObject* field_name | ( | struct type * | type, |
int | field | ||
) | [static] |
Definition at line 258 of file py-type.c.
References TYPE_FIELD_NAME.
Referenced by ada_nget_field_index(), ada_varobj_describe_struct_child(), c_describe_child(), cplus_describe_child(), gdb_mangle_name(), get_symbol_field_type(), and make_fielditem().
Definition at line 133 of file py-type.c.
References pyty_field_object::dict, field_object_type, and Py_DECREF.
Referenced by convert_field().
int gdbpy_initialize_types | ( | void | ) |
Definition at line 1525 of file py-type.c.
References code, field_object_type, gdb_module, gdb_pymodule_addobject(), name, pyty_code::name, save_objfile_types(), type_iterator_object_type, and type_object_type.
Referenced by _initialize_python().
PyObject* gdbpy_lookup_type | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) |
Definition at line 1494 of file py-type.c.
References _, block_object_to_block(), type_to_type_object(), and typy_lookup_typename().
static PyObject* make_fielditem | ( | struct type * | type, |
int | i, | ||
enum gdbpy_iter_kind | kind | ||
) | [static] |
Definition at line 279 of file py-type.c.
References convert_field(), field_name(), gdb_assert_not_reached, iter_items, iter_keys, and iter_values.
Referenced by typy_iterator_iternext().
static void save_objfile_types | ( | struct objfile * | objfile, |
void * | datum | ||
) | [static] |
Definition at line 1186 of file py-type.c.
References copy_type_recursive(), create_copied_types_hash(), current_language, do_cleanups(), ensure_python_env(), gdb_python_initialized, get_objfile_arch(), cleanup::next, pyty_type_object::next, pyty_type_object::prev, and pyty_type_object::type.
Referenced by gdbpy_initialize_types().
static void set_type | ( | type_object * | obj, |
struct type * | type | ||
) | [static] |
Definition at line 1221 of file py-type.c.
References pyty_type_object::next, pyty_type_object::prev, pyty_type_object::type, type, and TYPE_OBJFILE.
Referenced by read_set_type(), and type_to_type_object().
struct type* type_object_to_type | ( | PyObject * | obj | ) | [read] |
Definition at line 1483 of file py-type.c.
References type_object_type.
Referenced by bpfinishpy_pre_stop_hook(), typy_richcompare(), and typy_str().
PyObject* type_to_type_object | ( | struct type * | type | ) |
Definition at line 1471 of file py-type.c.
References set_type(), and type_object_type.
Referenced by bpfinishpy_init(), convert_field(), gdbpy_lookup_type(), stpy_get_type(), sympy_get_type(), typy_array_1(), typy_const(), typy_fields_items(), typy_legacy_template_argument(), typy_pointer(), typy_reference(), typy_strip_typedefs(), typy_target(), typy_template_argument(), typy_unqualified(), and typy_volatile().
static PyObject* typy_array | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 520 of file py-type.c.
References typy_array_1().
static PyObject* typy_array_1 | ( | PyObject * | self, |
PyObject * | args, | ||
int | is_vector | ||
) | [static] |
Definition at line 470 of file py-type.c.
References _, GDB_PY_HANDLE_EXCEPTION, gdb_py_int_as_long(), lookup_array_range_type(), make_vector_type(), RETURN_MASK_ALL, TRY_CATCH, and type_to_type_object().
Referenced by typy_array(), and typy_vector().
static PyObject* typy_const | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 648 of file py-type.c.
References GDB_PY_HANDLE_EXCEPTION, make_cv_type(), RETURN_MASK_ALL, TRY_CATCH, and type_to_type_object().
static void typy_dealloc | ( | PyObject * | obj | ) | [static] |
Definition at line 1239 of file py-type.c.
References pyty_type_object::next, pyty_type_object::prev, pyty_type_object::type, and TYPE_OBJFILE.
static PyObject* typy_field_names | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 390 of file py-type.c.
References iter_keys, and typy_fields_items().
static PyObject* typy_fields | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 366 of file py-type.c.
References convert_field(), iter_values, Py_DECREF, TYPE_CODE, TYPE_CODE_ARRAY, and typy_fields_items().
static PyObject* typy_fields_items | ( | PyObject * | self, |
enum gdbpy_iter_kind | kind | ||
) | [static] |
Definition at line 320 of file py-type.c.
References CHECK_TYPEDEF, GDB_PY_HANDLE_EXCEPTION, Py_DECREF, RETURN_MASK_ALL, TRY_CATCH, type, type_to_type_object(), and typy_make_iter().
Referenced by typy_field_names(), typy_fields(), typy_items(), and typy_values().
Definition at line 1322 of file py-type.c.
References typy_getitem().
static PyObject* typy_get_code | ( | PyObject * | self, |
void * | closure | ||
) | [static] |
static struct type* typy_get_composite | ( | struct type * | type | ) | [static, read] |
Definition at line 435 of file py-type.c.
References CHECK_TYPEDEF, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY_CATCH, type, TYPE_CODE, TYPE_CODE_ENUM, TYPE_CODE_PTR, TYPE_CODE_REF, TYPE_CODE_STRUCT, TYPE_CODE_UNION, and TYPE_TARGET_TYPE.
Referenced by typy_getitem(), typy_has_key(), typy_length(), and typy_make_iter().
static PyObject* typy_get_sizeof | ( | PyObject * | self, |
void * | closure | ||
) | [static] |
Definition at line 696 of file py-type.c.
References check_typedef(), gdb_py_long_from_longest, RETURN_MASK_ALL, TRY_CATCH, and TYPE_LENGTH.
static PyObject* typy_get_tag | ( | PyObject * | self, |
void * | closure | ||
) | [static] |
Definition at line 406 of file py-type.c.
References TYPE_TAG_NAME.
static PyObject* typy_getitem | ( | PyObject * | self, |
PyObject * | key | ||
) | [static] |
Definition at line 1286 of file py-type.c.
References convert_field(), python_string_to_host_string(), strcmp_iw(), TYPE_FIELD_NAME, TYPE_NFIELDS, and typy_get_composite().
Referenced by typy_get().
static PyObject* typy_has_key | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 1347 of file py-type.c.
References strcmp_iw(), TYPE_FIELD_NAME, TYPE_NFIELDS, and typy_get_composite().
static PyObject* typy_items | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 399 of file py-type.c.
References iter_items, and typy_fields_items().
Definition at line 1418 of file py-type.c.
References iter_keys, and typy_make_iter().
static void typy_iterator_dealloc | ( | PyObject * | obj | ) | [static] |
Definition at line 1462 of file py-type.c.
References Py_DECREF, and typy_iterator_object::source.
static PyObject* typy_iterator_iter | ( | PyObject * | self | ) | [static] |
static PyObject* typy_iterator_iternext | ( | PyObject * | self | ) | [static] |
Definition at line 1444 of file py-type.c.
References typy_iterator_object::field, typy_iterator_object::kind, make_fielditem(), typy_iterator_object::source, pyty_type_object::type, and TYPE_NFIELDS.
static PyObject* typy_iteritems | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 1401 of file py-type.c.
References iter_items, and typy_make_iter().
static PyObject* typy_iterkeys | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 1409 of file py-type.c.
References iter_keys, and typy_make_iter().
static PyObject* typy_itervalues | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 1426 of file py-type.c.
References iter_values, and typy_make_iter().
static PyObject* typy_legacy_template_argument | ( | struct type * | type, |
const struct block * | block, | ||
int | argno | ||
) | [static] |
Definition at line 799 of file py-type.c.
References _, cp_demangled_name_to_comp(), do_cleanups(), GDB_PY_HANDLE_EXCEPTION, demangle_parse_info::info, make_cleanup_cp_demangled_name_parse_free(), RETURN_MASK_ALL, demangle_parse_info::tree, TRY_CATCH, TYPE_NAME, type_to_type_object(), and typy_lookup_type().
Referenced by typy_template_argument().
static Py_ssize_t typy_length | ( | PyObject * | self | ) | [static] |
Definition at line 1262 of file py-type.c.
References TYPE_NFIELDS, and typy_get_composite().
static struct type* typy_lookup_type | ( | struct demangle_component * | demangled, |
const struct block * | block | ||
) | [static, read] |
Definition at line 734 of file py-type.c.
References cp_comp_to_string(), GDB_PY_HANDLE_EXCEPTION, lookup_pointer_type(), lookup_reference_type(), make_cv_type(), RETURN_MASK_ALL, TRY_CATCH, type, typy_lookup_typename(), and xfree().
Referenced by typy_legacy_template_argument().
static struct type* typy_lookup_typename | ( | const char * | type_name, |
const struct block * | block | ||
) | [static, read] |
Definition at line 711 of file py-type.c.
References GDB_PY_HANDLE_EXCEPTION, lookup_enum(), lookup_struct(), lookup_typename(), lookup_union(), python_gdbarch, python_language, RETURN_MASK_ALL, TRY_CATCH, and type.
Referenced by gdbpy_lookup_type(), and typy_lookup_type().
static PyObject * typy_make_iter | ( | PyObject * | self, |
enum gdbpy_iter_kind | kind | ||
) | [static] |
Definition at line 1377 of file py-type.c.
References typy_iterator_object::field, typy_iterator_object::kind, typy_iterator_object::source, type_iterator_object_type, and typy_get_composite().
Referenced by typy_fields_items(), typy_iter(), typy_iteritems(), typy_iterkeys(), and typy_itervalues().
static int typy_nonzero | ( | PyObject * | self | ) | [static] |
static PyObject* typy_pointer | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 535 of file py-type.c.
References GDB_PY_HANDLE_EXCEPTION, lookup_pointer_type(), RETURN_MASK_ALL, TRY_CATCH, and type_to_type_object().
static PyObject* typy_range | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 553 of file py-type.c.
References _, LONGEST, Py_DECREF, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_RANGE, TYPE_CODE_STRING, TYPE_HIGH_BOUND, TYPE_INDEX_TYPE, and TYPE_LOW_BOUND.
static PyObject* typy_reference | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 616 of file py-type.c.
References GDB_PY_HANDLE_EXCEPTION, lookup_reference_type(), RETURN_MASK_ALL, TRY_CATCH, and type_to_type_object().
static PyObject* typy_richcompare | ( | PyObject * | self, |
PyObject * | other, | ||
int | op | ||
) | [static] |
Definition at line 1134 of file py-type.c.
References bcache_xfree(), bcache_xmalloc(), bcache::cache, check_types_worklist(), GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY_CATCH, type_equality_entry::type1, type_equality_entry::type2, type_object_to_type(), VEC, VEC_free, and VEC_safe_push.
Definition at line 931 of file py-type.c.
References do_cleanups(), GDB_PY_HANDLE_EXCEPTION, host_charset(), LA_PRINT_TYPE, make_cleanup_ui_file_delete(), mem_fileopen(), gdb_exception::reason, RETURN_MASK_ALL, TRY_CATCH, type_object_to_type(), type_print_raw_options, ui_file_xstrdup(), and xfree().
static PyObject* typy_strip_typedefs | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 417 of file py-type.c.
References check_typedef(), GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, TRY_CATCH, and type_to_type_object().
static PyObject* typy_target | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 632 of file py-type.c.
References _, TYPE_TARGET_TYPE, and type_to_type_object().
static PyObject* typy_template_argument | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 866 of file py-type.c.
References _, block_object_to_block(), check_typedef(), GDB_PY_HANDLE_EXCEPTION, LOC_OPTIMIZED_OUT, LOC_TYPEDEF, RETURN_MASK_ALL, SYMBOL_CLASS, SYMBOL_TYPE, TRY_CATCH, TYPE_CODE, TYPE_CODE_REF, TYPE_N_TEMPLATE_ARGUMENTS, TYPE_TARGET_TYPE, TYPE_TEMPLATE_ARGUMENT, type_to_type_object(), typy_legacy_template_argument(), value_of_variable(), and value_to_value_object().
static PyObject* typy_unqualified | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 680 of file py-type.c.
References GDB_PY_HANDLE_EXCEPTION, make_cv_type(), RETURN_MASK_ALL, TRY_CATCH, and type_to_type_object().
static PyObject* typy_values | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 355 of file py-type.c.
References iter_values, and typy_fields_items().
static PyObject* typy_vector | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 528 of file py-type.c.
References typy_array_1().
static PyObject* typy_volatile | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
Definition at line 664 of file py-type.c.
References GDB_PY_HANDLE_EXCEPTION, make_cv_type(), RETURN_MASK_ALL, TRY_CATCH, and type_to_type_object().
PyGetSetDef field_object_getset[] [static] |
{ { "__dict__", gdb_py_generic_dict, NULL, "The __dict__ for this field.", &field_object_type }, { NULL } }
PyTypeObject field_object_type [static] |
Definition at line 1738 of file py-type.c.
Referenced by field_new(), and gdbpy_initialize_types().
struct pyty_code pyty_codes[] [static] |
{ ENTRY (TYPE_CODE_BITSTRING), ENTRY (TYPE_CODE_PTR), ENTRY (TYPE_CODE_ARRAY), ENTRY (TYPE_CODE_STRUCT), ENTRY (TYPE_CODE_UNION), ENTRY (TYPE_CODE_ENUM), ENTRY (TYPE_CODE_FLAGS), ENTRY (TYPE_CODE_FUNC), ENTRY (TYPE_CODE_INT), ENTRY (TYPE_CODE_FLT), ENTRY (TYPE_CODE_VOID), ENTRY (TYPE_CODE_SET), ENTRY (TYPE_CODE_RANGE), ENTRY (TYPE_CODE_STRING), ENTRY (TYPE_CODE_ERROR), ENTRY (TYPE_CODE_METHOD), ENTRY (TYPE_CODE_METHODPTR), ENTRY (TYPE_CODE_MEMBERPTR), ENTRY (TYPE_CODE_REF), ENTRY (TYPE_CODE_CHAR), ENTRY (TYPE_CODE_BOOL), ENTRY (TYPE_CODE_COMPLEX), ENTRY (TYPE_CODE_TYPEDEF), ENTRY (TYPE_CODE_NAMESPACE), ENTRY (TYPE_CODE_DECFLOAT), ENTRY (TYPE_CODE_INTERNAL_FUNCTION), { TYPE_CODE_UNDEF, NULL } }
PyTypeObject type_iterator_object_type [static] |
{ PyVarObject_HEAD_INIT (NULL, 0) "gdb.TypeIterator", sizeof (typy_iterator_object), 0, typy_iterator_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_ITER, "GDB type iterator object", 0, 0, 0, 0, typy_iterator_iter, typy_iterator_iternext, 0 }
Definition at line 1780 of file py-type.c.
Referenced by gdbpy_initialize_types(), and typy_make_iter().
PyNumberMethods type_object_as_number [static] |
PyGetSetDef type_object_getset[] [static] |
{ { "code", typy_get_code, NULL, "The code for this type.", NULL }, { "sizeof", typy_get_sizeof, NULL, "The size of this type, in bytes.", NULL }, { "tag", typy_get_tag, NULL, "The tag name for this type, or None.", NULL }, { NULL } }
PyMethodDef type_object_methods[] [static] |
PyTypeObject type_object_type [static] |
Definition at line 1689 of file py-type.c.
Referenced by gdbpy_initialize_types(), type_object_to_type(), and type_to_type_object().
PyMappingMethods typy_mapping [static] |
{ typy_length, typy_getitem, NULL }
struct objfile_data* typy_objfile_data_key [static] |