From a28e0fe5680cfc4f61d88cbe2c2b9f125f277686 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 19 Sep 2011 14:05:56 +0300 Subject: [PATCH] kvm tools: Document steps to debug kernel using KGDB Signed-off-by: Sasha Levin --- Documentation/kernel-debugging.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Documentation/kernel-debugging.txt diff --git a/Documentation/kernel-debugging.txt b/Documentation/kernel-debugging.txt new file mode 100644 index 0000000..7feeb30 --- /dev/null +++ b/Documentation/kernel-debugging.txt @@ -0,0 +1,15 @@ +This document explains how to debug a guests' kernel using KGDB. + +1. Run the guest: + 'kvm run -k [vmlinuz] -p "kgdboc=ttyS1 kgdbwait" --tty 1' + +And see which PTY got assigned to ttyS1 (you'll see: +' Info: Assigned terminal 1 to pty /dev/pts/X'). + +2. Run GDB on the host: + 'gdb [vmlinuz]' + +3. Connect to the guest (from within GDB): + 'target remote /dev/pty/X' + +4. Start debugging! (enter 'continue' to continue boot).