scripts/gdb: add lx-symbols command
authorJan Kiszka <[email protected]>
Tue, 17 Feb 2015 21:46:47 +0000 (13:46 -0800)
committerLinus Torvalds <[email protected]>
Tue, 17 Feb 2015 22:34:53 +0000 (14:34 -0800)
commit66051720b84127cac32f34a30c91390c0ebf898f
tree88691dacbeb44bea0912ae7f6482d1b424676065
parent850202e17df68c51593bab36a26c8d9279f8c029
scripts/gdb: add lx-symbols command

This is probably the most useful helper when debugging kernel modules:
lx-symbols first reloads vmlinux.  Then it searches recursively for *.ko
files in the specified paths and the current directory.  Finally it walks
the kernel's module list, issuing the necessary add-symbol-file command
for each loaded module so that gdb knows which module symbol corresponds
to which address.  It also looks up variable sections (bss, data, rodata)
and appends their address to the add-symbole-file command line.  This
allows to access global module variables just like any other variable.

Signed-off-by: Jan Kiszka <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Jason Wessel <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Ben Widawsky <[email protected]>
Cc: Borislav Petkov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
scripts/gdb/linux/symbols.py [new file with mode: 0644]
scripts/gdb/vmlinux-gdb.py