mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] scripts/gdb: Ensure the absolute path is generated on initial source
@ 2022-07-12 11:02 Aaron Tomlin
  2022-07-28  7:22 ` Aaron Tomlin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Aaron Tomlin @ 2022-07-12 11:02 UTC (permalink / raw)
  To: jan.kiszka, kbingham; +Cc: atomlin, linux-kernel

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.

Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
---
 scripts/gdb/vmlinux-gdb.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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")
-- 
2.34.3


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

end of thread, other threads:[~2022-12-14 19:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 11:02 [PATCH v2] scripts/gdb: Ensure the absolute path is generated on initial source Aaron Tomlin
2022-07-28  7:22 ` Aaron Tomlin
2022-07-28 15:29 ` Doug Anderson
2022-12-14 18:56 ` Nick Desaulniers
2022-12-14 19:39   ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®