From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 072ED3858410 for ; Tue, 26 Oct 2021 09:38:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 072ED3858410 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x433.google.com with SMTP id u18so14650966wrg.5 for ; Tue, 26 Oct 2021 02:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=USUPHBplDjyHrkCfFd/guZQtveQ0v2S/pLMpD16ZC2s=; b=O0i3XDV9ZtJbe51NGawUbPyNJ/v8LBPaPWv1xbXUpctNBlYbjnALa0/44BLURv4ofi DW0x9ipN5Lblrz8QJa7/4/gjkHObZDVfmW8j9sBJjdDPjPLNNI5ILMGM6Em+k8uQt+E3 q2Iso4R0wBaxWghddUV4Ck02sYMTJGveNQ59R76DIL3jaRlzI2aaWnUnkzA5AM883ddt hUtQI9yGfnwSQceVKyA+SR9BUP4uNnfObrjqJi9d3S/M26Y7uAcDMK9AKGTNC7+aP+fB OqBMY9+dJT9NH3dku/Lkq06rmdkn47YHGVjIcxWN2sXd5rpqmlxkaieQiusauXEMsaeB dlSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=USUPHBplDjyHrkCfFd/guZQtveQ0v2S/pLMpD16ZC2s=; b=0WGyMNfMQINkEc9XVFgo6jGmHvtJRwR/iohClQI7BiDm9G7W7EMuwy5VnhTHXWoIE1 uZ56/6jGH1S5pwQ5FarPD0M28NFMxtp2xUHES7IuoldEIldt/3cCovBguH1CujOh0TGQ zYuqbQ2XBqvjKn6BOk/NVJxVbBCewRO93kSjmf1mlmV3t7Kb0Ch52/GqcFrwQ/Usb6mg 4h61QJrg88Oqfj4F8KlBgAGUeebN++qGkWbiIB2md6HmbDFuHNJm/0EGWVQ2fYK5ktcc BPMV3iQEKl0o1njqbWDkBZCNi9HWUht2tOfMij1A9q1xJcOnsCVfg7BBtcAE9daxkV3U 9kNQ== X-Gm-Message-State: AOAM530xjDZekuflGPqk31qiwrWp1O8L654vGaxEOnGUk8hTid9msTJZ MQp/kj16D70nbXweEIzQ9NMU4Ra63vKjCA== X-Google-Smtp-Source: ABdhPJx909VC/SI/Kqf99QoVatrPDHcXiB3fjxS5ecNdKQ2XgRn4YJaZDt20y8wqlcAT8rvRKVjgdQ== X-Received: by 2002:a5d:64aa:: with SMTP id m10mr30551493wrp.196.1635241082901; Tue, 26 Oct 2021 02:38:02 -0700 (PDT) Received: from localhost (host86-180-62-146.range86-180.btcentralplus.com. [86.180.62.146]) by smtp.gmail.com with ESMTPSA id t6sm12822560wrw.78.2021.10.26.02.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 02:38:02 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PATCH 1/4] gdb/python: make some global variables static Date: Tue, 26 Oct 2021 10:37:56 +0100 Message-Id: <666b1efbde4e68a870a448a921e4c0d3746a8d1b.1635241044.git.andrew.burgess@embecosm.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2021 09:38:06 -0000 Make a couple of global variables static in python/python.c. To do this I had to move the definition of extension_language_python to later in the file. There should be no user visible changes after this commit. --- gdb/python/python.c | 53 ++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/gdb/python/python.c b/gdb/python/python.c index c81814c557b..c7b5e7faa8e 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -58,33 +58,6 @@ static const char *const python_excp_enums[] = the default. */ static const char *gdbpy_should_print_stack = python_excp_message; -#ifdef HAVE_PYTHON -/* Forward decls, these are defined later. */ -extern const struct extension_language_script_ops python_extension_script_ops; -extern const struct extension_language_ops python_extension_ops; -#endif - -/* The main struct describing GDB's interface to the Python - extension language. */ -const struct extension_language_defn extension_language_python = -{ - EXT_LANG_PYTHON, - "python", - "Python", - - ".py", - "-gdb.py", - - python_control, - -#ifdef HAVE_PYTHON - &python_extension_script_ops, - &python_extension_ops -#else - NULL, - NULL -#endif -}; #ifdef HAVE_PYTHON @@ -151,7 +124,7 @@ static gdb::optional gdbpy_colorize /* The interface between gdb proper and loading of python scripts. */ -const struct extension_language_script_ops python_extension_script_ops = +static const struct extension_language_script_ops python_extension_script_ops = { gdbpy_source_script, gdbpy_source_objfile_script, @@ -161,7 +134,7 @@ const struct extension_language_script_ops python_extension_script_ops = /* The interface between gdb proper and python extensions. */ -const struct extension_language_ops python_extension_ops = +static const struct extension_language_ops python_extension_ops = { gdbpy_initialize, gdbpy_initialized, @@ -191,6 +164,28 @@ const struct extension_language_ops python_extension_ops = gdbpy_colorize, }; +/* The main struct describing GDB's interface to the Python + extension language. */ +const struct extension_language_defn extension_language_python = +{ + EXT_LANG_PYTHON, + "python", + "Python", + + ".py", + "-gdb.py", + + python_control, + +#ifdef HAVE_PYTHON + &python_extension_script_ops, + &python_extension_ops +#else + NULL, + NULL +#endif +}; + /* Architecture and language to be used in callbacks from the Python interpreter. */ struct gdbarch *python_gdbarch; -- 2.25.4