1. 18 2月, 2015 4 次提交
    • J
      scripts/gdb: add internal helper and convenience function to look up a module · 7b599ef5
      Jan Kiszka 提交于
      Add the internal helper get_module_by_name to obtain the module structure
      corresponding to the given name.  Also export this service as a
      convenience function.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Borislav Petkov <bp@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7b599ef5
    • J
      scripts/gdb: add lx-symbols command · 66051720
      Jan Kiszka 提交于
      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: NJan Kiszka <jan.kiszka@siemens.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Borislav Petkov <bp@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      66051720
    • J
      scripts/gdb: add container_of helper and convenience function · b0fecd8c
      Jan Kiszka 提交于
      Provide an internal helper with container_of semantics.  As type lookups
      are very slow in gdb-python and we need a type "long" for this, cache the
      reference to this type object.  Then export the helper also as a
      convenience function form use at the gdb command line.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Borislav Petkov <bp@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b0fecd8c
    • J
      scripts/gdb: add infrastructure · 3ee7b3fa
      Jan Kiszka 提交于
      This provides the basic infrastructure to load kernel-specific python
      helper scripts when debugging the kernel in gdb.
      
      The loading mechanism is based on gdb loading for <objfile>-gdb.py when
      opening <objfile>.  Therefore, this places a corresponding link to the
      main helper script into the output directory that contains vmlinux.
      
      The main scripts will pull in submodules containing Linux specific gdb
      commands and functions.  To avoid polluting the source directory with
      compiled python modules, we link to them from the object directory.
      
      Due to gdb.parse_and_eval and string redirection for gdb.execute, we
      depend on gdb >= 7.2.
      
      This feature is enabled via CONFIG_GDB_SCRIPTS.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Acked-by: Michal Marek <mmarek@suse.cz>		[kbuild stuff]
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Borislav Petkov <bp@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3ee7b3fa