aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gdb/linux
diff options
context:
space:
mode:
authorThiƩbaud Weksteen <thiebaud@weksteen.fr>2015-06-30 17:58:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-30 22:44:58 -0400
commit6ad18b73317714e7d0fad08ee78365ecc817e923 (patch)
tree563331af84bf2909ce98eabc630bb9ad37db3f0e /scripts/gdb/linux
parenta2e73c480494101f5f6932b6904acb15c44180ee (diff)
scripts/gdb: fix PEP8 compliance
Signed-off-by: ThiƩbaud Weksteen <thiebaud@weksteen.fr> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/gdb/linux')
-rw-r--r--scripts/gdb/linux/dmesg.py1
-rw-r--r--scripts/gdb/linux/symbols.py9
-rw-r--r--scripts/gdb/linux/tasks.py2
-rw-r--r--scripts/gdb/linux/utils.py2
4 files changed, 7 insertions, 7 deletions
diff --git a/scripts/gdb/linux/dmesg.py b/scripts/gdb/linux/dmesg.py
index 3c947f0c5dad..927d0d2a3145 100644
--- a/scripts/gdb/linux/dmesg.py
+++ b/scripts/gdb/linux/dmesg.py
@@ -12,7 +12,6 @@
12# 12#
13 13
14import gdb 14import gdb
15import string
16 15
17from linux import utils 16from linux import utils
18 17
diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
index cd5bea965d4e..627750cb420d 100644
--- a/scripts/gdb/linux/symbols.py
+++ b/scripts/gdb/linux/symbols.py
@@ -14,9 +14,8 @@
14import gdb 14import gdb
15import os 15import os
16import re 16import re
17import string
18 17
19from linux import modules, utils 18from linux import modules
20 19
21 20
22if hasattr(gdb, 'Breakpoint'): 21if hasattr(gdb, 'Breakpoint'):
@@ -97,7 +96,7 @@ lx-symbols command."""
97 return "" 96 return ""
98 attrs = sect_attrs['attrs'] 97 attrs = sect_attrs['attrs']
99 section_name_to_address = { 98 section_name_to_address = {
100 attrs[n]['name'].string() : attrs[n]['address'] 99 attrs[n]['name'].string(): attrs[n]['address']
101 for n in range(int(sect_attrs['nsections']))} 100 for n in range(int(sect_attrs['nsections']))}
102 args = [] 101 args = []
103 for section_name in [".data", ".data..read_mostly", ".rodata", ".bss"]: 102 for section_name in [".data", ".data..read_mostly", ".rodata", ".bss"]:
@@ -124,7 +123,7 @@ lx-symbols command."""
124 addr=module_addr, 123 addr=module_addr,
125 sections=self._section_arguments(module)) 124 sections=self._section_arguments(module))
126 gdb.execute(cmdline, to_string=True) 125 gdb.execute(cmdline, to_string=True)
127 if not module_name in self.loaded_modules: 126 if module_name not in self.loaded_modules:
128 self.loaded_modules.append(module_name) 127 self.loaded_modules.append(module_name)
129 else: 128 else:
130 gdb.write("no module object found for '{0}'\n".format(module_name)) 129 gdb.write("no module object found for '{0}'\n".format(module_name))
@@ -164,7 +163,7 @@ lx-symbols command."""
164 self.load_all_symbols() 163 self.load_all_symbols()
165 164
166 if hasattr(gdb, 'Breakpoint'): 165 if hasattr(gdb, 'Breakpoint'):
167 if not self.breakpoint is None: 166 if self.breakpoint is not None:
168 self.breakpoint.delete() 167 self.breakpoint.delete()
169 self.breakpoint = None 168 self.breakpoint = None
170 self.breakpoint = LoadModuleBreakpoint( 169 self.breakpoint = LoadModuleBreakpoint(
diff --git a/scripts/gdb/linux/tasks.py b/scripts/gdb/linux/tasks.py
index e2037d9bb7eb..89d38e1580e3 100644
--- a/scripts/gdb/linux/tasks.py
+++ b/scripts/gdb/linux/tasks.py
@@ -18,6 +18,7 @@ from linux import utils
18 18
19task_type = utils.CachedType("struct task_struct") 19task_type = utils.CachedType("struct task_struct")
20 20
21
21def task_lists(): 22def task_lists():
22 global task_type 23 global task_type
23 task_ptr_type = task_type.get_type().pointer() 24 task_ptr_type = task_type.get_type().pointer()
@@ -38,6 +39,7 @@ def task_lists():
38 if t == init_task: 39 if t == init_task:
39 return 40 return
40 41
42
41def get_task_by_pid(pid): 43def get_task_by_pid(pid):
42 for task in task_lists(): 44 for task in task_lists():
43 if int(task['pid']) == pid: 45 if int(task['pid']) == pid:
diff --git a/scripts/gdb/linux/utils.py b/scripts/gdb/linux/utils.py
index d7ff3a39b672..0893b326a28b 100644
--- a/scripts/gdb/linux/utils.py
+++ b/scripts/gdb/linux/utils.py
@@ -151,6 +151,6 @@ def get_gdbserver_type():
151 gdbserver_type = GDBSERVER_QEMU 151 gdbserver_type = GDBSERVER_QEMU
152 elif probe_kgdb(): 152 elif probe_kgdb():
153 gdbserver_type = GDBSERVER_KGDB 153 gdbserver_type = GDBSERVER_KGDB
154 if not gdbserver_type is None and hasattr(gdb, 'events'): 154 if gdbserver_type is not None and hasattr(gdb, 'events'):
155 gdb.events.exited.connect(exit_handler) 155 gdb.events.exited.connect(exit_handler)
156 return gdbserver_type 156 return gdbserver_type