aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gdb')
-rw-r--r--scripts/gdb/linux/modules.py5
-rw-r--r--scripts/gdb/linux/proc.py41
-rw-r--r--scripts/gdb/linux/symbols.py2
-rw-r--r--scripts/gdb/vmlinux-gdb.py1
4 files changed, 46 insertions, 3 deletions
diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
index 25db8cff44a2..0a35d6dbfb80 100644
--- a/scripts/gdb/linux/modules.py
+++ b/scripts/gdb/linux/modules.py
@@ -73,10 +73,11 @@ class LxLsmod(gdb.Command):
73 " " if utils.get_long_type().sizeof == 8 else "")) 73 " " if utils.get_long_type().sizeof == 8 else ""))
74 74
75 for module in module_list(): 75 for module in module_list():
76 layout = module['core_layout']
76 gdb.write("{address} {name:<19} {size:>8} {ref}".format( 77 gdb.write("{address} {name:<19} {size:>8} {ref}".format(
77 address=str(module['module_core']).split()[0], 78 address=str(layout['base']).split()[0],
78 name=module['name'].string(), 79 name=module['name'].string(),
79 size=str(module['core_size']), 80 size=str(layout['size']),
80 ref=str(module['refcnt']['counter']))) 81 ref=str(module['refcnt']['counter'])))
81 82
82 source_list = module['source_list'] 83 source_list = module['source_list']
diff --git a/scripts/gdb/linux/proc.py b/scripts/gdb/linux/proc.py
new file mode 100644
index 000000000000..6e6709c1830c
--- /dev/null
+++ b/scripts/gdb/linux/proc.py
@@ -0,0 +1,41 @@
1#
2# gdb helper commands and functions for Linux kernel debugging
3#
4# Kernel proc information reader
5#
6# Copyright (c) 2016 Linaro Ltd
7#
8# Authors:
9# Kieran Bingham <kieran.bingham@linaro.org>
10#
11# This work is licensed under the terms of the GNU GPL version 2.
12#
13
14import gdb
15
16
17class LxCmdLine(gdb.Command):
18 """ Report the Linux Commandline used in the current kernel.
19 Equivalent to cat /proc/cmdline on a running target"""
20
21 def __init__(self):
22 super(LxCmdLine, self).__init__("lx-cmdline", gdb.COMMAND_DATA)
23
24 def invoke(self, arg, from_tty):
25 gdb.write(gdb.parse_and_eval("saved_command_line").string() + "\n")
26
27LxCmdLine()
28
29
30class LxVersion(gdb.Command):
31 """ Report the Linux Version of the current kernel.
32 Equivalent to cat /proc/version on a running target"""
33
34 def __init__(self):
35 super(LxVersion, self).__init__("lx-version", gdb.COMMAND_DATA)
36
37 def invoke(self, arg, from_tty):
38 # linux_banner should contain a newline
39 gdb.write(gdb.parse_and_eval("linux_banner").string())
40
41LxVersion()
diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
index 627750cb420d..9a0f8923f67c 100644
--- a/scripts/gdb/linux/symbols.py
+++ b/scripts/gdb/linux/symbols.py
@@ -108,7 +108,7 @@ lx-symbols command."""
108 108
109 def load_module_symbols(self, module): 109 def load_module_symbols(self, module):
110 module_name = module['name'].string() 110 module_name = module['name'].string()
111 module_addr = str(module['module_core']).split()[0] 111 module_addr = str(module['core_layout']['base']).split()[0]
112 112
113 module_file = self._get_module_file(module_name) 113 module_file = self._get_module_file(module_name)
114 if not module_file and not self.module_files_updated: 114 if not module_file and not self.module_files_updated:
diff --git a/scripts/gdb/vmlinux-gdb.py b/scripts/gdb/vmlinux-gdb.py
index ce82bf5c3943..d5943eca19cd 100644
--- a/scripts/gdb/vmlinux-gdb.py
+++ b/scripts/gdb/vmlinux-gdb.py
@@ -29,3 +29,4 @@ else:
29 import linux.tasks 29 import linux.tasks
30 import linux.cpus 30 import linux.cpus
31 import linux.lists 31 import linux.lists
32 import linux.proc