Skip to content

Commit

Permalink
scripts/gdb: silence pep8 checks
Browse files Browse the repository at this point in the history
These scripts have some pep8 style warnings.  Fix them up so that this
directory is all pep8 clean.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Stephen Boyd <[email protected]>
Cc: Douglas Anderson <[email protected]>
Cc: Nikolay Borisov <[email protected]>
Cc: Kieran Bingham <[email protected]>
Cc: Jan Kiszka <[email protected]>
Cc: Jackie Liu <[email protected]>
Cc: Jason Wessel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
bebarino authored and torvalds committed May 15, 2019
1 parent 442284a commit 494dbe0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions scripts/gdb/linux/cpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def invoke(self, arg, from_tty):
gdb.write("Online CPUs : {}\n".format(list(each_online_cpu())))
gdb.write("Active CPUs : {}\n".format(list(each_active_cpu())))


LxCpus()


Expand Down
1 change: 1 addition & 0 deletions scripts/gdb/linux/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,5 @@ def invoke(self, arg, from_tty):
raise gdb.GdbError("lx-list-check takes one argument")
list_check(gdb.parse_and_eval(argv[0]))


LxListChk()
10 changes: 8 additions & 2 deletions scripts/gdb/linux/proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(self):
def invoke(self, arg, from_tty):
gdb.write(gdb.parse_and_eval("saved_command_line").string() + "\n")


LxCmdLine()


Expand All @@ -43,6 +44,7 @@ def invoke(self, arg, from_tty):
# linux_banner should contain a newline
gdb.write(gdb.parse_and_eval("(char *)linux_banner").string())


LxVersion()


Expand Down Expand Up @@ -86,6 +88,7 @@ def __init__(self):
def invoke(self, arg, from_tty):
return show_lx_resources("iomem_resource")


LxIOMem()


Expand All @@ -100,6 +103,7 @@ def __init__(self):
def invoke(self, arg, from_tty):
return show_lx_resources("ioport_resource")


LxIOPorts()


Expand Down Expand Up @@ -149,7 +153,7 @@ def invoke(self, arg, from_tty):
if len(argv) >= 1:
try:
pid = int(argv[0])
except:
except gdb.error:
raise gdb.GdbError("Provide a PID as integer value")
else:
pid = 1
Expand Down Expand Up @@ -195,6 +199,7 @@ def invoke(self, arg, from_tty):
info_opts(FS_INFO, s_flags),
info_opts(MNT_INFO, m_flags)))


LxMounts()


Expand Down Expand Up @@ -259,12 +264,13 @@ def invoke(self, arg, from_tty):

try:
f = open(filename, 'wb')
except:
except gdb.error:
raise gdb.GdbError("Could not open file to dump fdt")

f.write(fdt_buf)
f.close()

gdb.write("Dumped fdt blob to " + filename + "\n")


LxFdtDump()
2 changes: 2 additions & 0 deletions scripts/gdb/linux/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def invoke(self, arg, from_tty):
pid=task["pid"],
comm=task["comm"].string()))


LxPs()


Expand Down Expand Up @@ -134,4 +135,5 @@ def invoke(self, pid):
else:
raise gdb.GdbError("No task of PID " + str(pid))


LxThreadInfoByPidFunc()
7 changes: 4 additions & 3 deletions scripts/gdb/linux/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def invoke(self, ptr, typename, elementname):
return container_of(ptr, gdb.lookup_type(typename.string()).pointer(),
elementname.string())


ContainerOf()


Expand Down Expand Up @@ -148,14 +149,14 @@ def exit_handler(event):
def probe_qemu():
try:
return gdb.execute("monitor info version", to_string=True) != ""
except:
except gdb.error:
return False

def probe_kgdb():
try:
thread_info = gdb.execute("info thread 2", to_string=True)
return "shadowCPU0" in thread_info
except:
except gdb.error:
return False

global gdbserver_type
Expand All @@ -172,7 +173,7 @@ def probe_kgdb():
def gdb_eval_or_none(expresssion):
try:
return gdb.parse_and_eval(expresssion)
except:
except gdb.error:
return None


Expand Down

0 comments on commit 494dbe0

Please sign in to comment.