gdb: remove SYMBOL_TYPE macro

Add a getter and a setter for a symbol's type.  Remove the corresponding
macro and adjust all callers.

Change-Id: Ie1a137744c5bfe1df4d4f9ae5541c5299577c8de
This commit is contained in:
Simon Marchi 2022-01-27 22:16:41 -05:00
parent f5abd8f234
commit 5f9c5a63ce
57 changed files with 342 additions and 333 deletions

View file

@ -250,7 +250,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
if (function != NULL)
{
struct type *ret_type =
check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (function)));
check_typedef (TYPE_TARGET_TYPE (function->type ()));
/* Remember only non-void return types. */
if (ret_type->code () != TYPE_CODE_VOID)

View file

@ -72,13 +72,13 @@ sympy_get_type (PyObject *self, void *closure)
SYMPY_REQUIRE_VALID (self, symbol);
if (SYMBOL_TYPE (symbol) == NULL)
if (symbol->type () == NULL)
{
Py_INCREF (Py_None);
return Py_None;
}
return type_to_type_object (SYMBOL_TYPE (symbol));
return type_to_type_object (symbol->type ());
}
static PyObject *

View file

@ -998,7 +998,7 @@ typy_template_argument (PyObject *self, PyObject *args)
sym = TYPE_TEMPLATE_ARGUMENT (type, argno);
if (sym->aclass () == LOC_TYPEDEF)
return type_to_type_object (SYMBOL_TYPE (sym));
return type_to_type_object (sym->type ());
else if (sym->aclass () == LOC_OPTIMIZED_OUT)
{
PyErr_Format (PyExc_RuntimeError,