问题描述
最常用的是什么,为什么不是罕见的方法和工具用于在Linux内核上进行实时调试?我知道Linus为例。是邮件列表线程,他们讨论内核的优化)。
连接GDB和Qemu: target remote localhost:1234
在arch_idle()atarm / mach-realview / include / mach / system.h中,$ b#0 cpu_v7_do_idle()at arch / arm / mm / proc-v7.S:77
#1 0xc0029728:$ 36 $在arm / kernel / process.c中的#2 default_idle();在arch / arm / kernel / process中的cpu_idle()中的
#3 0xc00298a8 .c:199
#4 init_ main.c中的start_kernel()中的0xc00089c0:$ 13
不幸的是,用户空间调试到目前为止与GDB(没有任务列表信息,没有MMU重新编程看到不同的进程上下文,...),但如果你留在内核空间,这是非常方便的。
-
信息线程
会给你
编辑:
>您可以获取有关此PDF中的过程的更多详细信息:
What are the most common and why not uncommon methods and tools used to do live debugging on the Linux kernel? I know that Linus for eg. is against this kind of debugging for the Linux Kernel or it least was and thus nothing much has been done in that sense in those years, but honestly a lot of time has passed since 2000 and i am interested if that mentality has changed regarding the Linux project and what current methods are used to do live debugging on the Linux kernel at the moment(either local or remote)?
References to walkthroughs and tutorials on mentioned techniques and tools are welcome.
Another option is to use ICE/JTAG controler, and GDB. This 'hardware' solution is especially used with embedded systems,
but for instance Qemu offers similar features:
start qemu with a gdb 'remote' stub which listens on 'localhost:1234' :
qemu -s ...
,then with GDB you open the kernel file
vmlinux
compiled with debug informations (you can take a look a this mailing list thread where they discuss the unoptimization of the kernel).connect GDB and Qemu:
target remote localhost:1234
see you're live kernel:
(gdb) where #0 cpu_v7_do_idle () at arch/arm/mm/proc-v7.S:77 #1 0xc0029728 in arch_idle () atarm/mach-realview/include/mach/system.h:36 #2 default_idle () at arm/kernel/process.c:166 #3 0xc00298a8 in cpu_idle () at arch/arm/kernel/process.c:199 #4 0xc00089c0 in start_kernel () at init/main.c:713
unfortunately, user-space debugging is not possible so far with GDB (no task list information, no MMU reprogramming to see different process contexts, ...), but if you stay in kernel-space, that's quite conveniant.
info threads
will give you the list and states of the different CPUs
EDIT:
You can get more details about the procedure in this PDF:
这篇关于Linux内核实时调试,如何完成和使用什么工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!