From patchwork Fri May 7 01:05:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12243813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CEA6C43460 for ; Fri, 7 May 2021 01:05:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B0E6761289 for ; Fri, 7 May 2021 01:05:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0E6761289 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 53D306B00BE; Thu, 6 May 2021 21:05:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C7C26B00BF; Thu, 6 May 2021 21:05:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 341526B00C0; Thu, 6 May 2021 21:05:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0065.hostedemail.com [216.40.44.65]) by kanga.kvack.org (Postfix) with ESMTP id 126926B00BE for ; Thu, 6 May 2021 21:05:05 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id CD21499B3 for ; Fri, 7 May 2021 01:05:04 +0000 (UTC) X-FDA: 78112640928.21.2EADFAD Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf16.hostedemail.com (Postfix) with ESMTP id 6832580192ED for ; Fri, 7 May 2021 01:04:55 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8E56A61041; Fri, 7 May 2021 01:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1620349503; bh=I3SeJ6HRy1Z7CPZFZRWgezQYkFbLw0hT9hCBb4UYLzQ=; h=Date:From:To:Subject:In-Reply-To:From; b=JFrkk4GTD8KoKNdroSCC9Tw3edQMKQoebXXvHGdog/3SMk+JITBCjinmsuOrmVKqZ 2Liol+0DI3gGLHW8nYFVPrefssPBQpEux/XwPpDz64/fnoWv3l/nCz29AlP4BlkOdR Gk0qOI/7FAQuehEf8NuoeT9R8J673P9KaAzuel6Q= Date: Thu, 06 May 2021 18:05:03 -0700 From: Andrew Morton To: akpm@linux-foundation.org, jan.kiszka@siemens.com, johannes.berg@intel.com, kbingham@kernel.org, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 58/91] gdb: lx-symbols: store the abspath() Message-ID: <20210507010503.UbLiMisse%akpm@linux-foundation.org> In-Reply-To: <20210506180126.03e1baee7ca52bedb6cc6003@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=JFrkk4GT; dmarc=none; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: 1u1j7e4tarsqotrwax1wzkkna58zwgsx X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 6832580192ED Received-SPF: none (linux-foundation.org>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620349495-910582 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Berg Subject: gdb: lx-symbols: store the abspath() If we store the relative path, the user might later cd to a different directory, and that would break the automatic symbol resolving that happens when a module is loaded into the target kernel. Fix this by storing the abspath() of each path given, just like we already do for the cwd (os.getcwd() is absolute.) Link: https://lkml.kernel.org/r/20201217091747.bf4332cf2b35.I10ebbdb7e9b80ab1a5cddebf53d073be8232d656@changeid Signed-off-by: Johannes Berg Reviewed-by: Jan Kiszka Cc: Kieran Bingham Signed-off-by: Andrew Morton --- scripts/gdb/linux/symbols.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/scripts/gdb/linux/symbols.py~gdb-lx-symbols-store-the-abspath +++ a/scripts/gdb/linux/symbols.py @@ -164,7 +164,8 @@ lx-symbols command.""" saved_state['breakpoint'].enabled = saved_state['enabled'] def invoke(self, arg, from_tty): - self.module_paths = [os.path.expanduser(p) for p in arg.split()] + self.module_paths = [os.path.abspath(os.path.expanduser(p)) + for p in arg.split()] self.module_paths.append(os.getcwd()) # enforce update