Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1043450pxu; Thu, 17 Dec 2020 00:13:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZZ7mqSLoblJtd9JbTdH3tcwuVDU48EcJpkTH6+SMu2948NyAd4AdEeLQG0z1RvdozlbFU X-Received: by 2002:aa7:cb16:: with SMTP id s22mr306653edt.53.1608192827568; Thu, 17 Dec 2020 00:13:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608192827; cv=none; d=google.com; s=arc-20160816; b=wLm0Pby6bRvov1LnG/coCw/DYRwYzUM8m7FVkt1bIVOP5oU919LS9tsW1xUpFmLALq jkn+vXwIggzmvNF+F9J/GiXuOjYjGg3odDnWbm2Nxa+hpwSKyMehdj4Do6Mk/k+9bLdZ 65fKyZ2+XZVd43nIIjeDLPhP16rDcddz3GMwhC20tt0GSmsH85qKJOBClFknp4yxaSzK LZt/XpJcqS3xrmWBeUhDvfOwL6wJlrFuWTNtfwg1JQowphIqGpvZYwW8EaGadB8eqo6K LCujyQxj7gRWqVf7l/se8EYZ5zpj4TB2/fNbOSD9fxCZTcdp7hKYEd8zLxOSIFSgOd88 cZtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=cCuX4k60wVv9bkHnOORYfOLtf2CEMj01x2nNeZZrXDg=; b=C+zlXTjyZLxOU0GVtXKC5pCdmPQIuHEwDn6sskK+mIwYVTWJO1zwqMq4hI/60gSQX9 TmnpdR6FGLFK/8fTK9RKkkI7nLklmIwhM50v8Zue2fL4Mu+bpp9Xi7wbtzwekyft2ngW YTGPdY6QqM8hOeI8Q4u2ZVrD5mkcdtFY5oGM6JR0TfpYxtAaCN27FXkFCWPa6DJUhhrq mGrwGAOXwCJdXirME8GIqfvfcZuCeHr7QVcU0xUc4fyuO9G9R3BEiRT7fwePfAZBbhD4 2TrCA93ErKLhl83MlSum/JpX8f/SIudonWs89xR8MCFTYOx2v6TZK9zRA7FcI4TnPsFf /5+g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rn2si2299514ejb.251.2020.12.17.00.13.24; Thu, 17 Dec 2020 00:13:47 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727420AbgLQILu (ORCPT + 99 others); Thu, 17 Dec 2020 03:11:50 -0500 Received: from lizzard.sbs.de ([194.138.37.39]:39033 "EHLO lizzard.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727397AbgLQILu (ORCPT ); Thu, 17 Dec 2020 03:11:50 -0500 Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id 0BH8AxQp011312 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Dec 2020 09:10:59 +0100 Received: from [167.87.38.225] ([167.87.38.225]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 0BH8Axob019959; Thu, 17 Dec 2020 09:10:59 +0100 Subject: Re: [PATCH] gdb: lx-symbols: store the abspath() To: Johannes Berg , linux-kernel@vger.kernel.org Cc: Kieran Bingham , Johannes Berg References: <20201216145616.3dc582daca12.I10ebbdb7e9b80ab1a5cddebf53d073be8232d656@changeid> From: Jan Kiszka Message-ID: <8d147f34-196f-fcd6-6e2f-de80fe05397d@siemens.com> Date: Thu, 17 Dec 2020 09:10:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201216145616.3dc582daca12.I10ebbdb7e9b80ab1a5cddebf53d073be8232d656@changeid> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16.12.20 14:56, Johannes Berg wrote: > 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 > --- > scripts/gdb/linux/symbols.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py > index 1be9763cf8bb..e651c335deb6 100644 > --- a/scripts/gdb/linux/symbols.py > +++ b/scripts/gdb/linux/symbols.py > @@ -164,7 +164,7 @@ 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 > Looks good, we just tried to stay within 80 chars line length also with the python scripts. Jan -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux