mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
kgdb kdb is broken, do I care?
This commit is contained in:
18
README.adoc
18
README.adoc
@@ -1947,10 +1947,10 @@ In GDB:
|
|||||||
|
|
||||||
....
|
....
|
||||||
lx-symbols ../kernel_modules-1.0/
|
lx-symbols ../kernel_modules-1.0/
|
||||||
b fop_write
|
break fop_write
|
||||||
c
|
continue
|
||||||
c
|
continue
|
||||||
c
|
continue
|
||||||
....
|
....
|
||||||
|
|
||||||
and you now control the count.
|
and you now control the count.
|
||||||
@@ -1959,7 +1959,7 @@ TODO: if I `-ex lx-symbols` to the `gdb` command, just like done for QEMU `-gdb`
|
|||||||
|
|
||||||
=== KDB
|
=== KDB
|
||||||
|
|
||||||
If you modify `runqemu` to use:
|
If you modify `run` to use:
|
||||||
|
|
||||||
....
|
....
|
||||||
-append kgdboc=kbd
|
-append kgdboc=kbd
|
||||||
@@ -1967,7 +1967,11 @@ If you modify `runqemu` to use:
|
|||||||
|
|
||||||
instead of `kgdboc=ttyS0,115200`, you enter a different debugging mode called KDB.
|
instead of `kgdboc=ttyS0,115200`, you enter a different debugging mode called KDB.
|
||||||
|
|
||||||
Usage: in QEMU:
|
TODO is there any advantage of using KDB over GDB? Except for the fact that you need potentially less setup?
|
||||||
|
|
||||||
|
TODO: only works in <<graphic-mode>>. On the serial, prompt hangs, and the characters I type don't show up at all.
|
||||||
|
|
||||||
|
In QEMU:
|
||||||
|
|
||||||
....
|
....
|
||||||
[0]kdb> go
|
[0]kdb> go
|
||||||
@@ -1991,6 +1995,8 @@ And you are back in KDB. Now you can:
|
|||||||
|
|
||||||
And you will break whenever `__x64_sys_write` is hit.
|
And you will break whenever `__x64_sys_write` is hit.
|
||||||
|
|
||||||
|
TODO: `bp __x64_sys_write` is failing with `illegal numeric value` as of 10dd9178c6dccf1964002cc9368a5aa83b345487. I think it worked before.
|
||||||
|
|
||||||
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 instruction steps, view memory, registers and some higher level kernel runtime data.
|
||||||
|
|
||||||
But TODO I don't think you can see where you are in the kernel source code and line step as from GDB, since the kernel source is not available on guest (ah, if only debugging information supported full source).
|
But TODO I don't think you can see where you are in the kernel source code and line step as from GDB, since the kernel source is not available on guest (ah, if only debugging information supported full source).
|
||||||
|
|||||||
4
run
4
run
@@ -63,8 +63,6 @@ def main(args, extra_args=None):
|
|||||||
kernel_cli_after_dash += ' lkmc_eval_base64="{}"'.format(common.base64_encode(args.eval_busybox))
|
kernel_cli_after_dash += ' lkmc_eval_base64="{}"'.format(common.base64_encode(args.eval_busybox))
|
||||||
if args.kernel_cli_after_dash is not None:
|
if args.kernel_cli_after_dash is not None:
|
||||||
kernel_cli_after_dash += ' {}'.format(args.kernel_cli_after_dash)
|
kernel_cli_after_dash += ' {}'.format(args.kernel_cli_after_dash)
|
||||||
if args.kgdb:
|
|
||||||
kernel_cli += ' kgdbwait'
|
|
||||||
if args.vnc:
|
if args.vnc:
|
||||||
vnc = ['-vnc', ':0']
|
vnc = ['-vnc', ':0']
|
||||||
else:
|
else:
|
||||||
@@ -96,7 +94,7 @@ def main(args, extra_args=None):
|
|||||||
extra_console = '{}{}'.format(console_type, console_count)
|
extra_console = '{}{}'.format(console_type, console_count)
|
||||||
console_count += 1
|
console_count += 1
|
||||||
if args.kgdb:
|
if args.kgdb:
|
||||||
kernel_cli += ' kgdboc={},115200'.format(console)
|
kernel_cli += ' kgdbwait kgdboc={},115200'.format(console)
|
||||||
if kernel_cli_after_dash:
|
if kernel_cli_after_dash:
|
||||||
kernel_cli += " -{}".format(kernel_cli_after_dash)
|
kernel_cli += " -{}".format(kernel_cli_after_dash)
|
||||||
extra_env = {}
|
extra_env = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user