Skip to content

Commit

Permalink
gdb: lx-symbols: store the abspath()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Jan Kiszka <[email protected]>
Cc: Kieran Bingham <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jmberg-intel authored and torvalds committed May 7, 2021
1 parent 3d1c7fd commit 2392154
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/gdb/linux/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ def load_all_symbols(self):
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
Expand Down

0 comments on commit 2392154

Please sign in to comment.