It is extremely useful to be able to do kernel remote live debugging. After picking Oleg Drokin's mind, I documented the below instructions to give a very basic overview to get started:
- Create a KVM image
- Update the the KVM xml file:
- On Ubuntu host the "sudo virsh edit" approach didn't seem to update the VM's definition. The following approach work:
- Grab the vmlinux and unzip it
- place the vmlinux on y our guest OS
- Download and place the attached .gdbinit in your home directory
- Place the modules with debugging symbols on your host machine
- Starup the guest OS
- On the guest, Load the modules you wish to debug
- On the host, startup gdb with the vmlinux
- In GDB on the guest:
By this point the symbols for the module you wish to debug is loaded in GDB and GDB is attached to your guest OS.
- Add strategic breakpoints to enhance your debugging
- Invoke the scenario you wish to debug
- GDB will break at the desired break points, allowing you to debug as you normally would a user space program from gdb.