aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-05-22 16:55:15 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-05-22 16:55:15 -0400
commit1f704f761b34e145f5eabdc222301ce6e9ec9102 (patch)
tree89c8b6dbf40b606ef045929b718d9271093057a3 /gdb/python
parent5e33d5f4e1a5f2c3556ee31715ddc030d039b597 (diff)
downloadfsf-binutils-gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.zip
fsf-binutils-gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.tar.gz
fsf-binutils-gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.tar.bz2
gdb: remove TYPE_NFIELDS macro
Remove `TYPE_NFIELDS`, changing all the call sites to use `type::num_fields` directly. This is quite a big diff, but this was mostly done using sed and coccinelle. A few call sites were done by hand. gdb/ChangeLog: * gdbtypes.h (TYPE_NFIELDS): Remove. Change all cal sites to use type::num_fields instead. Change-Id: Ib73be4c36f9e770e0f729bac3b5257d7cb2f9591
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-type.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index 4b57e16..dbe25ad 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -1150,7 +1150,7 @@ typy_length (PyObject *self)
if (type == NULL)
return -1;
- return TYPE_NFIELDS (type);
+ return type->num_fields ();
}
/* Implements boolean evaluation of gdb.Type. Handle this like other
@@ -1193,7 +1193,7 @@ typy_getitem (PyObject *self, PyObject *key)
if (type == NULL)
return NULL;
- for (i = 0; i < TYPE_NFIELDS (type); i++)
+ for (i = 0; i < type->num_fields (); i++)
{
const char *t_field_name = TYPE_FIELD_NAME (type, i);
@@ -1251,7 +1251,7 @@ typy_has_key (PyObject *self, PyObject *args)
if (type == NULL)
return NULL;
- for (i = 0; i < TYPE_NFIELDS (type); i++)
+ for (i = 0; i < type->num_fields (); i++)
{
const char *t_field_name = TYPE_FIELD_NAME (type, i);
@@ -1336,7 +1336,7 @@ typy_iterator_iternext (PyObject *self)
typy_iterator_object *iter_obj = (typy_iterator_object *) self;
struct type *type = iter_obj->source->type;
- if (iter_obj->field < TYPE_NFIELDS (type))
+ if (iter_obj->field < type->num_fields ())
{
gdbpy_ref<> result = make_fielditem (type, iter_obj->field,
iter_obj->kind);