From 8e071466061bf3c088d843bc6f16bbdb45e5cc47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Wed, 31 Oct 2018 20:00:04 +0000 Subject: [PATCH] kgdb kdb is broken, do I care? --- README.adoc | 18 ++++++++++++------ run | 4 +--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.adoc b/README.adoc index c8e1916..7afc71b 100644 --- a/README.adoc +++ b/README.adoc @@ -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 <>. 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). diff --git a/run b/run index 76cad7b..95ea564 100755 --- a/run +++ b/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)) 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 = {}