mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
kgdb: actually, module debug just works with automatic lx-symbols? What happened?
This commit is contained in:
14
README.adoc
14
README.adoc
@@ -1925,18 +1925,16 @@ Main more generic question: https://stackoverflow.com/questions/14155577/how-to-
|
|||||||
|
|
||||||
=== KGDB kernel modules
|
=== KGDB kernel modules
|
||||||
|
|
||||||
In QEMU:
|
Just works as you would expect:
|
||||||
|
|
||||||
....
|
....
|
||||||
insmod /timer.ko
|
insmod /timer.ko
|
||||||
|
/kgdb.sh
|
||||||
....
|
....
|
||||||
|
|
||||||
Source: link:rootfs_overlay/kgdb-mod.sh[].
|
|
||||||
|
|
||||||
In GDB:
|
In GDB:
|
||||||
|
|
||||||
....
|
....
|
||||||
lx-symbols ../kernel_modules-1.0/
|
|
||||||
break lkmc_timer_callback
|
break lkmc_timer_callback
|
||||||
continue
|
continue
|
||||||
continue
|
continue
|
||||||
@@ -1945,8 +1943,6 @@ continue
|
|||||||
|
|
||||||
and you now control the count.
|
and you now control the count.
|
||||||
|
|
||||||
TODO: if I `-ex lx-symbols` to the `gdb` command, just like done for QEMU `-gdb`, the kernel <<oops,oops>>. How to automate this step?
|
|
||||||
|
|
||||||
=== KDB
|
=== KDB
|
||||||
|
|
||||||
KDB is a way to use KDB directly in your main console, without GDB.
|
KDB is a way to use KDB directly in your main console, without GDB.
|
||||||
@@ -1994,7 +1990,7 @@ You can get see further commands with:
|
|||||||
[0]kdb> help
|
[0]kdb> help
|
||||||
....
|
....
|
||||||
|
|
||||||
The other KDB commands allow you to instruction steps, view memory, registers and some higher level kernel runtime data.
|
The other KDB commands allow you to step instructions, view memory, registers and some higher level kernel runtime data similar to the superior GDB Python scripts.
|
||||||
|
|
||||||
==== KDB graphic
|
==== KDB graphic
|
||||||
|
|
||||||
@@ -2006,7 +2002,7 @@ You can also use KDB directly from the <<graphics,graphic>> window with:
|
|||||||
|
|
||||||
This setup could be used to debug the kernel on machines without serial, such as modern desktops.
|
This setup could be used to debug the kernel on machines without serial, such as modern desktops.
|
||||||
|
|
||||||
This works because `--graphics` This adds `kbd` (which stands for `KeyBoarD`!) to `kgdboc`.
|
This works because `--graphics` adds `kbd` (which stands for `KeyBoarD`!) to `kgdboc`.
|
||||||
|
|
||||||
==== KDB ARM
|
==== KDB ARM
|
||||||
|
|
||||||
@@ -2038,7 +2034,7 @@ el0_svc_handler+0x74/0x90
|
|||||||
el0_svc+0x8/0xc
|
el0_svc+0x8/0xc
|
||||||
....
|
....
|
||||||
|
|
||||||
My theory is that every serious ARM developer has either serial or JTAG, and no one ever tests this, and the kernel code is just broken.
|
My theory is that every serious ARM developer has JTAG, and no one ever tests this, and the kernel code is just broken.
|
||||||
|
|
||||||
== gdbserver
|
== gdbserver
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
insmod fops.ko
|
|
||||||
cd /sys/kernel/debug/lkmc_fops
|
|
||||||
i=0
|
|
||||||
while true; do
|
|
||||||
printf "$i" >f
|
|
||||||
i=$(($i+1))
|
|
||||||
done &
|
|
||||||
/kgdb.sh
|
|
||||||
Reference in New Issue
Block a user