These scripts have some pep8 style warnings. Fix them up so that this directory is all pep8 clean.
Showing the changes to scripts (5 of 5 files). Show all
Unified · Split
| @@ -135,6 +135,7 @@ and can help identify the state of hotplugged CPUs""" · 134 unmodified lines | |||
| 135 | gdb.write("Online CPUs : {}\n".format(list(each_online_cpu()))) | 135 | gdb.write("Online CPUs : {}\n".format(list(each_online_cpu()))) |
| 136 | gdb.write("Active CPUs : {}\n".format(list(each_active_cpu()))) | 136 | gdb.write("Active CPUs : {}\n".format(list(each_active_cpu()))) |
| 137 | 137 | ||
| 138 | |||
| 138 | LxCpus() | 139 | LxCpus() |
| 139 | 140 | ||
| 140 | 141 | ||
| @@ -110,4 +110,5 @@ class LxListChk(gdb.Command): · 109 unmodified lines | |||
| 110 | raise gdb.GdbError("lx-list-check takes one argument") | 110 | raise gdb.GdbError("lx-list-check takes one argument") |
| 111 | list_check(gdb.parse_and_eval(argv[0])) | 111 | list_check(gdb.parse_and_eval(argv[0])) |
| 112 | 112 | ||
| 113 | |||
| 113 | LxListChk() | 114 | LxListChk() |
| @@ -29,6 +29,7 @@ class LxCmdLine(gdb.Command): · 28 unmodified lines | |||
| 29 | def invoke(self, arg, from_tty): | 29 | def invoke(self, arg, from_tty): |
| 30 | gdb.write(gdb.parse_and_eval("saved_command_line").string() + "\n") | 30 | gdb.write(gdb.parse_and_eval("saved_command_line").string() + "\n") |
| 31 | 31 | ||
| 32 | |||
| 32 | LxCmdLine() | 33 | LxCmdLine() |
| 33 | 34 | ||
| 34 | 35 | ||
| @@ -43,6 +44,7 @@ class LxVersion(gdb.Command): · 8 unmodified lines | |||
| 43 | # linux_banner should contain a newline | 44 | # linux_banner should contain a newline |
| 44 | gdb.write(gdb.parse_and_eval("(char *)linux_banner").string()) | 45 | gdb.write(gdb.parse_and_eval("(char *)linux_banner").string()) |
| 45 | 46 | ||
| 47 | |||
| 46 | LxVersion() | 48 | LxVersion() |
| 47 | 49 | ||
| 48 | 50 | ||
| @@ -86,6 +88,7 @@ Equivalent to cat /proc/iomem on a running target""" · 37 unmodified lines | |||
| 86 | def invoke(self, arg, from_tty): | 88 | def invoke(self, arg, from_tty): |
| 87 | return show_lx_resources("iomem_resource") | 89 | return show_lx_resources("iomem_resource") |
| 88 | 90 | ||
| 91 | |||
| 89 | LxIOMem() | 92 | LxIOMem() |
| 90 | 93 | ||
| 91 | 94 | ||
| @@ -100,6 +103,7 @@ Equivalent to cat /proc/ioports on a running target""" · 8 unmodified lines | |||
| 100 | def invoke(self, arg, from_tty): | 103 | def invoke(self, arg, from_tty): |
| 101 | return show_lx_resources("ioport_resource") | 104 | return show_lx_resources("ioport_resource") |
| 102 | 105 | ||
| 106 | |||
| 103 | LxIOPorts() | 107 | LxIOPorts() |
| 104 | 108 | ||
| 105 | 109 | ||
| @@ -149,7 +153,7 @@ values of that process namespace""" · 43 unmodified lines | |||
| 149 | if len(argv) >= 1: | 153 | if len(argv) >= 1: |
| 150 | try: | 154 | try: |
| 151 | pid = int(argv[0]) | 155 | pid = int(argv[0]) |
| 152 | except: | 156 | except gdb.error: |
| 153 | raise gdb.GdbError("Provide a PID as integer value") | 157 | raise gdb.GdbError("Provide a PID as integer value") |
| 154 | else: | 158 | else: |
| 155 | pid = 1 | 159 | pid = 1 |
| @@ -195,6 +199,7 @@ values of that process namespace""" · 39 unmodified lines | |||
| 195 | info_opts(FS_INFO, s_flags), | 199 | info_opts(FS_INFO, s_flags), |
| 196 | info_opts(MNT_INFO, m_flags))) | 200 | info_opts(MNT_INFO, m_flags))) |
| 197 | 201 | ||
| 202 | |||
| 198 | LxMounts() | 203 | LxMounts() |
| 199 | 204 | ||
| 200 | 205 | ||
| @@ -259,7 +264,7 @@ class LxFdtDump(gdb.Command): · 58 unmodified lines | |||
| 259 | 264 | ||
| 260 | try: | 265 | try: |
| 261 | f = open(filename, 'wb') | 266 | f = open(filename, 'wb') |
| 262 | except: | 267 | except gdb.error: |
| 263 | raise gdb.GdbError("Could not open file to dump fdt") | 268 | raise gdb.GdbError("Could not open file to dump fdt") |
| 264 | 269 | ||
| 265 | f.write(fdt_buf) | 270 | f.write(fdt_buf) |
| @@ -267,4 +272,5 @@ class LxFdtDump(gdb.Command): · 1 unmodified line | |||
| 267 | 272 | ||
| 268 | gdb.write("Dumped fdt blob to " + filename + "\n") | 273 | gdb.write("Dumped fdt blob to " + filename + "\n") |
| 269 | 274 | ||
| 275 | |||
| 270 | LxFdtDump() | 276 | LxFdtDump() |
| @@ -79,6 +79,7 @@ class LxPs(gdb.Command): · 78 unmodified lines | |||
| 79 | pid=task["pid"], | 79 | pid=task["pid"], |
| 80 | comm=task["comm"].string())) | 80 | comm=task["comm"].string())) |
| 81 | 81 | ||
| 82 | |||
| 82 | LxPs() | 83 | LxPs() |
| 83 | 84 | ||
| 84 | 85 | ||
| @@ -134,4 +135,5 @@ variable.""" · 49 unmodified lines | |||
| 134 | else: | 135 | else: |
| 135 | raise gdb.GdbError("No task of PID " + str(pid)) | 136 | raise gdb.GdbError("No task of PID " + str(pid)) |
| 136 | 137 | ||
| 138 | |||
| 137 | LxThreadInfoByPidFunc() | 139 | LxThreadInfoByPidFunc() |
| @@ -66,6 +66,7 @@ Note that TYPE and ELEMENT have to be quoted as strings.""" · 65 unmodified lines | |||
| 66 | return container_of(ptr, gdb.lookup_type(typename.string()).pointer(), | 66 | return container_of(ptr, gdb.lookup_type(typename.string()).pointer(), |
| 67 | elementname.string()) | 67 | elementname.string()) |
| 68 | 68 | ||
| 69 | |||
| 69 | ContainerOf() | 70 | ContainerOf() |
| 70 | 71 | ||
| 71 | 72 | ||
| @@ -148,14 +149,14 @@ def get_gdbserver_type(): · 76 unmodified lines | |||
| 148 | def probe_qemu(): | 149 | def probe_qemu(): |
| 149 | try: | 150 | try: |
| 150 | return gdb.execute("monitor info version", to_string=True) != "" | 151 | return gdb.execute("monitor info version", to_string=True) != "" |
| 151 | except: | 152 | except gdb.error: |
| 152 | return False | 153 | return False |
| 153 | 154 | ||
| 154 | def probe_kgdb(): | 155 | def probe_kgdb(): |
| 155 | try: | 156 | try: |
| 156 | thread_info = gdb.execute("info thread 2", to_string=True) | 157 | thread_info = gdb.execute("info thread 2", to_string=True) |
| 157 | return "shadowCPU0" in thread_info | 158 | return "shadowCPU0" in thread_info |
| 158 | except: | 159 | except gdb.error: |
| 159 | return False | 160 | return False |
| 160 | 161 | ||
| 161 | global gdbserver_type | 162 | global gdbserver_type |
| @@ -172,7 +173,7 @@ def get_gdbserver_type(): · 10 unmodified lines | |||
| 172 | def gdb_eval_or_none(expresssion): | 173 | def gdb_eval_or_none(expresssion): |
| 173 | try: | 174 | try: |
| 174 | return gdb.parse_and_eval(expresssion) | 175 | return gdb.parse_and_eval(expresssion) |
| 175 | except: | 176 | except gdb.error: |
| 176 | return None | 177 | return None |
| 177 | 178 | ||
| 178 | 179 | ||