aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-08-30 11:49:49 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-09-30 22:05:57 -0400
commit33d16dd987d16fe1eb289853e5a444192bb31d9e (patch)
tree06c5ec20fad9309ab4dace3b6c659fa518d272af /gdb/python
parentd3fd12dfc52cf4cbb910830e3ff60dca111f7468 (diff)
downloadbinutils-33d16dd987d16fe1eb289853e5a444192bb31d9e.zip
binutils-33d16dd987d16fe1eb289853e5a444192bb31d9e.tar.gz
binutils-33d16dd987d16fe1eb289853e5a444192bb31d9e.tar.bz2
gdb: remove TYPE_FIELD_NAME and FIELD_NAME macros
Remove the `TYPE_FIELD_NAME` and `FIELD_NAME` macros, changing all the call sites to use field::name directly. Change-Id: I6900ae4e1ffab1396e24fb3298e94bf123826ca6
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-type.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index aa1553b..f0f8357 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -204,13 +204,13 @@ convert_field (struct type *type, int field)
}
arg.reset (NULL);
- if (TYPE_FIELD_NAME (type, field))
+ if (type->field (field).name ())
{
- const char *field_name = TYPE_FIELD_NAME (type, field);
+ const char *field_name = type->field (field).name ();
if (field_name[0] != '\0')
{
- arg.reset (PyString_FromString (TYPE_FIELD_NAME (type, field)));
+ arg.reset (PyString_FromString (type->field (field).name ()));
if (arg == NULL)
return NULL;
}
@@ -261,8 +261,8 @@ field_name (struct type *type, int field)
{
gdbpy_ref<> result;
- if (TYPE_FIELD_NAME (type, field))
- result.reset (PyString_FromString (TYPE_FIELD_NAME (type, field)));
+ if (type->field (field).name ())
+ result.reset (PyString_FromString (type->field (field).name ()));
else
result = gdbpy_ref<>::new_reference (Py_None);
@@ -1205,7 +1205,7 @@ typy_getitem (PyObject *self, PyObject *key)
for (i = 0; i < type->num_fields (); i++)
{
- const char *t_field_name = TYPE_FIELD_NAME (type, i);
+ const char *t_field_name = type->field (i).name ();
if (t_field_name && (strcmp_iw (t_field_name, field.get ()) == 0))
return convert_field (type, i).release ();
@@ -1263,7 +1263,7 @@ typy_has_key (PyObject *self, PyObject *args)
for (i = 0; i < type->num_fields (); i++)
{
- const char *t_field_name = TYPE_FIELD_NAME (type, i);
+ const char *t_field_name = type->field (i).name ();
if (t_field_name && (strcmp_iw (t_field_name, field) == 0))
Py_RETURN_TRUE;