Remove some unnecessary qualification from printing.py
authorTom Tromey <tromey@adacore.com>
Tue, 26 Sep 2023 15:51:56 +0000 (09:51 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 26 Sep 2023 15:51:56 +0000 (09:51 -0600)
printing.py references "gdb.printing" in a few spots, but there's no
need for this.  I think this is leftover from when this code was
(briefly) in some other module.  This patch removes the unnecessary
qualifications.  Tested on x86-64 Fedora 36.

gdb/python/lib/gdb/printing.py

index 0bbe2cb8ae7767aab0da9bcccf3b876265230782..dec1351c2d7b84d0dc2f454b14c07e9aa3963d6f 100644 (file)
@@ -367,15 +367,15 @@ def make_visualizer(value):
     else:
         ty = value.type.strip_typedefs()
         if ty.is_string_like:
-            result = gdb.printing.NoOpScalarPrinter(value)
+            result = NoOpScalarPrinter(value)
         elif ty.code == gdb.TYPE_CODE_ARRAY:
-            result = gdb.printing.NoOpArrayPrinter(ty, value)
+            result = NoOpArrayPrinter(ty, value)
         elif ty.is_array_like:
             value = value.to_array()
             ty = value.type.strip_typedefs()
-            result = gdb.printing.NoOpArrayPrinter(ty, value)
+            result = NoOpArrayPrinter(ty, value)
         elif ty.code in (gdb.TYPE_CODE_STRUCT, gdb.TYPE_CODE_UNION):
-            result = gdb.printing.NoOpStructPrinter(ty, value)
+            result = NoOpStructPrinter(ty, value)
         elif ty.code in (
             gdb.TYPE_CODE_PTR,
             gdb.TYPE_CODE_REF,
@@ -383,7 +383,7 @@ def make_visualizer(value):
         ):
             result = NoOpPointerReferencePrinter(value)
         else:
-            result = gdb.printing.NoOpScalarPrinter(value)
+            result = NoOpScalarPrinter(value)
     return result