Home
last modified time | relevance | path

Searched refs:gdb (Results 1 – 25 of 60) sorted by relevance

123

/Linux-v6.6/scripts/gdb/linux/
Dproc.py15 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):
[all …]
Dpage_owner.py9 import gdb
27 gdb.write("Unrecognized command\n")
28 raise gdb.GdbError(t)
30 class DumpPageOwner(gdb.Command):
39 super(DumpPageOwner, self).__init__("lx-dump-page-owner", gdb.COMMAND_SUPPORT)
43 raise gdb.GdbError('CONFIG_PAGE_OWNER does not enable')
45 page_owner_inited = gdb.parse_and_eval('page_owner_inited')
47 raise gdb.GdbError('page_owner_inited is not enabled')
51 argv = gdb.string_to_argv(args)
64 self.min_pfn = int(gdb.parse_and_eval("min_low_pfn"))
[all …]
Dcpus.py14 import gdb
27 return gdb.selected_thread().num - 1
29 tid = gdb.selected_thread().ptid[2]
35 raise gdb.GdbError("Sorry, obtaining the current CPU is not yet "
43 offset = gdb.parse_and_eval(
47 offset = gdb.parse_and_eval(
49 except gdb.error:
62 gdb.events.stop.disconnect(cpu_mask_invalidate)
63 if hasattr(gdb.events, 'new_objfile'):
64 gdb.events.new_objfile.disconnect(cpu_mask_invalidate)
[all …]
Dvmalloc.py9 import gdb
21 class LxVmallocInfo(gdb.Command):
25 super(LxVmallocInfo, self).__init__("lx-vmallocinfo", gdb.COMMAND_DATA)
28 vmap_area_list = gdb.parse_and_eval('vmap_area_list')
31gdb.write("0x%x-0x%x %10d vm_map_ram\n" % (vmap_area['va_start'], vmap_area['va_end'],
35 gdb.write("0x%x-0x%x %10d" % (v['addr'], v['addr'] + v['size'], v['size']))
37 gdb.write(" %s" % str(v['caller']).split(' ')[-1])
39 gdb.write(" pages=%d" % v['nr_pages'])
41 gdb.write(" phys=0x%x" % v['phys_addr'])
43 gdb.write(" ioremap")
[all …]
Dsymbols.py14 import gdb
21 if hasattr(gdb, 'Breakpoint'):
22 class LoadModuleBreakpoint(gdb.Breakpoint):
29 module = gdb.parse_and_eval("mod")
39 show_pagination = gdb.execute("show pagination", to_string=True)
41 gdb.execute("set pagination off")
44 gdb.write("refreshing all symbols to reload module "
51 gdb.execute("set pagination %s" % ("on" if pagination else "off"))
56 class LxSymbols(gdb.Command):
71 super(LxSymbols, self).__init__("lx-symbols", gdb.COMMAND_FILES,
[all …]
Dslab.py9 import gdb
34 track_type = gdb.lookup_type('struct track')
35 track_alloc = int(gdb.parse_and_eval('TRACK_ALLOC'))
36 track_free = int(gdb.parse_and_eval('TRACK_FREE'))
39 return slab.cast(gdb.lookup_type("struct folio").pointer())
56 return cache['inuse'] + gdb.lookup_type("void").pointer().sizeof
64 p += gdb.lookup_type('struct track').sizeof * 2
118 jiffies = gdb.parse_and_eval("jiffies_64")
158 while p != gdb.Value(0):
173 track = gdb.Value(p).cast(track_type.pointer())
[all …]
Dutils.py14 import gdb
24 gdb.events.new_objfile.disconnect(self._new_objfile_handler)
28 self._type = gdb.lookup_type(self._name)
30 raise gdb.GdbError(
32 if hasattr(gdb, 'events') and hasattr(gdb.events, 'new_objfile'):
33 gdb.events.new_objfile.connect(self._new_objfile_handler)
65 element = gdb.Value(0).cast(typeobj)
74 class ContainerOf(gdb.Function):
85 return container_of(ptr, gdb.lookup_type(typename.string()).pointer(),
100 endian = gdb.execute("show endian", to_string=True)
[all …]
Dmm.py9 import gdb
26 raise gdb.GdbError('Only support CONFIG_SPARSEMEM_VMEMMAP now')
30 raise gdb.GdbError('Only support aarch64 now')
51 self.vabits_actual = gdb.parse_and_eval('vabits_actual')
55 self.kimage_voffset = gdb.parse_and_eval('kimage_voffset') & ((1 << 64) - 1)
71 self.SECTIONS_PER_ROOT = self.PAGE_SIZE // gdb.lookup_type("struct mem_section").sizeof
82 self.SECTION_HAS_MEM_MAP = 1 << int(gdb.parse_and_eval('SECTION_HAS_MEM_MAP_BIT'))
83 self.SECTION_IS_EARLY = 1 << int(gdb.parse_and_eval('SECTION_IS_EARLY_BIT'))
100 self.memstart_addr = gdb.parse_and_eval("memstart_addr")
102 …self.vmemmap = gdb.Value(self.VMEMMAP_START).cast(utils.get_page_type().pointer()) - (self.memstar…
[all …]
Dstackdepot.py9 import gdb
20 stack_depot_disabled = gdb.parse_and_eval('stack_depot_disabled')
23 raise gdb.GdbError("stack_depot_disabled\n")
25 handle_parts_t = gdb.lookup_type("union handle_parts")
28 pool_index_cached = gdb.parse_and_eval('pool_index')
31gdb.write("pool index %d out of bounds (%d) for stack id 0x%08x\n" % (parts['pool_index'], pool_in…
32 return gdb.Value(0), 0
34 stack_pools = gdb.parse_and_eval('stack_pools')
38 …stack = (pool + gdb.Value(offset).cast(utils.get_size_t_type())).cast(stack_record_type.get_type()…
42 gdb.write("%s\n" % e)
[all …]
Dlists.py14 import gdb
31 gdb.write("list_for_each: Uninitialized list '{}' treated as empty\n"
69 raise gdb.GdbError('argument must be of type (struct list_head [*])')
72 gdb.write("Starting with: {}\n".format(c))
73 except gdb.MemoryError:
74 gdb.write('head is not accessible\n')
81 gdb.write('prev.next != current: '
90 except gdb.MemoryError:
91 gdb.write('prev is not accessible: '
99 gdb.write('next.prev != current: '
[all …]
Dmodules.py14 import gdb
41 class LxModule(gdb.Function):
56 raise gdb.GdbError("Unable to find MODULE " + mod_name)
62 class LxLsmod(gdb.Command):
68 super(LxLsmod, self).__init__("lx-lsmod", gdb.COMMAND_DATA)
71 gdb.write(
83 gdb.write("{address} {name:<19} {size:>8} {ref}".format(
93 gdb.write("{separator}{name}".format(
98 gdb.write("\n")
105 gdb.write("Unrecognized command\n")
[all …]
Dclk.py5 import gdb
18 class LxClkSummary(gdb.Command):
27 super(LxClkSummary, self).__init__("lx-clk-summary", gdb.COMMAND_DATA)
30 gdb.write("%*s%-*s %7d %8d %8d %11lu%s\n" % (
45 raise gdb.GdbError("No clocks registered")
46 gdb.write(" enable prepare protect \n")
47 gdb.write(" clock count count count rate \n")
48 gdb.write("------------------------------------------------------------------------\n")
49 for clk in clk_core_for_each_child(gdb.parse_and_eval("clk_root_list")):
51 for clk in clk_core_for_each_child(gdb.parse_and_eval("clk_orphan_list")):
[all …]
Ddevice.py5 import gdb
36 for kobj in kset_for_each_object(gdb.parse_and_eval('bus_kset')):
43 for kobj in kset_for_each_object(gdb.parse_and_eval('class_kset')):
53 raise gdb.GdbError("Can't find bus type {!r}".format(name))
60 raise gdb.GdbError("Can't find device class {!r}".format(name))
91 gdb.write('{}dev {}:\t{}\n'.format('\t' * level, dev_name(dev), dev))
97 class LxDeviceListBus(gdb.Command):
101 super(LxDeviceListBus, self).__init__('lx-device-list-bus', gdb.COMMAND_DATA)
106 gdb.write('bus {}:\t{}\n'.format(bus['name'].string(), bus))
112 raise gdb.GdbError("Can't find bus {!r}".format(arg))
[all …]
Dconfig.py5 import gdb
11 class LxConfigDump(gdb.Command):
17 super(LxConfigDump, self).__init__("lx-configdump", gdb.COMMAND_DATA,
18 gdb.COMPLETE_FILENAME)
27 py_config_ptr = gdb.parse_and_eval("&kernel_config_data")
28 py_config_ptr_end = gdb.parse_and_eval("&kernel_config_data_end")
30 except gdb.error as e:
31 raise gdb.GdbError("Can't find config, enable CONFIG_IKCONFIG?")
33 inf = gdb.inferiors()[0]
41 gdb.write("Dumped config to " + filename + "\n")
Dtasks.py14 import gdb
24 init_task = gdb.parse_and_eval("init_task").address
49 class LxTaskByPidFunc(gdb.Function):
63 raise gdb.GdbError("No task of PID " + str(pid))
69 class LxPs(gdb.Command):
73 super(LxPs, self).__init__("lx-ps", gdb.COMMAND_DATA)
76 gdb.write("{:>10} {:>12} {:>7}\n".format("TASK", "PID", "COMM"))
78 gdb.write("{} {:^5} {}\n".format(
97 ia64_task_size = gdb.parse_and_eval("sizeof(struct task_struct)")
107 class LxThreadInfoFunc (gdb.Function):
[all …]
Dgenpd.py5 import gdb
38 class LxGenPDSummary(gdb.Command):
44 super(LxGenPDSummary, self).__init__('lx-genpd-summary', gdb.COMMAND_DATA)
59 gdb.write('%-30s %-15s %s\n' % (
70 gdb.write(' %-50s %s\n' % (kobj_path, rtpm_status_str(dev)))
74 raise gdb.GdbError("No power domain(s) registered")
75 gdb.write('domain status children\n');
76 gdb.write(' /device runtime status\n');
77 gdb.write('----------------------------------------------------------------------\n');
79 gdb.parse_and_eval('&gpd_list'),
Drbtree.py5 import gdb
17 raise gdb.GdbError("Must be struct rb_root not {}".format(root.type))
33 raise gdb.GdbError("Must be struct rb_root not {}".format(root.type))
46 parent = gdb.Value(node['__rb_parent_color'] & ~3)
58 raise gdb.GdbError("Must be struct rb_node not {}".format(node.type))
81 raise gdb.GdbError("Must be struct rb_node not {}".format(node.type))
100 class LxRbFirst(gdb.Function):
112 raise gdb.GdbError("No entry in tree")
120 class LxRbLast(gdb.Function):
132 raise gdb.GdbError("No entry in tree")
[all …]
Dinterrupts.py5 import gdb
18 return desc['action'] and desc['action'] == gdb.parse_and_eval("&chained_action")
26 desc = radixtree.lookup(gdb.parse_and_eval("&irq_desc_tree"), irq)
76 gdb.lookup_type("struct irqaction")
101 irq_stat = gdb.parse_and_eval("&irq_stat")
110 pvar = gdb.parse_and_eval(var)
187 text += "%*s: %10lu\n" % (prec, "ERR", gdb.parse_and_eval("irq_err_count"))
201 raise gdb.GdbError("Unsupported architecture: {}".format(target_arch))
205 class LxInterruptList(gdb.Command):
209 super(LxInterruptList, self).__init__("lx-interruptlist", gdb.COMMAND_DATA)
[all …]
Dpgtable.py11 import gdb
15 PHYSICAL_ADDRESS_MASK = gdb.parse_and_eval('0xfffffffffffff')
21 return gdb.parse_and_eval('(u64) ~0xfff')
24 return gdb.parse_and_eval('(u64) ~0x1fffff')
27 return gdb.parse_and_eval('(u64) ~0x3fffffff')
35 pob_symbol = gdb.lookup_global_symbol('page_offset_base')
37 return gdb.parse_and_eval(pob)
91 memoryview(gdb.selected_inferior().read_memory(address, 8)),
197 class TranslateVM(gdb.Command):
205 super(TranslateVM, self).__init__('translate-vm', gdb.COMMAND_USER)
[all …]
Dtimerlist.py6 import gdb
23 tk_core = gdb.parse_and_eval("&tk_core")
70 jiffies = gdb.parse_and_eval("jiffies_64")
71 tick_sched_ptr = gdb.parse_and_eval("&tick_cpu_sched")
153 nr_cpu_ids = gdb.parse_and_eval("nr_cpu_ids")
155 inf = gdb.inferiors()[0]
180 class LxTimerList(gdb.Command):
184 super(LxTimerList, self).__init__("lx-timerlist", gdb.COMMAND_DATA)
187 hrtimer_bases = gdb.parse_and_eval("&hrtimer_bases")
188 max_clock_bases = gdb.parse_and_eval("HRTIMER_MAX_CLOCK_BASES")
[all …]
/Linux-v6.6/Documentation/translations/zh_CN/dev-tools/
Dgdb-kernel-debugging.rst5 :Original: Documentation/dev-tools/gdb-kernel-debugging.rst
8 通过gdb调试内核和模块
11 Kgdb内核调试器、QEMU等虚拟机管理程序或基于JTAG的硬件接口,支持在运行时使用gdb
14 此教程基于QEMU/KVM虚拟机,但文中示例也适用于其他gdb stub。
20 - gdb 7.2+ (推荐版本: 7.4+) 且开启python支持 (通常发行版上都已支持)
37 - 启用QEMU/KVM的gdb stub,可以通过如下方式实现
47 - 启动gdbgdb vmlinux
49 注意:某些发行版可能会将gdb脚本的自动加载限制在已知的安全目录中。
50 如果gdb报告拒绝加载vmlinux-gdb.py(相关命令找不到),请将::
54 添加到~/.gdbinit。更多详细信息,请参阅gdb帮助信息。
[all …]
/Linux-v6.6/Documentation/dev-tools/
Dgdb-kernel-debugging.rst3 Debugging kernel and modules via gdb
8 using gdb. Gdb comes with a powerful scripting interface for python. The
12 be transferred to the other gdb stubs as well.
18 - gdb 7.2+ (recommended: 7.4+) with python support enabled (typically true
42 - Build the gdb scripts (required on kernels v5.1 and above)::
46 - Enable the gdb stub of QEMU/KVM, either
57 - Start gdb: gdb vmlinux
59 Note: Some distros may restrict auto-loading of gdb scripts to known safe
60 directories. In case gdb reports to refuse loading vmlinux-gdb.py, add::
64 to ~/.gdbinit. See gdb help for more details.
[all …]
/Linux-v6.6/Documentation/translations/zh_TW/admin-guide/
Dbug-hunting.rst107 通常來說使用 ``gdb`` 會比較容易,不過內核需要用調試信息來預編譯。
109 gdb subsection
112 GNU 調試器(GNU debugger, ``gdb`` )是從 ``vmlinux`` 文件中找出OOPS的確切
115 在使用 ``CONFIG_DEBUG_INFO`` 編譯的內核上使用gdb效果最好。可通過運行以下命令
126 $ gdb vmlinux
127 (gdb) l *0xc021e50e
137 $ gdb vmlinux
138 (gdb) l *vt_ioctl+0xda8
153 (gdb) p vt_ioctl
155 (gdb) l *0xae0+0xda8
[all …]
/Linux-v6.6/Documentation/translations/zh_CN/admin-guide/
Dbug-hunting.rst104 通常来说使用 ``gdb`` 会比较容易,不过内核需要用调试信息来预编译。
106 gdb subsection
109 GNU 调试器(GNU debugger, ``gdb`` )是从 ``vmlinux`` 文件中找出OOPS的确切
112 在使用 ``CONFIG_DEBUG_INFO`` 编译的内核上使用gdb效果最好。可通过运行以下命令
123 $ gdb vmlinux
124 (gdb) l *0xc021e50e
134 $ gdb vmlinux
135 (gdb) l *vt_ioctl+0xda8
150 (gdb) p vt_ioctl
152 (gdb) l *0xae0+0xda8
[all …]
/Linux-v6.6/scripts/gdb/
Dvmlinux-gdb.py19 gdb.parse_and_eval("0")
20 gdb.execute("", to_string=True)
22 gdb.write("NOTE: gdb 7.2 or later required for Linux helper scripts to "
27 raise gdb.GdbError("Reduced debug information will prevent GDB "

123