diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2025-08-14 16:14:06 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2025-08-19 09:49:46 -0400 |
commit | 4260abb7a700d1c7491648c695ea6bfdff21a432 (patch) | |
tree | 69e2e731f4d298155e94c9f34a2d07861598adb2 /gdb/python | |
parent | 1d5f884e50590cc798fd33e9779f5d72c9d72f9c (diff) | |
download | binutils-4260abb7a700d1c7491648c695ea6bfdff21a432.zip binutils-4260abb7a700d1c7491648c695ea6bfdff21a432.tar.gz binutils-4260abb7a700d1c7491648c695ea6bfdff21a432.tar.bz2 |
gdb: rename address_class -> location_class
The enum address_class and related fields and methods seem misnamed to
me. Generalize it to "location_class". The enumerators in
address_class are already prefixed with LOC, so the new name seems
logical to me. Rename related fields and methods as well.
Plus, address_class could easily be mistaken for other unrelated things
named "address class" in GDB or DWARF.
Tested by rebuilding.
Change-Id: I0dca3738df412b350715286c608041b08e9b4d82
Approved-by: Kevin Buettner <kevinb@redhat.com>
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-framefilter.c | 2 | ||||
-rw-r--r-- | gdb/python/py-symbol.c | 23 | ||||
-rw-r--r-- | gdb/python/py-type.c | 4 |
3 files changed, 13 insertions, 16 deletions
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c index adf4233..db8c274 100644 --- a/gdb/python/py-framefilter.c +++ b/gdb/python/py-framefilter.c @@ -168,7 +168,7 @@ mi_should_print (struct symbol *sym, enum mi_print_types type) { int print_me = 0; - switch (sym->aclass ()) + switch (sym->loc_class ()) { default: case LOC_UNDEF: /* catches errors */ diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c index 3028a30..69062f2 100644 --- a/gdb/python/py-symbol.c +++ b/gdb/python/py-symbol.c @@ -126,7 +126,7 @@ sympy_get_addr_class (PyObject *self, void *closure) SYMPY_REQUIRE_VALID (self, symbol); - return gdb_py_object_from_longest (symbol->aclass ()).release (); + return gdb_py_object_from_longest (symbol->loc_class ()).release (); } /* Implement gdb.Symbol.domain attribute. Return the domain as an @@ -156,42 +156,39 @@ static PyObject * sympy_is_constant (PyObject *self, void *closure) { struct symbol *symbol = NULL; - enum address_class theclass; SYMPY_REQUIRE_VALID (self, symbol); - theclass = symbol->aclass (); + location_class loc_class = symbol->loc_class (); - return PyBool_FromLong (theclass == LOC_CONST || theclass == LOC_CONST_BYTES); + return PyBool_FromLong (loc_class == LOC_CONST || loc_class == LOC_CONST_BYTES); } static PyObject * sympy_is_function (PyObject *self, void *closure) { struct symbol *symbol = NULL; - enum address_class theclass; SYMPY_REQUIRE_VALID (self, symbol); - theclass = symbol->aclass (); + location_class loc_class = symbol->loc_class (); - return PyBool_FromLong (theclass == LOC_BLOCK); + return PyBool_FromLong (loc_class == LOC_BLOCK); } static PyObject * sympy_is_variable (PyObject *self, void *closure) { struct symbol *symbol = NULL; - enum address_class theclass; SYMPY_REQUIRE_VALID (self, symbol); - theclass = symbol->aclass (); + location_class loc_class = symbol->loc_class (); return PyBool_FromLong (!symbol->is_argument () - && (theclass == LOC_LOCAL || theclass == LOC_REGISTER - || theclass == LOC_STATIC || theclass == LOC_COMPUTED - || theclass == LOC_OPTIMIZED_OUT)); + && (loc_class == LOC_LOCAL || loc_class == LOC_REGISTER + || loc_class == LOC_STATIC || loc_class == LOC_COMPUTED + || loc_class == LOC_OPTIMIZED_OUT)); } /* Implementation of Symbol.is_artificial. */ @@ -279,7 +276,7 @@ sympy_value (PyObject *self, PyObject *args) } SYMPY_REQUIRE_VALID (self, symbol); - if (symbol->aclass () == LOC_TYPEDEF) + if (symbol->loc_class () == LOC_TYPEDEF) { PyErr_SetString (PyExc_TypeError, "cannot get the value of a typedef"); return NULL; diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index 10ae636..a2c5939 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -1045,9 +1045,9 @@ typy_template_argument (PyObject *self, PyObject *args) } sym = TYPE_TEMPLATE_ARGUMENT (type, argno); - if (sym->aclass () == LOC_TYPEDEF) + if (sym->loc_class () == LOC_TYPEDEF) return type_to_type_object (sym->type ()); - else if (sym->aclass () == LOC_OPTIMIZED_OUT) + else if (sym->loc_class () == LOC_OPTIMIZED_OUT) { PyErr_Format (PyExc_RuntimeError, _("Template argument is optimized out")); |