How to debug a kernel created using ubuntu-vm-builder?
Posted
by
user265592
on Super User
See other posts from Super User
or by user265592
Published on 2013-10-26T20:44:07Z
Indexed on
2013/10/26
22:01 UTC
Read the original article
Hit count: 329
Aim: Trying to perform a code walkthrough of what functions are getting called for sending and receiving packets over the network.
I am building a kernel and using gdb for debugging/ tracing purposes.
I have build a vm using the following command :
time sudo ubuntu-vm-builder qemu precise --arch 'amd64' --mem '1024' --rootsize '4096' --swapsize '1024' --kernel-flavour 'generic' --hostname 'ubuntu' --components 'main' --name 'Bob' --user 'ubuntu' --pass 'ubuntu' --bridge 'br0' --libvirt 'qemu:///system'
And I can run the VM successfully in qemu using the following command:
qemu-system-x86_64 -smp 1 -drive file=tmpGgEOzK.qcow2 "$@" -net nic -net user -serial stdio -redir tcp:2222::22
Now, I want to debug the kernel using gdb. For this I need an executable with debug symbols(vmlinux), which apparently I don't have, as the vm-builder never asked for any such options and simply created a .qcow2 file.
Question 1: Am I taking the correct approach to solve the problem and is there an easier way to do it?
Question 2: Is there a way to debug this kernel using GDB?
P.S: I don't have hardware support for KVM.
Please correct me if I am wrong.
Thanks.
© Super User or respective owner