From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754808AbbENFa1 (ORCPT ); Thu, 14 May 2015 01:30:27 -0400 Received: from 1.mo68.mail-out.ovh.net ([46.105.41.146]:38099 "EHLO 1.mo68.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751026AbbENFaZ (ORCPT ); Thu, 14 May 2015 01:30:25 -0400 From: =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= To: linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= , jan.kiszka@siemens.com Subject: [PATCH 2/3] scripts/gdb: Fix PEP8 compliance Date: Thu, 14 May 2015 15:22:07 +1000 Message-Id: <14851af166fc8eda192e3e1b2a4d855eb45c01c5.1431580696.git.thiebaud@weksteen.fr> X-Mailer: git-send-email 2.1.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 3564317631966237210 X-Ovh-Remote: 121.44.82.37 (ppp121-44-82-37.lns20.syd4.internode.on.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: 0 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekuddrtdehucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekuddrtdehucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: ThiƩbaud Weksteen --- scripts/gdb/linux/dmesg.py | 1 - scripts/gdb/linux/symbols.py | 9 ++++----- scripts/gdb/linux/tasks.py | 2 ++ scripts/gdb/linux/utils.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/gdb/linux/dmesg.py b/scripts/gdb/linux/dmesg.py index 3c947f0..927d0d2 100644 --- a/scripts/gdb/linux/dmesg.py +++ b/scripts/gdb/linux/dmesg.py @@ -12,7 +12,6 @@ # import gdb -import string from linux import utils diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index cd5bea9..627750c 100644 --- a/scripts/gdb/linux/symbols.py +++ b/scripts/gdb/linux/symbols.py @@ -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'): @@ -97,7 +96,7 @@ lx-symbols command.""" 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"]: @@ -124,7 +123,7 @@ lx-symbols command.""" 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)) @@ -164,7 +163,7 @@ lx-symbols command.""" 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( diff --git a/scripts/gdb/linux/tasks.py b/scripts/gdb/linux/tasks.py index e2037d9..89d38e1 100644 --- a/scripts/gdb/linux/tasks.py +++ b/scripts/gdb/linux/tasks.py @@ -18,6 +18,7 @@ from linux import utils task_type = utils.CachedType("struct task_struct") + def task_lists(): global task_type task_ptr_type = task_type.get_type().pointer() @@ -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: diff --git a/scripts/gdb/linux/utils.py b/scripts/gdb/linux/utils.py index d7ff3a3..0893b32 100644 --- a/scripts/gdb/linux/utils.py +++ b/scripts/gdb/linux/utils.py @@ -151,6 +151,6 @@ def get_gdbserver_type(): 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 -- 2.1.0