]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb, testsuite, python: Add missing imports.
authorSchimpe, Christina <christina.schimpe@intel.com>
Mon, 19 Feb 2024 17:59:24 +0000 (17:59 +0000)
committerSchimpe, Christina <christina.schimpe@intel.com>
Wed, 25 Sep 2024 11:04:45 +0000 (11:04 +0000)
Removing the pretty printer (bound_registers.py) in the next commit
leads to failures due to a missing import of 'gdb.printing':

"AttributeError: module 'gdb' has no attribute 'printing'".

Add this import to each file requiring it, as it's not imported by the
pretty-printer anymore.

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/python/lib/gdb/dap/varref.py
gdb/testsuite/gdb.python/py-pp-cast.py
gdb/testsuite/gdb.python/py-pp-re-notag.py
gdb/testsuite/gdb.python/py-prettyprint-stub.py

index 57e84a1676e2a39c1a99ea29541de4a9b2996b88..0dd98797086e2e9e4d27875d15068b4fecee7443 100644 (file)
@@ -18,6 +18,7 @@ from collections import defaultdict
 from contextlib import contextmanager
 
 import gdb
+import gdb.printing
 
 from .server import client_bool_capability
 from .startup import DAPException, in_gdb_thread
index 6eff8008ebea4d05491d8202a54ab80ac97ee251..a0c48f9548a9a9425a349e3aa68b8dd651fae760 100644 (file)
@@ -13,6 +13,7 @@
 # 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.printing
 
 class PpIntPrinter(object):
     def __init__(self, val):
index 6aefad13d853014661339727748cd8c1b77fcae0..3bbf588708425b7945b10cd2b4d03835888ec6e5 100644 (file)
@@ -16,7 +16,7 @@
 from time import asctime, gmtime
 
 import gdb  # silence pyflakes
-
+import gdb.printing
 
 class TimePrinter:
     def __init__(self, val):
index 565ae192d206e6b9713a035371e97bb62326e822..75d5f35f164228f0f807e3ee552e3b44f59bfd7a 100644 (file)
@@ -16,6 +16,7 @@
 # This file is part of the GDB testsuite.
 # It tests Python-based pretty-printing of stubs.
 
+import gdb.printing
 
 class SPrinter:
     def __init__(self, val):