From patchwork Mon Sep 23 06:31:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schimpe, Christina" X-Patchwork-Id: 97836 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7EDCB3858417 for ; Mon, 23 Sep 2024 06:32:42 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by sourceware.org (Postfix) with ESMTPS id E32C73858D37 for ; Mon, 23 Sep 2024 06:32:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E32C73858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E32C73858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727073133; cv=none; b=dVzixuN/NxmFdvWIghd3jmGDD4luqCBE0BIMtiK8cXNQkmzfkAIO96NuXVSaHuI3ZYSl4AcT5SHgvScZIUQRfE67VhTiByJ5/Cc5RfTecR68X+BxDGEBCpwk6JKYNS+UU3yTS4ZBlvPam3UDqCt6xx6/5dMvNepwU9ZE1PSv9Ww= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727073133; c=relaxed/simple; bh=xranKPneOgdd6d2OtYDEP6mbVoHgzci9VTzTEbdiaQ4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ITiWBVqypEn3KS46LnVDKo9p/q+G9sMMEp3VKzGofqKNTT3IdqdP1B7Xy207kMjVkKS5DaflQNXDY9Wa+FUiqmOsDt/1T+W/AtisAWYGaYXms2VrWCx3EbgpJEMdFEeYNLxoY0Qj6aMWYKsfwQikx1o0Akig23u3l7ecANgNIBQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727073131; x=1758609131; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xranKPneOgdd6d2OtYDEP6mbVoHgzci9VTzTEbdiaQ4=; b=oCRqWjv4Bhe7Ti11GJLH9gQ2kisXwFWXUeN9tdIQkLUGeNo61iVWB0Ls RWNEUT8RrFyxz/c2fYT3F51qTL3B6vL3m1//jE/0uI+ZSw0zqegiep5NP qDCf8QTE28n4IdaLkk3++x04ZmTJrJMoHywviAYbh8uIFvWc+Z/hYmIaf nEfiJF14etp1AjsgYvIM3F4iwDzEEA8IFbBfzw7CJ1sYKiBxDj0ONqkL2 OKtMYTUiiiXFlii5Cfvy0dLlMYXxT6w6zMbEJfzhjVRqmr2S3JS8LGi1c +Kvi7ayc8brm3/rZJym2mimvbggneYMZe9ALfpyUYkPyLxfDRHSm+oefa Q==; X-CSE-ConnectionGUID: q/lIKhUpROCGOSmSHHSKRA== X-CSE-MsgGUID: nkdbRqDYTbS3Ozks6YNMJg== X-IronPort-AV: E=McAfee;i="6700,10204,11202"; a="51424314" X-IronPort-AV: E=Sophos;i="6.10,250,1719903600"; d="scan'208";a="51424314" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2024 23:32:09 -0700 X-CSE-ConnectionGUID: dOZO7gV1SlyD99SspgMnbQ== X-CSE-MsgGUID: TCBqTXl4QuCH4naZkzEbAw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,250,1719903600"; d="scan'208";a="70858446" Received: from gkldtt-dev-004.igk.intel.com (HELO localhost) ([10.123.221.202]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2024 23:32:08 -0700 From: "Schimpe, Christina" To: gdb-patches@sourceware.org Cc: felix.willgerodt@intel.com, jhb@FreeBSD.org, aburgess@redhat.com Subject: [PATCH v5 1/2] gdb, testsuite, python: Add missing imports. Date: Mon, 23 Sep 2024 06:31:10 +0000 Message-Id: <20240923063111.758484-2-christina.schimpe@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240923063111.758484-1-christina.schimpe@intel.com> References: <20240923063111.758484-1-christina.schimpe@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org 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 --- gdb/python/lib/gdb/dap/varref.py | 1 + gdb/testsuite/gdb.python/py-pp-cast.py | 1 + gdb/testsuite/gdb.python/py-pp-re-notag.py | 2 +- gdb/testsuite/gdb.python/py-prettyprint-stub.py | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/python/lib/gdb/dap/varref.py b/gdb/python/lib/gdb/dap/varref.py index 57e84a1676e..0dd98797086 100644 --- a/gdb/python/lib/gdb/dap/varref.py +++ b/gdb/python/lib/gdb/dap/varref.py @@ -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 diff --git a/gdb/testsuite/gdb.python/py-pp-cast.py b/gdb/testsuite/gdb.python/py-pp-cast.py index 6eff8008ebe..a0c48f9548a 100644 --- a/gdb/testsuite/gdb.python/py-pp-cast.py +++ b/gdb/testsuite/gdb.python/py-pp-cast.py @@ -13,6 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import gdb.printing class PpIntPrinter(object): def __init__(self, val): diff --git a/gdb/testsuite/gdb.python/py-pp-re-notag.py b/gdb/testsuite/gdb.python/py-pp-re-notag.py index 6aefad13d85..3bbf5887084 100644 --- a/gdb/testsuite/gdb.python/py-pp-re-notag.py +++ b/gdb/testsuite/gdb.python/py-pp-re-notag.py @@ -16,7 +16,7 @@ from time import asctime, gmtime import gdb # silence pyflakes - +import gdb.printing class TimePrinter: def __init__(self, val): diff --git a/gdb/testsuite/gdb.python/py-prettyprint-stub.py b/gdb/testsuite/gdb.python/py-prettyprint-stub.py index 565ae192d20..75d5f35f164 100644 --- a/gdb/testsuite/gdb.python/py-prettyprint-stub.py +++ b/gdb/testsuite/gdb.python/py-prettyprint-stub.py @@ -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):