mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: yalin wang <yalin.wang2010@gmail.com>
To: jan.kiszka@siemens.com, yalin.wang2010@gmail.com,
	akpm@linux-foundation.org, mmarek@suse.cz,
	linux-kernel@vger.kernel.org
Subject: [PATCH V2] scripts: fix the sys path for gdb scripts
Date: Fri, 27 Nov 2015 14:41:09 +0800	[thread overview]
Message-ID: <1448606469-25744-1-git-send-email-yalin.wang2010@gmail.com> (raw)

we insert __file__'s real path into sys.path,
so that no matter we import the vmlinux-gdb.py from $OUT floder or
from source code folder, we can always find the linux/ lib folder,
and we don't need create link to linux/*.py files,
remove the related make file.

Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
---
 scripts/Makefile           |  1 -
 scripts/gdb/Makefile       |  1 -
 scripts/gdb/linux/Makefile | 11 -----------
 scripts/gdb/vmlinux-gdb.py |  2 +-
 4 files changed, 1 insertion(+), 14 deletions(-)
 delete mode 100644 scripts/gdb/Makefile
 delete mode 100644 scripts/gdb/linux/Makefile

diff --git a/scripts/Makefile b/scripts/Makefile
index 2016a64..72902b5 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -36,7 +36,6 @@ subdir-$(CONFIG_MODVERSIONS) += genksyms
 subdir-y                     += mod
 subdir-$(CONFIG_SECURITY_SELINUX) += selinux
 subdir-$(CONFIG_DTC)         += dtc
-subdir-$(CONFIG_GDB_SCRIPTS) += gdb
 
 # Let clean descend into subdirs
 subdir-	+= basic kconfig package
diff --git a/scripts/gdb/Makefile b/scripts/gdb/Makefile
deleted file mode 100644
index 62f5f65..0000000
--- a/scripts/gdb/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-subdir-y := linux
diff --git a/scripts/gdb/linux/Makefile b/scripts/gdb/linux/Makefile
deleted file mode 100644
index 6cf1ecf..0000000
--- a/scripts/gdb/linux/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-always := gdb-scripts
-
-SRCTREE := $(shell cd $(srctree) && /bin/pwd)
-
-$(obj)/gdb-scripts:
-ifneq ($(KBUILD_SRC),)
-	$(Q)ln -fsn $(SRCTREE)/$(obj)/*.py $(objtree)/$(obj)
-endif
-	@:
-
-clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py)
diff --git a/scripts/gdb/vmlinux-gdb.py b/scripts/gdb/vmlinux-gdb.py
index ce82bf5..a9029f4 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.realpath(__file__)))
 
 try:
     gdb.parse_and_eval("0")
-- 
1.9.1


             reply	other threads:[~2015-11-27  6:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27  6:41 yalin wang [this message]
2015-11-27  7:04 ` Jan Kiszka
2015-11-27  8:13   ` yalin wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448606469-25744-1-git-send-email-yalin.wang2010@gmail.com \
    --to=yalin.wang2010@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jan.kiszka@siemens.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®