.. | .. |
---|
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 | |
---|
.. | .. |
---|
42 | 43 | def invoke(self, arg, from_tty): |
---|
43 | 44 | # linux_banner should contain a newline |
---|
44 | 45 | gdb.write(gdb.parse_and_eval("(char *)linux_banner").string()) |
---|
| 46 | + |
---|
45 | 47 | |
---|
46 | 48 | LxVersion() |
---|
47 | 49 | |
---|
.. | .. |
---|
86 | 88 | def invoke(self, arg, from_tty): |
---|
87 | 89 | return show_lx_resources("iomem_resource") |
---|
88 | 90 | |
---|
| 91 | + |
---|
89 | 92 | LxIOMem() |
---|
90 | 93 | |
---|
91 | 94 | |
---|
.. | .. |
---|
99 | 102 | |
---|
100 | 103 | def invoke(self, arg, from_tty): |
---|
101 | 104 | return show_lx_resources("ioport_resource") |
---|
| 105 | + |
---|
102 | 106 | |
---|
103 | 107 | LxIOPorts() |
---|
104 | 108 | |
---|
.. | .. |
---|
114 | 118 | return opts |
---|
115 | 119 | |
---|
116 | 120 | |
---|
117 | | -FS_INFO = {constants.LX_MS_SYNCHRONOUS: ",sync", |
---|
118 | | - constants.LX_MS_MANDLOCK: ",mand", |
---|
119 | | - constants.LX_MS_DIRSYNC: ",dirsync", |
---|
120 | | - constants.LX_MS_NOATIME: ",noatime", |
---|
121 | | - constants.LX_MS_NODIRATIME: ",nodiratime"} |
---|
| 121 | +FS_INFO = {constants.LX_SB_SYNCHRONOUS: ",sync", |
---|
| 122 | + constants.LX_SB_MANDLOCK: ",mand", |
---|
| 123 | + constants.LX_SB_DIRSYNC: ",dirsync", |
---|
| 124 | + constants.LX_SB_NOATIME: ",noatime", |
---|
| 125 | + constants.LX_SB_NODIRATIME: ",nodiratime"} |
---|
122 | 126 | |
---|
123 | 127 | MNT_INFO = {constants.LX_MNT_NOSUID: ",nosuid", |
---|
124 | 128 | constants.LX_MNT_NODEV: ",nodev", |
---|
.. | .. |
---|
149 | 153 | if len(argv) >= 1: |
---|
150 | 154 | try: |
---|
151 | 155 | pid = int(argv[0]) |
---|
152 | | - except: |
---|
| 156 | + except gdb.error: |
---|
153 | 157 | raise gdb.GdbError("Provide a PID as integer value") |
---|
154 | 158 | else: |
---|
155 | 159 | pid = 1 |
---|
.. | .. |
---|
162 | 166 | namespace = task['nsproxy']['mnt_ns'] |
---|
163 | 167 | if not namespace: |
---|
164 | 168 | raise gdb.GdbError("No namespace for current process") |
---|
| 169 | + |
---|
| 170 | + gdb.write("{:^18} {:^15} {:>9} {} {} options\n".format( |
---|
| 171 | + "mount", "super_block", "devname", "pathname", "fstype")) |
---|
165 | 172 | |
---|
166 | 173 | for vfs in lists.list_for_each_entry(namespace['list'], |
---|
167 | 174 | mount_ptr_type, "mnt_list"): |
---|
.. | .. |
---|
184 | 191 | fstype = superblock['s_type']['name'].string() |
---|
185 | 192 | s_flags = int(superblock['s_flags']) |
---|
186 | 193 | m_flags = int(vfs['mnt']['mnt_flags']) |
---|
187 | | - rd = "ro" if (s_flags & constants.LX_MS_RDONLY) else "rw" |
---|
| 194 | + rd = "ro" if (s_flags & constants.LX_SB_RDONLY) else "rw" |
---|
188 | 195 | |
---|
189 | | - gdb.write( |
---|
190 | | - "{} {} {} {}{}{} 0 0\n" |
---|
191 | | - .format(devname, |
---|
192 | | - pathname, |
---|
193 | | - fstype, |
---|
194 | | - rd, |
---|
195 | | - info_opts(FS_INFO, s_flags), |
---|
196 | | - info_opts(MNT_INFO, m_flags))) |
---|
| 196 | + gdb.write("{} {} {} {} {} {}{}{} 0 0\n".format( |
---|
| 197 | + vfs.format_string(), superblock.format_string(), devname, |
---|
| 198 | + pathname, fstype, rd, info_opts(FS_INFO, s_flags), |
---|
| 199 | + info_opts(MNT_INFO, m_flags))) |
---|
| 200 | + |
---|
197 | 201 | |
---|
198 | 202 | LxMounts() |
---|
199 | 203 | |
---|
.. | .. |
---|
259 | 263 | |
---|
260 | 264 | try: |
---|
261 | 265 | f = open(filename, 'wb') |
---|
262 | | - except: |
---|
| 266 | + except gdb.error: |
---|
263 | 267 | raise gdb.GdbError("Could not open file to dump fdt") |
---|
264 | 268 | |
---|
265 | 269 | f.write(fdt_buf) |
---|
.. | .. |
---|
267 | 271 | |
---|
268 | 272 | gdb.write("Dumped fdt blob to " + filename + "\n") |
---|
269 | 273 | |
---|
| 274 | + |
---|
270 | 275 | LxFdtDump() |
---|