]> Git Repo - J-linux.git/commitdiff
scripts/gdb: ensure the absolute path is generated on initial source
authorAaron Tomlin <[email protected]>
Tue, 12 Jul 2022 11:02:48 +0000 (12:02 +0100)
committerakpm <[email protected]>
Sat, 30 Jul 2022 01:12:37 +0000 (18:12 -0700)
Post 'make scripts_gdb' a symbolic link to scripts/gdb/vmlinux-gdb.py is
created.  Currently 'os.path.dirname(__file__)' does not generate the
absolute path to scripts/gdb resulting in the following:

    (gdb) source vmlinux-gdb.py
    Traceback (most recent call last):
      File "scripts/gdb/vmlinux-gdb.py", line 25, in <module>
import linux.utils
    ModuleNotFoundError: No module named 'linux'

This patch ensures that the absolute path to scripts/gdb in relation to
the given file is generated so each module can be located accordingly.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Aaron Tomlin <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Cc: Jan Kiszka <[email protected]>
Cc: Kieran Bingham <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
scripts/gdb/vmlinux-gdb.py

index 4136dc2c59df23a97c61617f639e34bff03fe63f..3e8d3669f0ce0000851082af3eb3e9bc06e9914b 100644 (file)
@@ -13,7 +13,7 @@
 
 import os
 
-sys.path.insert(0, os.path.dirname(__file__) + "/scripts/gdb")
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + "/scripts/gdb")
 
 try:
     gdb.parse_and_eval("0")
This page took 0.048433 seconds and 4 git commands to generate.