I'm trying to remotely-debug a Linux's kernel. I've created a VM (using VMware) and connected to it from my PC using gdb, and everything works fine.
The problem is that gdb fails to load vmlinux-gdb.py script. I've tried to add it using the source command on gdb, and got the following error:
Traceback (most recent call last):
File "~/workspace/kernels/default-kernel/scripts/gdb/vmlinux-gdb.py", line 28, in <module>
ImportError: No module named 'linux'
The directory tree:
drwxr-xr-x 2 iofek iofek 4096 Mar 22 19:59 linux
-rwxr-xr-x 1 iofek iofek 577 Mar 22 19:43 Makefile
-rwxrwxr-x 1 iofek iofek 0 Mar 22 19:43 modules.order
-rwxr-xr-x 1 iofek iofek 759 Mar 22 20:00 vmlinux-gdb.py
Now I can't understand why the module fails to find the linux directory.
I've updated the PYTHONPATH, as well as added the path using sys.path.append.
Additionaly, all files under linux has the right permissions.
Any ideas?
python os.system("ls " + sys.path[-1] + "/linux/__init__.py"), where-1is the appropriate subscript to get the path you appended tosys.path?