Home
last modified time | relevance | path

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

12

/linux-6.1.9/scripts/gdb/linux/
Dproc.py14 import gdb
22 class LxCmdLine(gdb.Command):
27 super(LxCmdLine, self).__init__("lx-cmdline", gdb.COMMAND_DATA)
30 gdb.write(gdb.parse_and_eval("saved_command_line").string() + "\n")
36 class LxVersion(gdb.Command):
41 super(LxVersion, self).__init__("lx-version", gdb.COMMAND_DATA)
45 gdb.write(gdb.parse_and_eval("(char *)linux_banner").string())
68 resource = gdb.parse_and_eval(resource_str)
74 gdb.write(" " * depth * 2 +
80 class LxIOMem(gdb.Command):
[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 …]
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 …]
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)
45 element = gdb.Value(0).cast(typeobj)
54 class ContainerOf(gdb.Function):
65 return container_of(ptr, gdb.lookup_type(typename.string()).pointer(),
80 endian = gdb.execute("show endian", to_string=True)
[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 …]
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 …]
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" % (
44 gdb.write(" enable prepare protect \n")
45 gdb.write(" clock count count count rate \n")
46 gdb.write("------------------------------------------------------------------------\n")
47 for clk in clk_core_for_each_child(gdb.parse_and_eval("clk_root_list")):
49 for clk in clk_core_for_each_child(gdb.parse_and_eval("clk_orphan_list")):
56 class LxClkCoreLookup(gdb.Function):
[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 …]
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 …]
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)))
73 gdb.write('domain status children\n');
74 gdb.write(' /device runtime status\n');
75 gdb.write('----------------------------------------------------------------------\n');
77 gdb.parse_and_eval('&gpd_list'),
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(
77 gdb.write("{address} {name:<19} {size:>8} {ref}".format(
87 gdb.write("{separator}{name}".format(
92 gdb.write("\n")
Dtimerlist.py6 import gdb
23 tk_core = gdb.parse_and_eval("&tk_core")
71 jiffies = gdb.parse_and_eval("jiffies_64")
72 tick_sched_ptr = gdb.parse_and_eval("&tick_cpu_sched")
154 nr_cpu_ids = gdb.parse_and_eval("nr_cpu_ids")
156 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 …]
Ddmesg.py14 import gdb
26 class LxDmesg(gdb.Command):
30 super(LxDmesg, self).__init__("lx-dmesg", gdb.COMMAND_DATA)
33 inf = gdb.inferiors()[0]
36 prb_addr = int(str(gdb.parse_and_eval("(void *)'printk.c'::prb")).split()[0], 16)
145 gdb.write(msg)
Dconstants.py.in2 * gdb helper commands and functions for Linux kernel debugging
28 #define LX_GDBPARSED(x) LX_##x = gdb.parse_and_eval(XSTRING(x))
40 import gdb
/linux-6.1.9/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 …]
Dindex.rst28 gdb-kernel-debugging
/linux-6.1.9/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 - Enable the gdb stub of QEMU/KVM, either
53 - Start gdb: gdb vmlinux
55 Note: Some distros may restrict auto-loading of gdb scripts to known safe
56 directories. In case gdb reports to refuse loading vmlinux-gdb.py, add::
60 to ~/.gdbinit. See gdb help for more details.
64 (gdb) target remote :1234
[all …]
Dkgdb.rst26 kernel. It is used along with gdb to debug a Linux kernel. The
27 expectation is that gdb can be used to "break in" to the kernel to
29 similar to the way an application developer would use gdb to debug an
36 instance of gdb against the vmlinux file which contains the symbols (not
37 a boot image such as bzImage, zImage, uImage...). In gdb the developer
39 connection a developer makes with gdb depends on the availability of
59 file, gdb tends not to be very useful without the symbolic data, so you
67 or on the stack at different points which allows a debugger such as gdb to
111 used for anything in the gdb interface to kgdb. The ``CONFIG_KDB_KEYBOARD``
136 to communicate from gdb to kgdb as well as the devices you want to use
[all …]
/linux-6.1.9/Documentation/translations/zh_CN/admin-guide/
Dbug-hunting.rst104 通常来说使用 ``gdb`` 会比较容易,不过内核需要用调试信息来预编译。
106 gdb section in 找到缺陷位置
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-6.1.9/Documentation/translations/zh_TW/admin-guide/
Dbug-hunting.rst107 通常來說使用 ``gdb`` 會比較容易,不過內核需要用調試信息來預編譯。
109 gdb section in 找到缺陷位置
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 …]
DREADME.rst341 - 或者,您可以在正在運行的內核上使用gdb(只讀的;即不能更改值或設置斷點)。
345 使用新內核重新啓動後,執行 ``gdb vmlinux /proc/kcore`` 。現在可以使用所有
346 普通的gdb命令。查找系統崩潰點的命令是 ``l *0xXXXXXXXX`` (將xxx替換爲EIP
349gdb無法調試一個當前未運行的內核是由於gdb(錯誤地)忽略了編譯內核的起始
/linux-6.1.9/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 "
/linux-6.1.9/Documentation/admin-guide/
Dbug-hunting.rst106 ``gdb`` is easier, but the Kernel should be pre-compiled with debug info.
108 gdb section in Finding the bug's location
111 The GNU debugger (``gdb``) is the best way to figure out the exact file and line
114 The usage of gdb works best on a kernel compiled with ``CONFIG_DEBUG_INFO``.
126 $ gdb vmlinux
127 (gdb) l *0xc021e50e
138 $ gdb vmlinux
139 (gdb) l *vt_ioctl+0xda8
154 (gdb) p vt_ioctl
156 (gdb) l *0xae0+0xda8
[all …]
/linux-6.1.9/Documentation/bpf/
Ds390.rst51 gdb-multiarch \
116 Compiling kernel, modules and testsuite, as well as preparing gdb scripts to
176 It is preferable to turn KASLR off, so that gdb would know where to find the
183 gdb-multiarch -ex 'target remote localhost:1234' ./vmlinux

12