gdb: fix flake8 warnings in gdb.base/gdb-index-many-types.py

Fix those:

    gdb/testsuite/gdb.base/gdb-index-many-types.py:17:18: F821 undefined name 'gdb'
    gdb/testsuite/gdb.base/gdb-index-many-types.py:26:42: F821 undefined name 'gdb'
    gdb/testsuite/gdb.base/gdb-index-many-types.py:29:16: F821 undefined name 'gdb'
    gdb/testsuite/gdb.base/gdb-index-many-types.py:31:19: F821 undefined name 'gdb'
    gdb/testsuite/gdb.base/gdb-index-many-types.py:33:16: F821 undefined name 'gdb'
    gdb/testsuite/gdb.base/gdb-index-many-types.py:33:51: F821 undefined name 'gdb'
    gdb/testsuite/gdb.base/gdb-index-many-types.py:47:17: E722 do not use bare 'except'

Change-Id: Iba1949a211af66e8dd1e6cb77a44845e5fa60c2e
This commit is contained in:
Simon Marchi
2025-11-13 11:47:08 -05:00
parent ccd56e2270
commit c6f30fe326

View File

@@ -13,6 +13,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import gdb
class TypeViewer(gdb.Command):
"""A command which takes a string and looks up types with that name.
@@ -44,7 +46,7 @@ class TypeViewer(gdb.Command):
if len(fields) > 0:
fields = fields + " "
fields = fields + "%s %s;" % (str(f.type), f.name)
except:
except Exception:
pass
fields = fields + " }"