kgdb kdb is broken, do I care?

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-10-31 20:00:04 +00:00
parent 10dd9178c6
commit 8e07146606
2 changed files with 13 additions and 9 deletions

View File

@@ -1947,10 +1947,10 @@ In GDB:
....
lx-symbols ../kernel_modules-1.0/
b fop_write
c
c
c
break fop_write
continue
continue
continue
....
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
If you modify `runqemu` to use:
If you modify `run` to use:
....
-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.
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
@@ -1991,6 +1995,8 @@ And you are back in KDB. Now you can:
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.
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
View File

@@ -63,8 +63,6 @@ def main(args, extra_args=None):
kernel_cli_after_dash += ' lkmc_eval_base64="{}"'.format(common.base64_encode(args.eval_busybox))
if args.kernel_cli_after_dash is not None:
kernel_cli_after_dash += ' {}'.format(args.kernel_cli_after_dash)
if args.kgdb:
kernel_cli += ' kgdbwait'
if args.vnc:
vnc = ['-vnc', ':0']
else:
@@ -96,7 +94,7 @@ def main(args, extra_args=None):
extra_console = '{}{}'.format(console_type, console_count)
console_count += 1
if args.kgdb:
kernel_cli += ' kgdboc={},115200'.format(console)
kernel_cli += ' kgdbwait kgdboc={},115200'.format(console)
if kernel_cli_after_dash:
kernel_cli += " -{}".format(kernel_cli_after_dash)
extra_env = {}