* [PATCH] gdb: correct sys.path insertion
@ 2020-12-16 13:36 Johannes Berg
2020-12-17 8:10 ` Jan Kiszka
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2020-12-16 13:36 UTC (permalink / raw)
To: linux-kernel; +Cc: Jan Kiszka, Kieran Bingham, Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
Perhaps something got moved around at some point, but the
current path that gets inserted has "/scripts/gdb" twice,
since the script is located in scripts/gdb/ already. Fix
the path.
Signed-off-by: Johannes Berg <johannes.berg@intel.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..476da5b6a7ca 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(__file__))
try:
gdb.parse_and_eval("0")
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gdb: correct sys.path insertion
2020-12-16 13:36 [PATCH] gdb: correct sys.path insertion Johannes Berg
@ 2020-12-17 8:10 ` Jan Kiszka
2020-12-17 8:14 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2020-12-17 8:10 UTC (permalink / raw)
To: Johannes Berg, linux-kernel; +Cc: Kieran Bingham, Johannes Berg
On 16.12.20 14:36, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Perhaps something got moved around at some point, but the
> current path that gets inserted has "/scripts/gdb" twice,
> since the script is located in scripts/gdb/ already. Fix
> the path.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.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..476da5b6a7ca 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(__file__))
>
> try:
> gdb.parse_and_eval("0")
>
How did you test that, which setup? I just ran "gdb
<linux>/build/vmlinux", and "python print(sys.path)" didn't expose this
duplication. So your change would actually break that common case.
Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gdb: correct sys.path insertion
2020-12-17 8:10 ` Jan Kiszka
@ 2020-12-17 8:14 ` Johannes Berg
0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2020-12-17 8:14 UTC (permalink / raw)
To: Jan Kiszka, linux-kernel; +Cc: Kieran Bingham
Hi Jan,
> > -sys.path.insert(0, os.path.dirname(__file__) + "/scripts/gdb")
> > +sys.path.insert(0, os.path.dirname(__file__))
> >
> > try:
> > gdb.parse_and_eval("0")
> >
>
> How did you test that, which setup? I just ran "gdb
> <linux>/build/vmlinux", and "python print(sys.path)" didn't expose this
> duplication. So your change would actually break that common case.
Oh, seems that was my mistake. I was trying to (explicitly) load the
file as "scripts/gdb/vmlinux-gdb.py" rather than using the symlink that
gets installed.
Never mind.
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-17 8:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 13:36 [PATCH] gdb: correct sys.path insertion Johannes Berg
2020-12-17 8:10 ` Jan Kiszka
2020-12-17 8:14 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).