From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id VGApMrqln2FCCQAAWB0awg (envelope-from ) for ; Thu, 25 Nov 2021 10:03:22 -0500 Received: by simark.ca (Postfix, from userid 112) id BC6A41F0CE; Thu, 25 Nov 2021 10:03:22 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_REPLYTO_END_DIGIT,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 11F351EDEE for ; Thu, 25 Nov 2021 10:03:22 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7F432385842C for ; Thu, 25 Nov 2021 15:03:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F432385842C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1637852600; bh=18H7OB6XZ4gco1vRiAtTEjN4S5yFUGmDJIADklwHLbQ=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=K3oIutONJezi4rmy8KNJfz8XU5KF1el9kL5pZ2CdNpyTw60z4m5Zr8aCBkjmXYVSz 7XnTQEbuJhVJpXROeoa/W8AalSRVjFbOBsEi1voZ9C6JIKox9bnG5RjaOMfKrAkwQ7 Jri8fa8RyGr79Qs7HOyCREJ0KPIT3du9g7vsZitM= Received: from AUS01-ME3-obe.outbound.protection.outlook.com (mail-me3aus01olkn2163.outbound.protection.outlook.com [40.92.63.163]) by sourceware.org (Postfix) with ESMTPS id 38B223858D35 for ; Thu, 25 Nov 2021 15:03:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 38B223858D35 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hqo0MQ/F+54RREB05XImWN0GzdZH1IXyQNJsFKOM7/sbnAOWzcEfSLcTsYuaR82KOr99akOmY7IADPCdPcTZxvGOgD88wYau1OdegETi6hHX7vo3TZ5AuueU28Mjcjw9umn/kZWjq/RqPrKbVsTJANXJppMCej3TUvm0xoaFRIvs2bwmZs19ggY8n/QGd8m311+le4V9RdtQt90W+fOkxTPRmwV8IWpPpMWqtAWGrAULL3LElntNESF7TP5+ByM6+9XpG/TjzLzt3qCes230iOnWoKDm6Y3cF8kzTjm+3OrBFB1R0kuK1412y2ixDm60HIS7T8UCJEcsARIX8LwzEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=18H7OB6XZ4gco1vRiAtTEjN4S5yFUGmDJIADklwHLbQ=; b=Y3BqfM/ETBFplJZWUPMm3YKhRxVu/Qx9IXkuJgrlZgl9ifO68LwC+ODRDV6I0rfGb2v7YfilzzgAVNKEw3MiOvZMG3mRDgMEFdzgJwkKz2ORxor9206BmOxlffgoWiF0/gm9imaKiVn251SbcfeKQF8QZ9EZbIjXIMQGte5mvHbj4Oa5CExxGUA4hUb5Rj00N3wpr+HdFVexKpYMZGWrQq4n0QKfdgV68JCCOmT8E5phjrjAhR9M15t2WefhclOSUT7fq/lY96rU60g8wi7b8uG3ewlMBOHdqAj3/zOcKjheEHYwDyYVskxfMXUjx1VEJTtRig8IiVNNLdZtpXRbuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM (10.255.164.138) by ME2P282MB0084.AUSP282.PROD.OUTLOOK.COM (10.255.147.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.22; Thu, 25 Nov 2021 15:02:54 +0000 Received: from MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM ([fe80::b1d5:bf09:16b0:4b2c]) by MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM ([fe80::b1d5:bf09:16b0:4b2c%7]) with mapi id 15.20.4713.027; Thu, 25 Nov 2021 15:02:54 +0000 Message-ID: Subject: Re: [PATCH 1/4] gdb/python: make some global variables static To: Andrew Burgess , Tom Tromey Date: Thu, 25 Nov 2021 23:02:49 +0800 In-Reply-To: <20211125101242.GQ2662946@redhat.com> References: <666b1efbde4e68a870a448a921e4c0d3746a8d1b.1635241044.git.andrew.burgess@embecosm.com> <87sfwmnrta.fsf@tromey.com> <20211125101242.GQ2662946@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 Content-Transfer-Encoding: 8bit X-TMN: [KrP8fgPa8HM19cFUNmffkb/cTR1Hde5o] X-ClientProxiedBy: HK0PR03CA0102.apcprd03.prod.outlook.com (2603:1096:203:b0::18) To MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:71::10) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.3.105] (61.48.211.155) by HK0PR03CA0102.apcprd03.prod.outlook.com (2603:1096:203:b0::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.22 via Frontend Transport; Thu, 25 Nov 2021 15:02:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1550a80a-18e4-40cf-b695-08d9b024a894 X-MS-TrafficTypeDiagnostic: ME2P282MB0084: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n3p1j7DuEuA93H5CZFbC2K9jD+QVxVVrYqQlSc1VGKg803Hov87a9RkTt8SdTmY7MLsjQQjneOY82Yore2Qi/KJRQ3TjxAawkMmnywjCswGf64jcuMQENiOG2Z8Qzn9B5MEGxKpBfP4pes8HNtE+0FZtRUh8VQ0NP8bXeS8fmdULHOejkiCiK5oZN0gWeoQdKcwSh+lyvtBwxBckyI3YCTdudO9aeJK6moQvTTHDDfINS0dSBlalNrlco6X2mWe13vHxBvPECrvkYPotJsnMnDoy87yCzYwuezzm5F+T+oOVB919OB18xYRbwS+nGmjHQZxez5VHV1EOopJywMLqAoyTJRb/y+7IaTeQ1n8MApaF9D7958qoYcoIr8yRJSl3CkEY2TRJTDRD8pqi4u+k7sXFJ7KZZAeDRrxZyvXoNzhQpZa+SgIywdzKP67qlFFT7qe6Wndr0prZdbNjLhGRDX93BL+4FQkcaNlNQhmL+bA5DTbReNoAqUgU35Zmoa0w9A/0OAiaJY42+9Y9AjcDjQKzBzfSHAd4IN8ernsCvX6a/qNKnwFtOuniJh637WbC2kvUX94xEMGBaIX/chqItA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rOcWctdn88E2m0VD+L5u0Fin6BlHT9s7C4melhq69jIAje3PslGIkHr84vvtUzXHpoSPRBGzZkI94nQr9bI2tha8al4rWgkp3JPEIbY0DE736AGo1pmE2Nf1hM8zQAEQbJKhGcmVXgdcKnarYw0tuOkshu8nWgAhu3QKvT9EA52Bf3+TLyMGCcBjUwKpjMtNDxSGKO9d+7TujQEXLJszMoFlKoeMAB4iv1aZIa3PD4bKN5YtP4juUKmURnc8lO411MJGHYy0LJp8scB9bT5Z0i2MvuKhJBesK9Fujq+ku9oOn9DB7eIJlKQ060dQ3RWvm5rCK7WRqX6WtrM/0JDqMmr6i+D2bpJ5OCoT5iQGd2Ibo8Su22m0rHy64iApvE2NN4RJC6ZzYYoM6EHQRLmaDrmDS+PGetAX5QvC+qfS80uCK5PK8sf0PYPkgfBpotGnmgOo8Ukf0TF1OKM+zVpg7ZrLnY9gevqYTbL8LNNYXYS7eshRVJnRmxy8j8a5E/D2adqmj8y+tMHscNTy8kCT0KW500OWJJ3micXwYHfa7b0U5e7gBlLvl0tjQoSCmLZSOpgEvodqKWBWYobBoK+J8NUMh7SdMbvDXMDE3p4I1E/GJsfi+9FLIyglUfSMpEvK7z374iDbuao9xGt91KAbilK1rEVIuCDoGd6KfuYjfSofJmKduHTXpgBU9RLlgax7BqugiKWa50eE1+LieUP/KA== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-8dac2.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 1550a80a-18e4-40cf-b695-08d9b024a894 X-MS-Exchange-CrossTenant-AuthSource: MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2021 15:02:54.6203 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: ME2P282MB0084 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: , From: Enze Li via Gdb-patches Reply-To: Enze Li Cc: Andrew Burgess , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi Andrew, After using this patch, I encountered the following error when compiling. ----------------------------------------------------------------------- CXXLD gdb /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse- linux/bin/ld: extension.o: in function `ext_lang_before_prompt(char const*)': /home/lee/dev/binutils-gdb/gdb/extension.c:914: undefined reference to `extension_language_python' /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse- linux/bin/ld: extension.o: in function `get_ext_lang_defn(extension_language)': /home/lee/dev/binutils-gdb/gdb/extension.c:107: undefined reference to `extension_language_python' /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse- linux/bin/ld: /home/lee/dev/binutils-gdb/gdb/extension.c:105: undefined reference to `extension_language_python' /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse- linux/bin/ld: extension.o: in function `get_ext_lang_of_file(char const*)': /home/lee/dev/binutils-gdb/gdb/extension.c:132: undefined reference to `extension_language_python' /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse- linux/bin/ld: extension.o: in function `ext_lang_initialization()': /home/lee/dev/binutils-gdb/gdb/extension.c:331: undefined reference to `extension_language_python' /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse- linux/bin/ld: extension.o:/home/lee/dev/binutils- gdb/gdb/extension.c:359: more undefined references to `extension_language_python' follow collect2: error: ld returned 1 exit status make[2]: *** [Makefile:1904: gdb] Error 1 make[2]: Leaving directory '/home/lee/dev/binutils-gdb/gdb' make[1]: *** [Makefile:13458: all-gdb] Error 2 make[1]: Leaving directory '/home/lee/dev/binutils-gdb' make: *** [Makefile:1000: all] Error 2 ---------------------------------------------------------------------- On Thu, 2021-11-25 at 10:12 +0000, Andrew Burgess via Gdb-patches wrote: > * Tom Tromey [2021-10-27 14:20:01 -0600]: > > > > > > > > "Andrew" == Andrew Burgess > > > > > > > writes: > > > > Andrew> Make a couple of global variables static in python/python.c.  > > To do > > Andrew> this I had to move the definition of > > extension_language_python to > > Andrew> later in the file. > > > > Andrew> There should be no user visible changes after this commit. > > > > This looks good to me. > > Thanks, I've pushed this patch. > > Andrew > Here is my system environment, OpenSuse Tumbleweed (Updated just now) - gcc 11.2.1 20210816 [revision 056e324ce46a7924b5cf10f61010cf9dd2ca10e9] I executed the following command to compile, # ./configure --prefix=/path/to/gdb-src/build/ # make I guess the problem may be in the macro definition. I tested with the following patch and the problem disappeared. Hope this may help to solve this problem. ----------------------------------------------------------------------- diff --git a/gdb/python/python.c b/gdb/python/python.c index d8a6a5978de..bfb691f0eac 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -164,6 +164,8 @@ static const struct extension_language_ops python_extension_ops = gdbpy_colorize, }; +#endif /* HAVE_PYTHON */ + /* The main struct describing GDB's interface to the Python extension language. */ const struct extension_language_defn extension_language_python = @@ -186,6 +188,8 @@ const struct extension_language_defn extension_language_python = #endif }; +#ifdef HAVE_PYTHON + /* Architecture and language to be used in callbacks from the Python interpreter. */ struct gdbarch *python_gdbarch; ----------------------------------------------------------------------- Thanks, Enze