Repository : ssh://git@diktynna/doc
On branches: backup-redmine/2021-08-07,backup-redmine/2021-09-11,backup-redmine/2021-10-09,backup-redmine/2021-11-13,backup-redmine/2021-12-11,backup-redmine/2022-01-08,backup-redmine/2022-02-12,backup-redmine/2022-03-12,backup-redmine/2022-04-09,backup-redmine/2022-05-07,backup-redmine/2022-06-11,backup-redmine/2022-08-06,backup-redmine/2022-10-07,backup-redmine/2022-11-14,backup-redmine/2023-01-14,main
commit d64b3ab0f474b65eb5268ab4ccec6751c7ea58c7 Author: Sven Eckelmann sven@narfation.org Date: Thu Jul 22 10:38:13 2021 +0000
doc: open-mesh/Kernel_debugging_with_qemu's_GDB_server
d64b3ab0f474b65eb5268ab4ccec6751c7ea58c7 .../Kernel_debugging_with_qemu's_GDB_server.textile | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/open-mesh/Kernel_debugging_with_qemu's_GDB_server.textile b/open-mesh/Kernel_debugging_with_qemu's_GDB_server.textile index e8a1e465..b5c773be 100644 --- a/open-mesh/Kernel_debugging_with_qemu's_GDB_server.textile +++ b/open-mesh/Kernel_debugging_with_qemu's_GDB_server.textile @@ -20,30 +20,15 @@ The module can now be loaded in the qemu instance as normal. But after that, we Thread 1 received signal SIGINT, Interrupt. default_idle () at arch/x86/kernel/process.c:581 581 trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id()); + + (gdb) lx-symbols /home/sven/tmp/qemu-batman/batman-adv/net/batman-adv/ loading vmlinux scanning for modules in /home/sven/tmp/qemu-batman/batman-adv/net/batman-adv/ scanning for modules in /home/sven/tmp/qemu-batman/linux-next loading @0xffffffffa0000000: /home/sven/tmp/qemu-batman/batman-adv/net/batman-adv//batman-adv.ko + (gdb) b batadv_iv_send_outstanding_bat_ogm_packet Breakpoint 1 at 0xffffffffa0005d60: file /home/sven/tmp/qemu-batman/batman-adv/net/batman-adv/bat_iv_ogm.c, line 1692. (gdb) c </pre> \ No newline at end of file - -h2. Python datastructure helper - -It is also possible to evaluate data structures in the gdb commandline using small python code blocks. To get for example the name of all devices which batman-adv knows about and the name of the batman-adv interface they belong to, just enter following in the initialized, interrupted gdb session: - -<pre> -python -import linux.lists -from linux.utils import CachedType - -struct_batadv_hard_iface = CachedType('struct batadv_hard_iface').get_type().pointer() - -for node in linux.lists.list_for_each_entry(gdb.parse_and_eval("batadv_hardif_list"), struct_batadv_hard_iface, 'list'): - hardif = node['net_dev']['name'].string() - softif = node['soft_iface']['name'].string() if node['soft_iface'] else "none" - gdb.write("hardif {} belongs to {}\n".format(hardif, softif)) -end -</pre> \ No newline at end of file