From patchwork Wed Apr 12 11:15:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 82420 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp259562vqo; Wed, 12 Apr 2023 04:48:50 -0700 (PDT) X-Google-Smtp-Source: AKy350Y9nwKNTllC4PRD3bLXmf/OrFR2AoNi7gliYfG53N9BiXjJ3F23Fi0SNuwNyPmdqgDK1j6Z X-Received: by 2002:aa7:cb95:0:b0:504:b228:878d with SMTP id r21-20020aa7cb95000000b00504b228878dmr5026662edt.25.1681300130147; Wed, 12 Apr 2023 04:48:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681300130; cv=none; d=google.com; s=arc-20160816; b=BGTJlr+sEb9NmH7/wpHjITIvQ9oWUhDzlsFEnPsH3qsgtmOE8XoUydC4AnCZmNMdpn FozmmtcUij52qmTib2QmGTHO/qWRuMGEgj9pPnL+blP5HtHRFyrtrPpIzMCFMq/rbxM3 wVuS1+Yoas6odQsfRlN28ZorvM5PgYLRc3Xke4YAdY9rL9UNwvOQgz0Vxx/PhNxJfCtS NMZyv8gMVPoD0oFmBqTuUf26LC8bP05HfhXTjHeoveEqAmuw9j6zWjrWwDwVieXhp1UE xKRQnDU1e3uOMP2+ncAJylmzsPwAX0YLw3PbPZN4W/UK6roWTtdatFFIdqJcg+RPgaa+ wGlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=fdMxTaimtY9PGTCHo9yrggTuFyYb15asKrJ56OGTy2M=; b=wfseoi0L3X1Fing149Ksb/GOiix9DUZHw32iTdyyoZSnSbBi202r7KvgU+HOr3OYi0 4sVUC10xxjNI1wWEc44rHdxBMvHFJe2tp18ib9xC072TvtQzy29KCvgnQa/PPRSF2Ghx CgFvjbVh/1SetYM6UTbZ95PxViYfih5MzFxEWI+/W3p2UpkwOLG4Ddo6al6FddmDPdQR 6MsZhVxlEOoP7NSwqb20fGtvNj/MANx2Etypm5ldXRpS3tYf3ldaX+5+qmfYhbvhphzy 9zRFOfKY3M/uo6IDAi/P/tGfnze5SCoEP3QBggAqoYhm+CQPwHTz0QucvAkY93tbn2gH JzAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=U2CXHgM1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020aa7c04d000000b005049423fad5si1626962edo.293.2023.04.12.04.48.25; Wed, 12 Apr 2023 04:48:50 -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=@samsung.com header.s=mail20170921 header.b=U2CXHgM1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229964AbjDLLYf (ORCPT + 99 others); Wed, 12 Apr 2023 07:24:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbjDLLYd (ORCPT ); Wed, 12 Apr 2023 07:24:33 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E91F72B8 for ; Wed, 12 Apr 2023 04:24:10 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230412112345euoutp01a4bd5189cdc466b86db6c0e5dda30a00~VLDE6OsQi2017720177euoutp01i for ; Wed, 12 Apr 2023 11:23:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230412112345euoutp01a4bd5189cdc466b86db6c0e5dda30a00~VLDE6OsQi2017720177euoutp01i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1681298625; bh=fdMxTaimtY9PGTCHo9yrggTuFyYb15asKrJ56OGTy2M=; h=From:To:CC:Subject:Date:References:From; b=U2CXHgM18lINoJOqdDtl/aF6HLrEDRylr3mO9EWQyK8lOSTDBY9j1aHj5byq+MyMZ fXyU4o8M24sfbTFpXjGU3rIdHxlghROOmSTqSS62aiNGANG7VrXRuWURitF2THvIGb EBABdcykVVWj06CeXSgPeIwLzSx9TREHSGGdBUuo= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230412112345eucas1p22aeb7a28114cfcf9075d4cdb0ab230f9~VLDElUrT_2347623476eucas1p2G; Wed, 12 Apr 2023 11:23:45 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 5F.B6.10014.1C496346; Wed, 12 Apr 2023 12:23:45 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230412112345eucas1p10c0ab064156268c9021abe9fc6bf1fd3~VLDEMmYJU1472114721eucas1p1b; Wed, 12 Apr 2023 11:23:45 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230412112345eusmtrp187b95d9ed7ac3702ce5c23d2ca7bfb27~VLDEMJCFh0093500935eusmtrp1J; Wed, 12 Apr 2023 11:23:45 +0000 (GMT) X-AuditID: cbfec7f5-ba1ff7000000271e-78-643694c1167a Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 23.B2.34412.0C496346; Wed, 12 Apr 2023 12:23:44 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230412112344eusmtip18b2d00b41d48baa46a7529cc316f61e3~VLDECS2Tv2758727587eusmtip1u; Wed, 12 Apr 2023 11:23:44 +0000 (GMT) Received: from localhost (106.110.32.140) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 12 Apr 2023 12:23:40 +0100 From: Pankaj Raghav To: , CC: , , , , Subject: [PATCH] scripts/gdb: use mem instead of core_layout to get the module address Date: Wed, 12 Apr 2023 13:15:08 +0200 Message-ID: <20230412111508.892296-1-p.raghav@samsung.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Originating-IP: [106.110.32.140] X-ClientProxiedBy: CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLIsWRmVeSWpSXmKPExsWy7djP87oHp5ilGCz4JWVx7+ZNZotT3ZuZ LC7vmsNmcWPCU0aL48v/sjmwemxa1cnmsf3kJCaPz5vkApijuGxSUnMyy1KL9O0SuDIm31jG VHCPv2Li4ZfsDYxXeLoYOTkkBEwkujq+s3cxcnEICaxglNhzZzWU84VRou1mCwuE85lR4tjF 6cwwLZtnT2WDSCxnlGi53YZQterzeqjMFkaJl42HgVo4ONgEtCQaO9lBukUEjCVeTD7GBh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J7KDJIQEtgC5Jy2 62Lk4GAT0JJo7GQHCYsIGEu8mHwMbA6zQI3E4w2rweLCAmES26fuYwKxWQRUJXZ//g1m8wpY SezZvZwVZIyEgLzE4gcSEGFBiZMzn7BAjJGXaN46mxnClpA4+OIFM8RpSkDXnGGBsGslOl+d ZpvAKDQLSfssJO2zkLQvYGRexSiSWlqcm55bbKRXnJhbXJqXrpecn7uJERgx24793LKDceWr j3qHGJk4GA8xSnAwK4nw/nAxTRHiTUmsrEotyo8vKs1JLT7EaAr0zkRmKdHkfGDM5pXEG5oZ mBqamFkamFqaGSuJ83oWdCQKCaQnlqRmp6YWpBbB9DFxcEo1MAXt9d537DGjpJHcmhS+9b5p X3oWBz287RKyekY8q/K0z6X7p7F8sjvqlmnzrUbQ4AsHf6Ca/0YHNsEzTqtE1+0vvnQ3Y++i d9cqNkrPWGTwIcxuQvumhDdcLryS99Yle1/1VmKVquz5XHtAdO0G8+tf99bf11ujHzX/8+nL nMniH90lpidd8bviOEst6UPLMWPZ7yuEb1Q8WnBFfPHBor7tX56s7hGYFrHj/cPtSy4b/Vxo ukBmpd7MeUsDRf/XV/5c15474U2fle3d7oT5Dit5Vm3+1OWh+cVP4u6OTN4pTK5PHjqnBC6I aGpz2zUvaHfG0xl97TKqZucf/gt5WubsHrntbv7Sf4yT3wetU9ZWYinOSDTUYi4qTgQA1cl5 QiEDAAA= X-CMS-MailID: 20230412112345eucas1p10c0ab064156268c9021abe9fc6bf1fd3 X-Msg-Generator: CA X-RootMTR: 20230412112345eucas1p10c0ab064156268c9021abe9fc6bf1fd3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230412112345eucas1p10c0ab064156268c9021abe9fc6bf1fd3 References: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762970431244344563?= X-GMAIL-MSGID: =?utf-8?q?1762970965165079061?= commit ac3b43283923 ("module: replace module_layout with module_memory") changed the struct module data structure from module_layout to module_memory. The core_layout member which is used while loading modules are not available anymore leading to the following error while running gdb: (gdb) lx-symbols loading vmlinux Python Exception : There is no member named core_layout. Error occurred in Python: There is no member named core_layout. Replace core_layout with its new counterpart mem[MOD_TEXT]. Fixes: ac3b43283923 ("module: replace module_layout with module_memory") Signed-off-by: Pankaj Raghav --- scripts/gdb/linux/modules.py | 2 +- scripts/gdb/linux/symbols.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py index 441b23239896..6ec51e913070 100644 --- a/scripts/gdb/linux/modules.py +++ b/scripts/gdb/linux/modules.py @@ -73,7 +73,7 @@ class LxLsmod(gdb.Command): " " if utils.get_long_type().sizeof == 8 else "")) for module in module_list(): - layout = module['core_layout'] + layout = module['mem'][0] gdb.write("{address} {name:<19} {size:>8} {ref}".format( address=str(layout['base']).split()[0], name=module['name'].string(), diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index dc07b6d12e30..3a7976401e00 100644 --- a/scripts/gdb/linux/symbols.py +++ b/scripts/gdb/linux/symbols.py @@ -109,7 +109,7 @@ lx-symbols command.""" def load_module_symbols(self, module): module_name = module['name'].string() - module_addr = str(module['core_layout']['base']).split()[0] + module_addr = str(module['mem'][0]['base']).split()[0] module_file = self._get_module_file(module_name) if not module_file and not self.module_files_updated: