diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2021-11-20 08:40:12 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2022-02-06 15:48:19 -0500 |
commit | 5b6074611edfdd1590e8da1ca443950b47942bbb (patch) | |
tree | a8bd20dacac08b7c4d6ddfe627474e33fe36fb71 /gdb/python/py-linetable.c | |
parent | c61596525811d9b0fe79be8f11e5a142ade96dab (diff) | |
download | binutils-5b6074611edfdd1590e8da1ca443950b47942bbb.zip binutils-5b6074611edfdd1590e8da1ca443950b47942bbb.tar.gz binutils-5b6074611edfdd1590e8da1ca443950b47942bbb.tar.bz2 |
gdb: remove SYMTAB_LINETABLE macro, add getter/setter
Add a getter and a setter for a symtab's linetable. Remove the
corresponding macro and adjust all callers.
Change-Id: I159183fc0ccd8e18ab937b3c2f09ef2244ec6e9c
Diffstat (limited to 'gdb/python/py-linetable.c')
-rw-r--r-- | gdb/python/py-linetable.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/python/py-linetable.c b/gdb/python/py-linetable.c index dfd4cbe..8e545fe 100644 --- a/gdb/python/py-linetable.c +++ b/gdb/python/py-linetable.c @@ -192,16 +192,16 @@ ltpy_has_line (PyObject *self, PyObject *args) if (! PyArg_ParseTuple (args, GDB_PY_LL_ARG, &py_line)) return NULL; - if (SYMTAB_LINETABLE (symtab) == NULL) + if (symtab->linetable () == NULL) { PyErr_SetString (PyExc_RuntimeError, _("Linetable information not found in symbol table")); return NULL; } - for (index = 0; index < SYMTAB_LINETABLE (symtab)->nitems; index++) + for (index = 0; index < symtab->linetable ()->nitems; index++) { - struct linetable_entry *item = &(SYMTAB_LINETABLE (symtab)->item[index]); + struct linetable_entry *item = &(symtab->linetable ()->item[index]); if (item->line == py_line) Py_RETURN_TRUE; } @@ -223,7 +223,7 @@ ltpy_get_all_source_lines (PyObject *self, PyObject *args) LTPY_REQUIRE_VALID (self, symtab); - if (SYMTAB_LINETABLE (symtab) == NULL) + if (symtab->linetable () == NULL) { PyErr_SetString (PyExc_RuntimeError, _("Linetable information not found in symbol table")); @@ -234,9 +234,9 @@ ltpy_get_all_source_lines (PyObject *self, PyObject *args) if (source_dict == NULL) return NULL; - for (index = 0; index < SYMTAB_LINETABLE (symtab)->nitems; index++) + for (index = 0; index < symtab->linetable ()->nitems; index++) { - item = &(SYMTAB_LINETABLE (symtab)->item[index]); + item = &(symtab->linetable ()->item[index]); /* 0 is used to signify end of line table information. Do not include in the source set. */ @@ -399,13 +399,13 @@ ltpy_iternext (PyObject *self) LTPY_REQUIRE_VALID (iter_obj->source, symtab); - if (iter_obj->current_index >= SYMTAB_LINETABLE (symtab)->nitems) + if (iter_obj->current_index >= symtab->linetable ()->nitems) { PyErr_SetNone (PyExc_StopIteration); return NULL; } - item = &(SYMTAB_LINETABLE (symtab)->item[iter_obj->current_index]); + item = &(symtab->linetable ()->item[iter_obj->current_index]); /* Skip over internal entries such as 0. 0 signifies the end of line table data and is not useful to the API user. */ @@ -414,12 +414,12 @@ ltpy_iternext (PyObject *self) iter_obj->current_index++; /* Exit if the internal value is the last item in the line table. */ - if (iter_obj->current_index >= SYMTAB_LINETABLE (symtab)->nitems) + if (iter_obj->current_index >= symtab->linetable ()->nitems) { PyErr_SetNone (PyExc_StopIteration); return NULL; } - item = &(SYMTAB_LINETABLE (symtab)->item[iter_obj->current_index]); + item = &(symtab->linetable ()->item[iter_obj->current_index]); } obj = build_linetable_entry (item->line, item->pc); |