Skip to content

Commit

Permalink
scripts/gdb: fix PEP8 compliance
Browse files Browse the repository at this point in the history
Signed-off-by: Thiébaud Weksteen <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
tweksteen authored and torvalds committed Jul 1, 2015
1 parent a2e73c4 commit 6ad18b7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion scripts/gdb/linux/dmesg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#

import gdb
import string

from linux import utils

Expand Down
9 changes: 4 additions & 5 deletions scripts/gdb/linux/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
import gdb
import os
import re
import string

from linux import modules, utils
from linux import modules


if hasattr(gdb, 'Breakpoint'):
Expand Down Expand Up @@ -97,7 +96,7 @@ def _section_arguments(self, module):
return ""
attrs = sect_attrs['attrs']
section_name_to_address = {
attrs[n]['name'].string() : attrs[n]['address']
attrs[n]['name'].string(): attrs[n]['address']
for n in range(int(sect_attrs['nsections']))}
args = []
for section_name in [".data", ".data..read_mostly", ".rodata", ".bss"]:
Expand All @@ -124,7 +123,7 @@ def load_module_symbols(self, module):
addr=module_addr,
sections=self._section_arguments(module))
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)
else:
gdb.write("no module object found for '{0}'\n".format(module_name))
Expand Down Expand Up @@ -164,7 +163,7 @@ def invoke(self, arg, from_tty):
self.load_all_symbols()

if hasattr(gdb, 'Breakpoint'):
if not self.breakpoint is None:
if self.breakpoint is not None:
self.breakpoint.delete()
self.breakpoint = None
self.breakpoint = LoadModuleBreakpoint(
Expand Down
2 changes: 2 additions & 0 deletions scripts/gdb/linux/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

task_type = utils.CachedType("struct task_struct")


def task_lists():
global task_type
task_ptr_type = task_type.get_type().pointer()
Expand All @@ -38,6 +39,7 @@ def task_lists():
if t == init_task:
return


def get_task_by_pid(pid):
for task in task_lists():
if int(task['pid']) == pid:
Expand Down
2 changes: 1 addition & 1 deletion scripts/gdb/linux/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,6 @@ def probe_kgdb():
gdbserver_type = GDBSERVER_QEMU
elif probe_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)
return gdbserver_type

0 comments on commit 6ad18b7

Please sign in to comment.