/openbmc/qemu/scripts/qemugdb/ |
H A D | coroutine.py | 12 import gdb 14 VOID_PTR = gdb.lookup_type('void').pointer() 20 old = gdb.parse_and_eval('*(uint64_t*)($rsp - 120)') 21 gdb.execute('call (int)arch_prctl(0x1003, $rsp - 120)', False, True) 22 fs_base = gdb.parse_and_eval('*(uint64_t*)($rsp - 120)') 23 gdb.execute('set *(uint64_t*)($rsp - 120) = %s' % old, False, True) 28 f = gdb.newest_frame() 42 return gdb.parse_and_eval('*(uint64_t*)((uint64_t)%s + 0x30)' % fs_base) 46 …return gdb.parse_and_eval('(((uint64_t)%s >> 0x11) | ((uint64_t)%s << (64 - 0x11))) ^ (uint64_t)%s… 75 selected_frame = gdb.selected_frame() [all …]
|
H A D | tcg.py | 15 import gdb 17 class TCGLockStatusCommand(gdb.Command): 20 gdb.Command.__init__(self, 'qemu tcg-lock-status', gdb.COMMAND_DATA, 21 gdb.COMPLETE_NONE) 24 gdb.write("Thread, BQL (iothread_mutex), Replay, Blocked?\n") 25 for thread in gdb.inferiors()[0].threads(): 28 iothread = gdb.parse_and_eval("iothread_locked") 29 replay = gdb.parse_and_eval("replay_locked") 31 frame = gdb.selected_frame() 34 mutex = gdb.parse_and_eval("mutex") [all …]
|
H A D | aio.py | 12 import gdb 16 return ptr == gdb.Value(0).cast(ptr.type) 22 sym_fd_coroutine_enter = gdb.parse_and_eval('fd_coroutine_enter') 26 gdb.write('----\n%s\n' % entry) 28 coptr = (cur['opaque'].cast(gdb.lookup_type('FDYieldUntilData').pointer()))['co'] 29 coptr = coptr.cast(gdb.lookup_type('CoroutineUContext').pointer()) 33 gdb.write('----\n') 35 class HandlersCommand(gdb.Command): 38 gdb.Command.__init__(self, 'qemu handlers', gdb.COMMAND_DATA, 39 gdb.COMPLETE_NONE) [all …]
|
H A D | mtree.py | 14 import gdb 17 return ptr == gdb.Value(0).cast(ptr.type) 25 if p.type.code == gdb.TYPE_CODE_STRUCT: 30 class MtreeCommand(gdb.Command): 33 gdb.Command.__init__(self, 'qemu mtree', gdb.COMMAND_DATA, 34 gdb.COMPLETE_NONE) 42 ptr = gdb.parse_and_eval(varname)['root'] 50 def print_item(self, ptr, offset = gdb.Value(0), level = 0): 63 gdb.write('%s%016x-%016x %s%s (@ %s)\n' 71 gdb.STDOUT) [all …]
|
/openbmc/linux/scripts/gdb/linux/ |
H A D | proc.py | 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): [all …]
|
H A D | page_owner.py | 9 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 D | cpus.py | 14 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 …]
|
H A D | vmalloc.py | 9 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 vmap_area_list = gdb.parse_and_eval('vmap_area_list') 35 … gdb.write("0x%x-0x%x %10d vm_map_ram\n" % (vmap_area['va_start'], vmap_area['va_end'], 39 gdb.write("0x%x-0x%x %10d" % (v['addr'], v['addr'] + v['size'], v['size'])) 41 gdb.write(" %s" % str(v['caller']).split(' ')[-1]) 43 gdb.write(" pages=%d" % v['nr_pages']) 45 gdb.write(" phys=0x%x" % v['phys_addr']) [all …]
|
H A D | symbols.py | 14 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 …]
|
H A D | slab.py | 9 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 D | utils.py | 14 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 …]
|
H A D | mm.py | 9 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 …]
|
H A D | lists.py | 14 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 D | stackdepot.py | 9 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') 31 …gdb.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 …]
|
H A D | modules.py | 14 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 …]
|
H A D | device.py | 5 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 D | clk.py | 5 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 …]
|
/openbmc/qemu/tests/tcg/multiarch/gdbstub/ |
H A D | catch-syscalls.py | 10 actual = gdb.parse_and_eval("catch_syscalls_state").string() 16 gdb.Breakpoint("main") 17 gdb.execute("continue") 20 gdb.execute("delete") 22 gdb.execute("catch syscall pipe2 read") 23 except gdb.error as exc: 30 gdb.execute("continue") 33 gdb.execute("continue") 37 gdb.execute("delete") 38 gdb.Breakpoint("end_of_main") [all …]
|
H A D | memory.py | 10 import gdb 17 start_pc = gdb.parse_and_eval('$pc') 18 gdb.execute("si") 19 end_pc = gdb.parse_and_eval('$pc') 32 sym, ok = gdb.lookup_symbol(sym_name) 33 bp = gdb.Breakpoint(sym_name, gdb.BP_BREAKPOINT) 35 gdb.execute("c") 38 end_pc = gdb.parse_and_eval('$pc') 47 wp = gdb.Breakpoint(sym, gdb.BP_WATCHPOINT, wtype) 48 gdb.execute("c") [all …]
|
H A D | sha1.py | 9 import gdb 18 sym, ok = gdb.lookup_symbol(sym_name) 19 bp = gdb.Breakpoint(sym_name) 21 gdb.execute("c") 24 end_pc = gdb.parse_and_eval('$pc') 39 gdb.execute("next") 40 gdb.execute("next") 41 val_ctx = gdb.parse_and_eval("context->state[0]") 45 gdb.execute("next") 46 val_ctx = gdb.parse_and_eval("context->state[1]") [all …]
|
H A D | follow-fork-mode-child.py | 10 gdb.execute("set follow-fork-mode child") 12 gdb.execute("break break_after_fork") 18 gdb.execute("catch syscall {}".format(fork_syscall)) 19 except gdb.error: 23 gdb.execute("continue") 29 gdb.execute("si") 31 gdb.execute("continue") 33 gdb.execute("continue") 35 gdb.execute("continue") 36 exitcode = int(gdb.parse_and_eval("$_exitcode"))
|
H A D | interrupt.py | 10 import gdb 22 gdb.execute("thr %d" % thread.num) 34 gdb.execute("set $pc = loop") 37 gdb.post_event(lambda: gdb.execute("interrupt")) 38 gdb.execute("c") 42 return (thread.num == gdb.selected_thread().num) 50 if len(gdb.selected_inferior().threads()) == 1: 54 gdb.execute("set scheduler-locking on") 55 for thread in gdb.selected_inferior().threads():
|
/openbmc/qemu/tests/tcg/s390x/gdbstub/ |
H A D | test-svc.py | 5 import gdb 11 report("lghi\t" in gdb.execute("x/i $pc", False, True), "insn #1") 12 gdb.execute("si") 13 report("larl\t" in gdb.execute("x/i $pc", False, True), "insn #2") 14 gdb.execute("si") 15 report("lgrl\t" in gdb.execute("x/i $pc", False, True), "insn #3") 16 gdb.execute("si") 17 report("svc\t" in gdb.execute("x/i $pc", False, True), "insn #4") 18 gdb.execute("si") 19 report("xgr\t" in gdb.execute("x/i $pc", False, True), "insn #5") [all …]
|
/openbmc/linux/Documentation/translations/zh_CN/dev-tools/ |
H A D | gdb-kernel-debugging.rst | 5 :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 - 启动gdb:gdb vmlinux 49 注意:某些发行版可能会将gdb脚本的自动加载限制在已知的安全目录中。 50 如果gdb报告拒绝加载vmlinux-gdb.py(相关命令找不到),请将:: 54 添加到~/.gdbinit。更多详细信息,请参阅gdb帮助信息。 [all …]
|
/openbmc/qemu/tests/tcg/aarch64/gdbstub/ |
H A D | test-sve-ioctl.py | 10 import gdb 16 class TestBreakpoint(gdb.Breakpoint): 22 val_i = gdb.parse_and_eval('i') 26 val_z = gdb.parse_and_eval("$z0.b.u[%d]" % i) 29 val_z = gdb.parse_and_eval("$z0.b.u[%d]" % i) 31 except gdb.error: 38 val_z = gdb.parse_and_eval("$z0.b.u[%d]" % i) 39 val_v = gdb.parse_and_eval("$v0.b.u[%d]" % i) 42 except gdb.error: 53 vg = gdb.parse_and_eval("$vg") [all …]
|