History

scripts/gdb: silence pep8 checks

These scripts have some pep8 style warnings. Fix them up so that this directory is all pep8 clean.

Stephen Boyd committed 7 years ago

Commit 494dbe01 parent 442284a5 files · +16 −5Browse files

Showing the changes to scripts (5 of 5 files). Show all

Unified · Split

5 files
  1. scripts/gdb/linux/cpus.py +1 −0
  2. scripts/gdb/linux/lists.py +1 −0
  3. scripts/gdb/linux/proc.py +8 −2
  4. scripts/gdb/linux/tasks.py +2 −0
  5. scripts/gdb/linux/utils.py +4 −3
scripts/gdb/linux/cpus.py+1−0
@@ -135,6 +135,7 @@ and can help identify the state of hotplugged CPUs""" · 134 unmodified lines
135135 gdb.write("Online CPUs : {}\n".format(list(each_online_cpu())))
136136 gdb.write("Active CPUs : {}\n".format(list(each_active_cpu())))
137137
138+
138139 LxCpus()
139140
140141
scripts/gdb/linux/lists.py+1−0
@@ -110,4 +110,5 @@ class LxListChk(gdb.Command): · 109 unmodified lines
110110 raise gdb.GdbError("lx-list-check takes one argument")
111111 list_check(gdb.parse_and_eval(argv[0]))
112112
113+
113114 LxListChk()
scripts/gdb/linux/proc.py+8−2
@@ -29,6 +29,7 @@ class LxCmdLine(gdb.Command): · 28 unmodified lines
2929 def invoke(self, arg, from_tty):
3030 gdb.write(gdb.parse_and_eval("saved_command_line").string() + "\n")
3131
32+
3233 LxCmdLine()
3334
3435
@@ -43,6 +44,7 @@ class LxVersion(gdb.Command): · 8 unmodified lines
4344 # linux_banner should contain a newline
4445 gdb.write(gdb.parse_and_eval("(char *)linux_banner").string())
4546
47+
4648 LxVersion()
4749
4850
@@ -86,6 +88,7 @@ Equivalent to cat /proc/iomem on a running target""" · 37 unmodified lines
8688 def invoke(self, arg, from_tty):
8789 return show_lx_resources("iomem_resource")
8890
91+
8992 LxIOMem()
9093
9194
@@ -100,6 +103,7 @@ Equivalent to cat /proc/ioports on a running target""" · 8 unmodified lines
100103 def invoke(self, arg, from_tty):
101104 return show_lx_resources("ioport_resource")
102105
106+
103107 LxIOPorts()
104108
105109
@@ -149,7 +153,7 @@ values of that process namespace""" · 43 unmodified lines
149153 if len(argv) >= 1:
150154 try:
151155 pid = int(argv[0])
152− except:
156+ except gdb.error:
153157 raise gdb.GdbError("Provide a PID as integer value")
154158 else:
155159 pid = 1
@@ -195,6 +199,7 @@ values of that process namespace""" · 39 unmodified lines
195199 info_opts(FS_INFO, s_flags),
196200 info_opts(MNT_INFO, m_flags)))
197201
202+
198203 LxMounts()
199204
200205
@@ -259,7 +264,7 @@ class LxFdtDump(gdb.Command): · 58 unmodified lines
259264
260265 try:
261266 f = open(filename, 'wb')
262− except:
267+ except gdb.error:
263268 raise gdb.GdbError("Could not open file to dump fdt")
264269
265270 f.write(fdt_buf)
@@ -267,4 +272,5 @@ class LxFdtDump(gdb.Command): · 1 unmodified line
267272
268273 gdb.write("Dumped fdt blob to " + filename + "\n")
269274
275+
270276 LxFdtDump()
scripts/gdb/linux/tasks.py+2−0
@@ -79,6 +79,7 @@ class LxPs(gdb.Command): · 78 unmodified lines
7979 pid=task["pid"],
8080 comm=task["comm"].string()))
8181
82+
8283 LxPs()
8384
8485
@@ -134,4 +135,5 @@ variable.""" · 49 unmodified lines
134135 else:
135136 raise gdb.GdbError("No task of PID " + str(pid))
136137
138+
137139 LxThreadInfoByPidFunc()
scripts/gdb/linux/utils.py+4−3
@@ -66,6 +66,7 @@ Note that TYPE and ELEMENT have to be quoted as strings.""" · 65 unmodified lines
6666 return container_of(ptr, gdb.lookup_type(typename.string()).pointer(),
6767 elementname.string())
6868
69+
6970 ContainerOf()
7071
7172
@@ -148,14 +149,14 @@ def get_gdbserver_type(): · 76 unmodified lines
148149 def probe_qemu():
149150 try:
150151 return gdb.execute("monitor info version", to_string=True) != ""
151− except:
152+ except gdb.error:
152153 return False
153154
154155 def probe_kgdb():
155156 try:
156157 thread_info = gdb.execute("info thread 2", to_string=True)
157158 return "shadowCPU0" in thread_info
158− except:
159+ except gdb.error:
159160 return False
160161
161162 global gdbserver_type
@@ -172,7 +173,7 @@ def get_gdbserver_type(): · 10 unmodified lines
172173 def gdb_eval_or_none(expresssion):
173174 try:
174175 return gdb.parse_and_eval(expresssion)
175− except:
176+ except gdb.error:
176177 return None
177178
178179