Home
last modified time | relevance | path

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

123

/linux/scripts/gdb/linux/
H A Dproc.py15 import gdb
25 class LxCmdLine(gdb.Command):
30 super(LxCmdLine, self).__init__("lx-cmdline", gdb.COMMAND_DATA)
33 gdb.write(gdb.parse_and_eval("saved_command_line").string() + "\n")
39 class LxVersion(gdb.Command):
44 super(LxVersion, self).__init__("lx-version", gdb.COMMAND_DATA)
48 gdb.write(gdb.parse_and_eval("(char *)linux_banner").string())
71 resource = gdb.parse_and_eval(resource_str)
77 gdb.write(" " * depth * 2 +
83 class LxIOMem(gdb.Command):
[all …]
H A 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 …]
H A Dcpus.py14 import gdb
27 return gdb.selected_thread().num - 1
29 return gdb.parse_and_eval("kgdb_active.counter")
31 raise gdb.GdbError("Sorry, obtaining the current CPU is not yet "
39 offset = gdb.parse_and_eval(
43 offset = gdb.parse_and_eval(
45 except gdb.error:
58 gdb.events.stop.disconnect(cpu_mask_invalidate)
59 if hasattr(gdb.events, 'new_objfile'):
60 gdb.events.new_objfile.disconnect(cpu_mask_invalidate)
[all …]
H A Dstackdepot.py9 import gdb
20 gdb.write("Unrecognized command\n")
21 raise gdb.GdbError(t)
27 stack_depot_disabled = gdb.parse_and_eval('stack_depot_disabled')
30 raise gdb.GdbError("stack_depot_disabled\n")
32 handle_parts_t = gdb.lookup_type("union handle_parts")
35 pools_num = gdb.parse_and_eval('pools_num')
38 raise gdb.GdbError("handle is 0\n")
42gdb.write("pool index %d out of bounds (%d) for stack id 0x%08x\n" % (parts['pool_index'], pools_n…
43 return gdb.Value(0), 0
[all …]
H A Dutils.py19 import gdb
29 gdb.events.new_objfile.disconnect(self._new_objfile_handler)
33 self._type = gdb.lookup_type(self._name)
35 raise gdb.GdbError(
37 if hasattr(gdb, 'events') and hasattr(gdb.events, 'new_objfile'):
38 gdb.events.new_objfile.connect(self._new_objfile_handler)
70 element = gdb.Value(0).cast(typeobj)
79 class ContainerOf(gdb.Function):
90 return container_of(ptr, gdb.lookup_type(typename.string()).pointer(),
105 endian = gdb.execute("show endian", to_string=True)
[all …]
H A Dvmalloc.py9 import gdb
22 class LxVmallocInfo(gdb.Command):
26 super(LxVmallocInfo, self).__init__("lx-vmallocinfo", gdb.COMMAND_DATA)
30 raise gdb.GdbError("Requires MMU support")
32 nr_vmap_nodes = gdb.parse_and_eval('nr_vmap_nodes')
34 vn = gdb.parse_and_eval('&vmap_nodes[%d]' % i)
37gdb.write("0x%x-0x%x %10d vm_map_ram\n" % (vmap_area['va_start'], vmap_area['va_end'],
41 gdb.write("0x%x-0x%x %10d" % (v['addr'], v['addr'] + v['size'], v['size']))
43 gdb.write(" %s" % str(v['caller']).split(' ')[-1])
45 gdb.write(" pages=%d" % v['nr_pages'])
[all …]
H A Dsymbols.py15 import gdb
24 if hasattr(gdb, 'Breakpoint'):
25 class LoadModuleBreakpoint(gdb.Breakpoint):
32 module = gdb.parse_and_eval("mod")
44 gdb.write("refreshing all symbols to reload module "
56 paddr_vmcoreinfo_note = gdb.parse_and_eval("*(unsigned long long *)" +
66 gdb.execute("symbol-file {0} -o {1}".format(
68 kaslr_offset = gdb.parse_and_eval("vm_layout.kaslr_offset")
70 inferior = gdb.selected_inferior()
74 return gdb.parse_and_eval("(char *)" + hex(desc_paddr)).string()
[all …]
H A 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 …]
H A Dmm.py9 import gdb
26 raise gdb.GdbError('Only support CONFIG_SPARSEMEM_VMEMMAP now')
32 raise gdb.GdbError('Only support aarch64 and x86_64 now')
41 self.PAGE_OFFSET = int(gdb.parse_and_eval("page_offset_base"))
42 self.VMEMMAP_START = int(gdb.parse_and_eval("vmemmap_base"))
43 self.PHYS_BASE = int(gdb.parse_and_eval("phys_base"))
46 self.KERNEL_START = gdb.parse_and_eval("_text")
47 self.KERNEL_END = gdb.parse_and_eval("_end")
49 self.VMALLOC_START = int(gdb.parse_and_eval("vmalloc_base"))
68 self.SECTIONS_PER_ROOT = self.PAGE_SIZE // gdb.lookup_type("struct mem_section").sizeof
[all …]
H A 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 …]
H A Dmodules.py14 import gdb
44 class LxModule(gdb.Function):
59 raise gdb.GdbError("Unable to find MODULE " + mod_name)
65 class LxLsmod(gdb.Command):
71 super(LxLsmod, self).__init__("lx-lsmod", gdb.COMMAND_DATA)
74 gdb.write(
86 gdb.write("{address} {name:<19} {size:>8} {ref}".format(
96 gdb.write("{separator}{name}".format(
101 gdb.write("\n")
108 gdb.write("Unrecognized command\n")
[all …]
H A 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['bus']['name'].string(), bus))
112 raise gdb.GdbError("Can't find bus {!r}".format(arg))
[all …]
H A 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 …]
H A 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")
H A 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'),
H A Drbtree.py5 import gdb
29 raise gdb.GdbError("Must be struct rb_root not {}".format(root.type))
45 raise gdb.GdbError("Must be struct rb_root not {}".format(root.type))
58 parent = gdb.Value(node['__rb_parent_color'] & ~3)
70 raise gdb.GdbError("Must be struct rb_node not {}".format(node.type))
93 raise gdb.GdbError("Must be struct rb_node not {}".format(node.type))
112 class LxRbFirst(gdb.Function):
124 raise gdb.GdbError("No entry in tree")
132 class LxRbLast(gdb.Function):
144 raise gdb.GdbError("No entry in tree")
[all …]
H A 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')
33 pob_symbol = gdb.lookup_global_symbol('page_offset_base')
35 return gdb.parse_and_eval(pob)
89 memoryview(gdb.selected_inferior().read_memory(address, 8)),
195 class TranslateVM(gdb.Command):
203 super(TranslateVM, self).__init__('translate-vm', gdb.COMMAND_USER)
[all …]
H A Dtasks.py14 import gdb
24 init_task = gdb.parse_and_eval("init_task").address
45 class LxTaskByPidFunc(gdb.Function):
59 raise gdb.GdbError("No task of PID " + str(pid))
65 class LxPs(gdb.Command):
69 super(LxPs, self).__init__("lx-ps", gdb.COMMAND_DATA)
72 gdb.write("{:>10} {:>12} {:>7}\n".format("TASK", "PID", "COMM"))
74 gdb.write("{} {:^5} {}\n".format(
94 class LxThreadInfoFunc (gdb.Function):
110 class LxThreadInfoByPidFunc (gdb.Function):
[all …]
H A Dinterrupts.py5 import gdb
18 return desc['action'] and desc['action'] == gdb.parse_and_eval("&chained_action")
26 desc = mapletree.mtree_load(gdb.parse_and_eval("&sparse_irqs"), 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 …]
H A Dtimerlist.py6 import gdb
23 tk_core = gdb.parse_and_eval("&tk_core")
68 jiffies = gdb.parse_and_eval("jiffies_64")
69 tick_sched_ptr = gdb.parse_and_eval("&tick_cpu_sched")
152 nr_cpu_ids = gdb.parse_and_eval("nr_cpu_ids")
154 inf = gdb.inferiors()[0]
179 class LxTimerList(gdb.Command):
183 super(LxTimerList, self).__init__("lx-timerlist", gdb.COMMAND_DATA)
186 hrtimer_bases = gdb.parse_and_eval("&hrtimer_bases")
187 max_clock_bases = gdb.parse_and_eval("HRTIMER_MAX_CLOCK_BASES")
[all …]
H A Dkasan.py9 import gdb
16 gdb.write("Unrecognized command\n")
17 raise gdb.GdbError(t)
19 class KasanMemToShadow(gdb.Command):
26 super(KasanMemToShadow, self).__init__("lx-kasan_mem_to_shadow", gdb.COMMAND_SUPPORT)
30 raise gdb.GdbError('CONFIG_KASAN_GENERIC or CONFIG_KASAN_SW_TAGS is not set')
32 argv = gdb.string_to_argv(args)
38 gdb.write('shadow addr: 0x%x\n' % shadow_addr)
H A Dradixtree.py12 import gdb
38 raise gdb.GdbError("must be {} not {}"
183 class LxRadixTreeLookup(gdb.Function):
195 raise gdb.GdbError("No entry in tree at index {}".format(index))
199 class LxRadixTree(gdb.Command):
203 super(LxRadixTree, self).__init__("lx-radix-tree", gdb.COMMAND_DATA,
204 gdb.COMPLETE_NONE)
207 args = gdb.string_to_argv(argument)
209 raise gdb.GdbError("Usage: lx-radix-tree ROOT")
210 root = gdb.parse_and_eval(args[0])
[all …]
/linux/Documentation/translations/zh_CN/dev-tools/
H A Dgdb-kernel-debugging.rst5 :Original: Documentation/process/debugging/gdb-kernel-debugging.rst
8 通过gdb调试内核和模块
11 Kgdb内核调试器、QEMU等虚拟机管理程序或基于JTAG的硬件接口,支持在运行时使用gdb
14 此教程基于QEMU/KVM虚拟机,但文中示例也适用于其他gdb stub。
20 - gdb 7.2+ (推荐版本: 7.4+) 且开启python支持 (通常发行版上都已支持)
37 - 构建gdb脚本(适用于内核v5.1版本及以上)
41 - 启用QEMU/KVM的gdb stub,可以通过如下方式实现
51 - 启动gdbgdb vmlinux
53 注意:某些发行版可能会将gdb脚本的自动加载限制在已知的安全目录中。
54 如果gdb报告拒绝加载vmlinux-gdb.py(相关命令找不到),请将::
[all …]
/linux/Documentation/translations/zh_TW/dev-tools/
H A Dgdb-kernel-debugging.rst5 :Original: Documentation/process/debugging/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/Documentation/process/debugging/
H A 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 …]

123