+ scripts-gdb-find-vmlinux-where-it-was-before.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: scripts/gdb: find vmlinux where it was before
has been added to the -mm tree.  Its filename is
     scripts-gdb-find-vmlinux-where-it-was-before.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/scripts-gdb-find-vmlinux-where-it-was-before.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/scripts-gdb-find-vmlinux-where-it-was-before.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Stephen Boyd <swboyd@xxxxxxxxxxxx>
Subject: scripts/gdb: find vmlinux where it was before

Patch series "gdb script for kconfig and timer list".

This is a handful of changes to the kernel's gdb scripts to do some more
debugging with kgdb.  The first patch allows the vmlinux to be reloaded
from where it was specified on the command line so that this set of
scripts can be used from anywhere.  The second patch adds a script to dump
the config.gz to a file on the host debugging machine.  The third patch
adds some rb tree utilities and the last patch uses those rb tree walking
utilities to dump out the contents of /proc/timer_list from a system under
debug.

This patch (of 4):

If I run 'gdb <path/to/vmlinux>' and there's the vmlinux-gdb.py file there
I can properly see symbols and use the lx commands provided by the GDB
scripts.  But once I run 'lx-symbols' at the command prompt, gdb reloads
the vmlinux symbols assuming that this script was run from the directory
that has vmlinux at the root.  That isn't always true, but we could just
look and see what symbols were already loaded and use that instead.  Let's
do that so this can work by being invoked anywhere.

Link: http://lkml.kernel.org/r/20190325184522.260535-2-swboyd@xxxxxxxxxxxx
Signed-off-by: Stephen Boyd <swboyd@xxxxxxxxxxxx>
Cc: Douglas Anderson <dianders@xxxxxxxxxxxx>
Cc: Nikolay Borisov <n.borisov.lkml@xxxxxxxxx>
Cc: Kieran Bingham <kbingham@xxxxxxxxxx>
Cc: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
Cc: Jackie Liu <liuyun01@xxxxxxxxxx>
Cc: Jason Wessel <jason.wessel@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 scripts/gdb/linux/symbols.py |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/scripts/gdb/linux/symbols.py~scripts-gdb-find-vmlinux-where-it-was-before
+++ a/scripts/gdb/linux/symbols.py
@@ -139,8 +139,12 @@ lx-symbols command."""
                 saved_states.append({'breakpoint': bp, 'enabled': bp.enabled})
 
         # drop all current symbols and reload vmlinux
+        orig_vmlinux = 'vmlinux'
+        for obj in gdb.objfiles():
+            if obj.filename.endswith('vmlinux'):
+                orig_vmlinux = obj.filename
         gdb.execute("symbol-file", to_string=True)
-        gdb.execute("symbol-file vmlinux")
+        gdb.execute("symbol-file {0}".format(orig_vmlinux))
 
         self.loaded_modules = []
         module_list = modules.module_list()
_

Patches currently in -mm which might be from swboyd@xxxxxxxxxxxx are

scripts-gdb-find-vmlinux-where-it-was-before.patch
scripts-gdb-add-kernel-config-dumping-command.patch
scripts-gdb-add-rb-tree-iterating-utilities.patch
scripts-gdb-add-a-timer-list-command.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux