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>
This commit is contained in:
parent
a2e73c4804
commit
6ad18b7331
|
@ -12,7 +12,6 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import gdb
|
import gdb
|
||||||
import string
|
|
||||||
|
|
||||||
from linux import utils
|
from linux import utils
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,8 @@
|
||||||
import gdb
|
import gdb
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import string
|
|
||||||
|
|
||||||
from linux import modules, utils
|
from linux import modules
|
||||||
|
|
||||||
|
|
||||||
if hasattr(gdb, 'Breakpoint'):
|
if hasattr(gdb, 'Breakpoint'):
|
||||||
|
@ -124,7 +123,7 @@ lx-symbols command."""
|
||||||
addr=module_addr,
|
addr=module_addr,
|
||||||
sections=self._section_arguments(module))
|
sections=self._section_arguments(module))
|
||||||
gdb.execute(cmdline, to_string=True)
|
gdb.execute(cmdline, to_string=True)
|
||||||
if not module_name in self.loaded_modules:
|
if module_name not in self.loaded_modules:
|
||||||
self.loaded_modules.append(module_name)
|
self.loaded_modules.append(module_name)
|
||||||
else:
|
else:
|
||||||
gdb.write("no module object found for '{0}'\n".format(module_name))
|
gdb.write("no module object found for '{0}'\n".format(module_name))
|
||||||
|
@ -164,7 +163,7 @@ lx-symbols command."""
|
||||||
self.load_all_symbols()
|
self.load_all_symbols()
|
||||||
|
|
||||||
if hasattr(gdb, 'Breakpoint'):
|
if hasattr(gdb, 'Breakpoint'):
|
||||||
if not self.breakpoint is None:
|
if self.breakpoint is not None:
|
||||||
self.breakpoint.delete()
|
self.breakpoint.delete()
|
||||||
self.breakpoint = None
|
self.breakpoint = None
|
||||||
self.breakpoint = LoadModuleBreakpoint(
|
self.breakpoint = LoadModuleBreakpoint(
|
||||||
|
|
|
@ -18,6 +18,7 @@ from linux import utils
|
||||||
|
|
||||||
task_type = utils.CachedType("struct task_struct")
|
task_type = utils.CachedType("struct task_struct")
|
||||||
|
|
||||||
|
|
||||||
def task_lists():
|
def task_lists():
|
||||||
global task_type
|
global task_type
|
||||||
task_ptr_type = task_type.get_type().pointer()
|
task_ptr_type = task_type.get_type().pointer()
|
||||||
|
@ -38,6 +39,7 @@ def task_lists():
|
||||||
if t == init_task:
|
if t == init_task:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
def get_task_by_pid(pid):
|
def get_task_by_pid(pid):
|
||||||
for task in task_lists():
|
for task in task_lists():
|
||||||
if int(task['pid']) == pid:
|
if int(task['pid']) == pid:
|
||||||
|
|
|
@ -151,6 +151,6 @@ def get_gdbserver_type():
|
||||||
gdbserver_type = GDBSERVER_QEMU
|
gdbserver_type = GDBSERVER_QEMU
|
||||||
elif probe_kgdb():
|
elif probe_kgdb():
|
||||||
gdbserver_type = GDBSERVER_KGDB
|
gdbserver_type = GDBSERVER_KGDB
|
||||||
if not gdbserver_type is None and hasattr(gdb, 'events'):
|
if gdbserver_type is not None and hasattr(gdb, 'events'):
|
||||||
gdb.events.exited.connect(exit_handler)
|
gdb.events.exited.connect(exit_handler)
|
||||||
return gdbserver_type
|
return gdbserver_type
|
||||||
|
|
Loading…
Reference in New Issue