Lines Matching refs:gdb

3 # gdb helper commands and functions for Linux kernel debugging
15 import gdb
24 class LxCmdLine(gdb.Command):
29 super(LxCmdLine, self).__init__("lx-cmdline", gdb.COMMAND_DATA)
32 gdb.write(gdb.parse_and_eval("saved_command_line").string() + "\n")
38 class LxVersion(gdb.Command):
43 super(LxVersion, self).__init__("lx-version", gdb.COMMAND_DATA)
47 gdb.write(gdb.parse_and_eval("(char *)linux_banner").string())
70 resource = gdb.parse_and_eval(resource_str)
76 gdb.write(" " * depth * 2 +
82 class LxIOMem(gdb.Command):
88 super(LxIOMem, self).__init__("lx-iomem", gdb.COMMAND_DATA)
97 class LxIOPorts(gdb.Command):
103 super(LxIOPorts, self).__init__("lx-ioports", gdb.COMMAND_DATA)
140 class LxMounts(gdb.Command):
148 super(LxMounts, self).__init__("lx-mounts", gdb.COMMAND_DATA)
154 argv = gdb.string_to_argv(arg)
158 except gdb.error:
159 raise gdb.GdbError("Provide a PID as integer value")
165 raise gdb.GdbError("Couldn't find a process with PID {}"
170 raise gdb.GdbError("No namespace for current process")
172 gdb.write("{:^18} {:^15} {:>9} {} {} options\n".format(
198 gdb.write("{} {} {} {} {} {}{}{} 0 0\n".format(
207 class LxFdtDump(gdb.Command):
213 super(LxFdtDump, self).__init__("lx-fdtdump", gdb.COMMAND_DATA,
214 gdb.COMPLETE_FILENAME)
238 raise gdb.GdbError("Kernel not compiled with CONFIG_OF\n")
245 py_fdt_header_ptr = gdb.parse_and_eval(
252 raise gdb.GdbError("No flattened device tree magic found\n")
254 gdb.write("fdt_magic: 0x{:02X}\n".format(fdt_header[0]))
255 gdb.write("fdt_totalsize: 0x{:02X}\n".format(fdt_header[1]))
256 gdb.write("off_dt_struct: 0x{:02X}\n".format(fdt_header[2]))
257 gdb.write("off_dt_strings: 0x{:02X}\n".format(fdt_header[3]))
258 gdb.write("off_mem_rsvmap: 0x{:02X}\n".format(fdt_header[4]))
259 gdb.write("version: {}\n".format(fdt_header[5]))
260 gdb.write("last_comp_version: {}\n".format(fdt_header[6]))
262 inf = gdb.inferiors()[0]
268 except gdb.error:
269 raise gdb.GdbError("Could not open file to dump fdt")
274 gdb.write("Dumped fdt blob to " + filename + "\n")