All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] gdb: lx-symbols: store the abspath()
@ 2020-12-17  8:17 Johannes Berg
  2020-12-17  8:31 ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2020-12-17  8:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jan Kiszka, Kieran Bingham, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

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 <johannes.berg@intel.com>
---
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] gdb: lx-symbols: store the abspath()
  2020-12-17  8:17 [PATCH v2] gdb: lx-symbols: store the abspath() Johannes Berg
@ 2020-12-17  8:31 ` Jan Kiszka
  2021-02-23 15:12   ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2020-12-17  8:31 UTC (permalink / raw)
  To: Johannes Berg, linux-kernel, Andrew Morton; +Cc: Kieran Bingham, Johannes Berg

On 17.12.20 09:17, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> 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 <johannes.berg@intel.com>
> ---
> 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
> 

Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] gdb: lx-symbols: store the abspath()
  2020-12-17  8:31 ` Jan Kiszka
@ 2021-02-23 15:12   ` Johannes Berg
  2021-02-23 23:59     ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2021-02-23 15:12 UTC (permalink / raw)
  To: Jan Kiszka, linux-kernel, Andrew Morton; +Cc: Kieran Bingham

On Thu, 2020-12-17 at 09:31 +0100, Jan Kiszka wrote:
> On 17.12.20 09:17, Johannes Berg wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> > 
> > 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.)

> Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>

So ... I'm still carrying this patch.

Anyone want to send it to Linus? Andrew, maybe you?

Thanks,
johannes


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] gdb: lx-symbols: store the abspath()
  2021-02-23 15:12   ` Johannes Berg
@ 2021-02-23 23:59     ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2021-02-23 23:59 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Jan Kiszka, linux-kernel, Kieran Bingham

On Tue, 23 Feb 2021 16:12:17 +0100 Johannes Berg <johannes@sipsolutions.net> wrote:

> On Thu, 2020-12-17 at 09:31 +0100, Jan Kiszka wrote:
> > On 17.12.20 09:17, Johannes Berg wrote:
> > > From: Johannes Berg <johannes.berg@intel.com>
> > > 
> > > 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.)
> 
> > Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
> 
> So ... I'm still carrying this patch.
> 
> Anyone want to send it to Linus? Andrew, maybe you?

Sure, I'll grab it after -rc1.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-24  0:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17  8:17 [PATCH v2] gdb: lx-symbols: store the abspath() Johannes Berg
2020-12-17  8:31 ` Jan Kiszka
2021-02-23 15:12   ` Johannes Berg
2021-02-23 23:59     ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.