gdb: remove SYMBOL_CLASS macro, add getter

Change-Id: I83211d5a47efc0564386e5b5ea4a29c00b1fd46a
This commit is contained in:
Simon Marchi 2021-11-21 22:26:24 -05:00
parent d1eebf9a6f
commit 66d7f48f80
42 changed files with 147 additions and 144 deletions

View file

@ -169,7 +169,7 @@ mi_should_print (struct symbol *sym, enum mi_print_types type)
{
int print_me = 0;
switch (SYMBOL_CLASS (sym))
switch (sym->aclass ())
{
default:
case LOC_UNDEF: /* catches errors */

View file

@ -131,7 +131,7 @@ sympy_get_addr_class (PyObject *self, void *closure)
SYMPY_REQUIRE_VALID (self, symbol);
return gdb_py_object_from_longest (SYMBOL_CLASS (symbol)).release ();
return gdb_py_object_from_longest (symbol->aclass ()).release ();
}
static PyObject *
@ -152,7 +152,7 @@ sympy_is_constant (PyObject *self, void *closure)
SYMPY_REQUIRE_VALID (self, symbol);
theclass = SYMBOL_CLASS (symbol);
theclass = symbol->aclass ();
return PyBool_FromLong (theclass == LOC_CONST || theclass == LOC_CONST_BYTES);
}
@ -165,7 +165,7 @@ sympy_is_function (PyObject *self, void *closure)
SYMPY_REQUIRE_VALID (self, symbol);
theclass = SYMBOL_CLASS (symbol);
theclass = symbol->aclass ();
return PyBool_FromLong (theclass == LOC_BLOCK);
}
@ -178,7 +178,7 @@ sympy_is_variable (PyObject *self, void *closure)
SYMPY_REQUIRE_VALID (self, symbol);
theclass = SYMBOL_CLASS (symbol);
theclass = symbol->aclass ();
return PyBool_FromLong (!SYMBOL_IS_ARGUMENT (symbol)
&& (theclass == LOC_LOCAL || theclass == LOC_REGISTER
@ -260,7 +260,7 @@ sympy_value (PyObject *self, PyObject *args)
}
SYMPY_REQUIRE_VALID (self, symbol);
if (SYMBOL_CLASS (symbol) == LOC_TYPEDEF)
if (symbol->aclass () == LOC_TYPEDEF)
{
PyErr_SetString (PyExc_TypeError, "cannot get the value of a typedef");
return NULL;

View file

@ -997,9 +997,9 @@ typy_template_argument (PyObject *self, PyObject *args)
}
sym = TYPE_TEMPLATE_ARGUMENT (type, argno);
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF)
if (sym->aclass () == LOC_TYPEDEF)
return type_to_type_object (SYMBOL_TYPE (sym));
else if (SYMBOL_CLASS (sym) == LOC_OPTIMIZED_OUT)
else if (sym->aclass () == LOC_OPTIMIZED_OUT)
{
PyErr_Format (PyExc_RuntimeError,
_("Template argument is optimized out"));