Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1046222pxu; Thu, 17 Dec 2020 00:19:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJypFSam4axc4Ldf7KNz/83Vm6JrrzcHKQoeHfUNy/rZTp9JzAmy0C6TkdSeKrUgUqfLZ7OY X-Received: by 2002:aa7:d74d:: with SMTP id a13mr10443903eds.78.1608193182642; Thu, 17 Dec 2020 00:19:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608193182; cv=none; d=google.com; s=arc-20160816; b=mmEIMGn8W3SNDD//OcLasuI2zIzbb7LNNvdqdg5H9/QKkvnMiLUEJY45fePNB1ywBk qfsqbby903Yy/Koj9ZruB1+68BTOpW3xco79pyyHzUTKfHvUsQ5GB9gMU6iMJGNO+87D kh4/qDgJBPbPsleFadXzeYKO4e+BbmCM45CBkM6lZNu+m6BALzvmbVgklIBs9GIBbhM1 a36gxsMDl+KwtcRhkLsuihiMQ1+z5GhkZfLa9pgpytv779Z2Uq+AkMUsEY3sAnEG0YT2 9XcftVZYCoEl7dfe/IA5Tw8BYoYaCj8kGMrT6ns69XUKkmOGrsGxDAJ+2UpVnp+RQiAi 0PsQ== 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; bh=d0uEzmHrXZsnbhBL5YzgLprM9KcK4ubmvNK2wMI5LK4=; b=nt7Tx60z8pVfD83lLX+SCo0QC1aaXoucZaMTZKLRm3UdLD8QxrnU2DhqKZKGmCdqDH 2MX3zGvPdzRYvLrsOjmQ2h2vrKEPAYeO0rSZ1FqwSC4kJMPtjtMRYy8nRcrngVEeZMzt lbV8Rqz8IeXLrmjxXJSO6yfB3Ko9kX3p+mLFDhVWfTUNpCT7YCThnmBXZ0epSc3eKj69 4h9lEzgkKc2Ks944wd53w/qbaDr1NG6I9dOZtI0EQWEBBlmEEuhRccOhAfKfXsfWDerH 4UokefTIHEt8B3I9NYA/8LIuTCLQSxuq2q6nCRnt2O3GGqQErIREYySrsABSIQTp1WHV yDMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si2164626ejp.536.2020.12.17.00.19.19; Thu, 17 Dec 2020 00:19:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727300AbgLQISg (ORCPT + 99 others); Thu, 17 Dec 2020 03:18:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725988AbgLQISg (ORCPT ); Thu, 17 Dec 2020 03:18:36 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8C4DC061794 for ; Thu, 17 Dec 2020 00:17:55 -0800 (PST) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1kpoTx-00AYbO-E1; Thu, 17 Dec 2020 09:17:53 +0100 From: Johannes Berg To: linux-kernel@vger.kernel.org Cc: Jan Kiszka , Kieran Bingham , Johannes Berg Subject: [PATCH v2] gdb: lx-symbols: store the abspath() Date: Thu, 17 Dec 2020 09:17:47 +0100 Message-Id: <20201217091747.bf4332cf2b35.I10ebbdb7e9b80ab1a5cddebf53d073be8232d656@changeid> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg 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.) Signed-off-by: Johannes Berg --- v2: break the long line --- scripts/gdb/linux/symbols.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index 1be9763cf8bb..08d264ac328b 100644 --- a/scripts/gdb/linux/symbols.py +++ b/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 -- 2.26.2