summaryrefslogtreecommitdiffstats
path: root/scripts/gdb
diff options
context:
space:
mode:
authorAaron Tomlin <atomlin@redhat.com>2022-07-12 13:02:48 +0200
committerakpm <akpm@linux-foundation.org>2022-07-30 03:12:37 +0200
commitb99695580bfc1f91364023c673681ddb88e375dc (patch)
treedfea9060aa4985d6d9bbfbf789aa2b7e18807837 /scripts/gdb
parentMAINTAINERS: kunit: add David Gow as a maintainer of KUnit (diff)
downloadlinux-b99695580bfc1f91364023c673681ddb88e375dc.tar.xz
linux-b99695580bfc1f91364023c673681ddb88e375dc.zip
scripts/gdb: ensure the absolute path is generated on initial source
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/20220712110248.1404125-1-atomlin@redhat.com Signed-off-by: Aaron Tomlin <atomlin@redhat.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Cc: Jan Kiszka <jan.kiszka@siemens.com> Cc: Kieran Bingham <kbingham@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts/gdb')
-rw-r--r--scripts/gdb/vmlinux-gdb.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/gdb/vmlinux-gdb.py b/scripts/gdb/vmlinux-gdb.py
index 4136dc2c59df..3e8d3669f0ce 100644
--- a/scripts/gdb/vmlinux-gdb.py
+++ b/scripts/gdb/vmlinux-gdb.py
@@ -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")