Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scripts/gdb: silence pep8 checks

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

Link: http://lkml.kernel.org/r/20190329220844.38234-6-swboyd@chromium.org
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Nikolay Borisov <n.borisov.lkml@gmail.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Jackie Liu <liuyun01@kylinos.cn>
Cc: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Stephen Boyd and committed by
Linus Torvalds
494dbe02 442284a8

+16 -5
+1
scripts/gdb/linux/cpus.py
··· 135 135 gdb.write("Online CPUs : {}\n".format(list(each_online_cpu()))) 136 136 gdb.write("Active CPUs : {}\n".format(list(each_active_cpu()))) 137 137 138 + 138 139 LxCpus() 139 140 140 141
+1
scripts/gdb/linux/lists.py
··· 110 110 raise gdb.GdbError("lx-list-check takes one argument") 111 111 list_check(gdb.parse_and_eval(argv[0])) 112 112 113 + 113 114 LxListChk()
+8 -2
scripts/gdb/linux/proc.py
··· 29 29 def invoke(self, arg, from_tty): 30 30 gdb.write(gdb.parse_and_eval("saved_command_line").string() + "\n") 31 31 32 + 32 33 LxCmdLine() 33 34 34 35 ··· 43 42 def invoke(self, arg, from_tty): 44 43 # linux_banner should contain a newline 45 44 gdb.write(gdb.parse_and_eval("(char *)linux_banner").string()) 45 + 46 46 47 47 LxVersion() 48 48 ··· 88 86 def invoke(self, arg, from_tty): 89 87 return show_lx_resources("iomem_resource") 90 88 89 + 91 90 LxIOMem() 92 91 93 92 ··· 102 99 103 100 def invoke(self, arg, from_tty): 104 101 return show_lx_resources("ioport_resource") 102 + 105 103 106 104 LxIOPorts() 107 105 ··· 153 149 if len(argv) >= 1: 154 150 try: 155 151 pid = int(argv[0]) 156 - except: 152 + except gdb.error: 157 153 raise gdb.GdbError("Provide a PID as integer value") 158 154 else: 159 155 pid = 1 ··· 198 194 rd, 199 195 info_opts(FS_INFO, s_flags), 200 196 info_opts(MNT_INFO, m_flags))) 197 + 201 198 202 199 LxMounts() 203 200 ··· 264 259 265 260 try: 266 261 f = open(filename, 'wb') 267 - except: 262 + except gdb.error: 268 263 raise gdb.GdbError("Could not open file to dump fdt") 269 264 270 265 f.write(fdt_buf) 271 266 f.close() 272 267 273 268 gdb.write("Dumped fdt blob to " + filename + "\n") 269 + 274 270 275 271 LxFdtDump()
+2
scripts/gdb/linux/tasks.py
··· 79 79 pid=task["pid"], 80 80 comm=task["comm"].string())) 81 81 82 + 82 83 LxPs() 83 84 84 85 ··· 134 133 return get_thread_info(task.dereference()) 135 134 else: 136 135 raise gdb.GdbError("No task of PID " + str(pid)) 136 + 137 137 138 138 LxThreadInfoByPidFunc()
+4 -3
scripts/gdb/linux/utils.py
··· 66 66 return container_of(ptr, gdb.lookup_type(typename.string()).pointer(), 67 67 elementname.string()) 68 68 69 + 69 70 ContainerOf() 70 71 71 72 ··· 149 148 def probe_qemu(): 150 149 try: 151 150 return gdb.execute("monitor info version", to_string=True) != "" 152 - except: 151 + except gdb.error: 153 152 return False 154 153 155 154 def probe_kgdb(): 156 155 try: 157 156 thread_info = gdb.execute("info thread 2", to_string=True) 158 157 return "shadowCPU0" in thread_info 159 - except: 158 + except gdb.error: 160 159 return False 161 160 162 161 global gdbserver_type ··· 173 172 def gdb_eval_or_none(expresssion): 174 173 try: 175 174 return gdb.parse_and_eval(expresssion) 176 - except: 175 + except gdb.error: 177 176 return None 178 177 179 178