From patchwork Tue Aug 1 12:57:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 129307 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2678413vqg; Tue, 1 Aug 2023 06:44:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlHcM+sTWp/4GnjEwnJ/tN1ukUN6Y3pEs+Wyzwt7ZfnWaXa3q4ul6yzHsj5DDJ8BE/u8pfPv X-Received: by 2002:a05:6808:e82:b0:3a4:6b13:b721 with SMTP id k2-20020a0568080e8200b003a46b13b721mr13494093oil.46.1690897463993; Tue, 01 Aug 2023 06:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690897463; cv=none; d=google.com; s=arc-20160816; b=U749b4PSMm+7RF4Esb3wLC/6kPjo+KVu52hdgyJeaLa36qLkQFpJNVmwxM8LbpQ7Eh yR92tNL4Ar7fNuUrXCiq+wnnttTd3tSgxANs73UoQ2n6JXfjMrlSkc8F89VeU49Vss+p xdlL+gAU+evnYRun0khOIgm3kr3ccBkIAZ3YCgqtdvADk/ITIUdkz0Tv8gVV94ILNcbD nIK1jI1XRwq834hAGHketFVa/tNO14sUvjfsbr4LPcnCh1Nb/tZKoQHtQIpntU6Q/9ds UHq6OxfnIOEFJ/2Us92pvrqXqfk24LfKOiE2SXbk/LnWtrTH8yfYIRAcbls9kB4O0Vvt fciA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=bnCBluV5/peVM0jbJDidt8t/2S3NU8gWwe7j2Nlnw0Y=; fh=QfxTM6ImvIC4c8sJTc8vMNCC7gIT2SPyBTEsv5GMA74=; b=VrYHIEAESdSsf+PwgAT4enlNxBhvyBisFbywOETM8X36gGCl2QiJEowVRrXxHVf6WL ueIGiOztHvNVlCaofKuKfG+Bme715ePLOYV+i8PcID78kaYp8nQsFo1tX2CQNbK7WpBU 7nGv9jltSTQ30mfjA7Q2ZtOOUOX/7gizc15Z9epFHQYnyQwXVYYp3hygesqSvEu8MTum p1aFXMX3CeRDPpEgB5nYCm1BXSlq1OO0NdJ2+Twa2oWCVqx72HJwertZdndg6ts+Jlsq R+cxA7MGuyKazTon3sM4IMw7H/tzCKXUdE2i4tRAmxYaGd6oW0J0kV8i461FkOf11aWX 7svQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=ztCH3XjC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a63e80e000000b0055b12581c75si9007979pgh.675.2023.08.01.06.44.10; Tue, 01 Aug 2023 06:44:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=ztCH3XjC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232493AbjHAM50 (ORCPT + 99 others); Tue, 1 Aug 2023 08:57:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232504AbjHAM5W (ORCPT ); Tue, 1 Aug 2023 08:57:22 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 189541FD2 for ; Tue, 1 Aug 2023 05:57:21 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fbb634882dso12226805e9.0 for ; Tue, 01 Aug 2023 05:57:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1690894639; x=1691499439; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bnCBluV5/peVM0jbJDidt8t/2S3NU8gWwe7j2Nlnw0Y=; b=ztCH3XjCFi/VZjLTNuJ0M23wzispoT6pb4iomI2lAXpfGHDgaFI0uV9S5LULrjjktJ CqQLgh2xoX33qhXxyn0st3EV/n2K1mdNlKmCg49QhMoxh4pltj+2h95LYCMDqmyRhc3r dgTMMY45e92dR++kpZc5UNsQikxBBpJKAKPkk0JRiupM/4oZ4ub7BoIcNXjEF8JOYPaJ JQC0ngMEItSK2pivZk9ypjqGudZHF4LsIYdYUmJTtMCqZBjXKfh0c8kBQBFQPQHjTuBe MGmo22aWPoePMOwOnPw+dPlB7SclvthVQwLsarVAegFF0XJ3ujTy4HapJ54QIVeFzZuM ukYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690894639; x=1691499439; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bnCBluV5/peVM0jbJDidt8t/2S3NU8gWwe7j2Nlnw0Y=; b=IcshxR53nBI1GmlUgTb3oTSU2HL1lFTv7j3HGlSpRhw/Mufru/ET+etz79bijoxwRB y7xJa7xhv1DkZdm/r936Cv43e5YFgk1suwJJ1iA7ElbaJfG9jBV3GY299u6KcIA6B6DK Ftqk2Pc5u8DS3GbbWkBZDOl+Te6hiyzcvd10rSytWVVKXoS3vRsbPQtgwJcSV3hUYStV d55loxy6qpgC93Tt5K7lpqyU+/v54nbSf36CdjJhX+qxB4Ru1/9XUwvWv42uiSMo9HYR 0iVKLxJR8za1sS3QGjvAMRczniFrnH1XlJ3srFDmFNqcS49nAWgMsX++NutTTlMpMLHt G8Ew== X-Gm-Message-State: ABy/qLbYMpU13wbTZGBJSRlH6MCs7vwdO0C/PvgBVVgpbEEcL8CxapNM WHyHSx02n1nOebtOrSEmUPypwQ== X-Received: by 2002:a5d:630c:0:b0:317:5eb8:b1c0 with SMTP id i12-20020a5d630c000000b003175eb8b1c0mr7415154wru.5.1690894639122; Tue, 01 Aug 2023 05:57:19 -0700 (PDT) Received: from carbon-x1.home ([2a01:cb15:81c2:f100:94c1:d2b1:7300:5620]) by smtp.gmail.com with ESMTPSA id y17-20020adfd091000000b003178dc2371bsm12630712wrh.7.2023.08.01.05.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 05:57:18 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: Jan Kiszka , Kieran Bingham , linux-kernel@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= Subject: [PATCH] scripts/gdb: fix usage of MOD_TEXT not defined when CONFIG_MODULES=n Date: Tue, 1 Aug 2023 14:57:15 +0200 Message-Id: <20230801125715.139721-1-cleger@rivosinc.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773034499401946227 X-GMAIL-MSGID: 1773034499401946227 MOD_TEXT is only defined if CONFIG_MODULES=y which lead to loading failure of the gdb scripts when kernel is built without CONFIG_MODULES=y: Reading symbols from vmlinux... Traceback (most recent call last): File "/foo/vmlinux-gdb.py", line 25, in import linux.constants File "/foo/scripts/gdb/linux/constants.py", line 14, in LX_MOD_TEXT = gdb.parse_and_eval("MOD_TEXT") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ gdb.error: No symbol "MOD_TEXT" in current context. Add a conditional check on CONFIG_MODULES to fix this error. Fixes: b4aff7513df3 ("scripts/gdb: use mem instead of core_layout to get the module address") Signed-off-by: Clément Léger --- scripts/gdb/linux/constants.py.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/gdb/linux/constants.py.in b/scripts/gdb/linux/constants.py.in index 50a92c4e9984..866015547b38 100644 --- a/scripts/gdb/linux/constants.py.in +++ b/scripts/gdb/linux/constants.py.in @@ -63,7 +63,8 @@ LX_GDBPARSED(IRQD_LEVEL) LX_GDBPARSED(IRQ_HIDDEN) /* linux/module.h */ -LX_GDBPARSED(MOD_TEXT) +if IS_BUILTIN(CONFIG_MODULES): + LX_GDBPARSED(MOD_TEXT) /* linux/mount.h */ LX_VALUE(MNT_NOSUID)