On Fri, Aug 01, 2014 at 07:43:08AM -0700, Zetan Drableg wrote:> Ok now we are getting somewhere! Those old vars did the trick. > libguestfs-test-tool launched with qemu-wrapper as expected with the > debug port open. > Now on to the fun part! > > (gdb) set architecture i8086 > The target architecture is assumed to be i8086 > (gdb) break *0x7c00 > Breakpoint 1 at 0x7c00 > (gdb) target remote :1234 > Remote debugging using :1234 > 0x0000fff0 in ?? () > (gdb) cont > Continuing. > > The breakpoint you documented as when the boot sector has been loaded > into memory by the BIOS and control is passed to the boot sector. > Never hits the breakpoint..... > > Next steps? > > Do I need to load a symbol table? Where might I find it?This is getting very much to the edge of my experience, but yes, you probably do need to load the symbol table, and I know how. First install the kernel-debuginfo package that exactly corresponds to the kernel which is being run inside the guest. You can usually tell which kernel that is by looking at the output of supermin (it's usually the one which has the highest version number out of all of those "picked"). Then in the kernel-debuginfo package, find the 'vmlinux' file, eg: $ rpm -ql kernel-debuginfo | grep vmlinux /usr/lib/debug/lib/modules/3.14.4-200.fc20.x86_64/vmlinux Then you can get gdb to take the symbols from that file using the gdb command: (gdb) symbol-file /path/to/vmlinux Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Setup debuginfo repo /etc/yum.repos.d/debuginfo. repo [ol6_debuginfo] name=Oracle Linux 6 debuginfo baseurl=http://oss.oracle.com/ol6/debuginfo gpgkey=https://oss.oracle.com/ol6/RPM-GPG-KEY-oracle gpgcheck=1 enabled=1 yum update yum install kernel-debuginfo (gdb) set architecture i8086 The target architecture is assumed to be i8086 (gdb) symbol-file /usr/lib/debug/lib/modules/2.6.32-431.20.3.el6.x86_64/vmlinux Reading symbols from /usr/lib/debug/lib/modules/2.6.32-431.20.3.el6.x86_64/vmlinux...done. (gdb) target remote :1234 Remote debugging using :1234 0x0000fff0 in ?? () (gdb) break *0x7c00 Breakpoint 1 at 0x7c00 (gdb) cont Continuing. .... Didn't hit the breakpoint SeaBIOS (version seabios-0.6.1.2-28.el6) Probing EDD (edd=off to disable)... ok \x1b[2J QEMU: Terminated via GDBstub On Fri, Aug 1, 2014 at 7:59 AM, Richard W.M. Jones <rjones@redhat.com> wrote:> On Fri, Aug 01, 2014 at 07:43:08AM -0700, Zetan Drableg wrote: >> Ok now we are getting somewhere! Those old vars did the trick. >> libguestfs-test-tool launched with qemu-wrapper as expected with the >> debug port open. >> Now on to the fun part! >> >> (gdb) set architecture i8086 >> The target architecture is assumed to be i8086 >> (gdb) break *0x7c00 >> Breakpoint 1 at 0x7c00 >> (gdb) target remote :1234 >> Remote debugging using :1234 >> 0x0000fff0 in ?? () >> (gdb) cont >> Continuing. >> >> The breakpoint you documented as when the boot sector has been loaded >> into memory by the BIOS and control is passed to the boot sector. >> Never hits the breakpoint..... >> >> Next steps? >> >> Do I need to load a symbol table? Where might I find it? > > This is getting very much to the edge of my experience, but yes, you > probably do need to load the symbol table, and I know how. > > First install the kernel-debuginfo package that exactly corresponds to > the kernel which is being run inside the guest. You can usually tell > which kernel that is by looking at the output of supermin (it's > usually the one which has the highest version number out of all of > those "picked"). > > Then in the kernel-debuginfo package, find the 'vmlinux' file, eg: > > $ rpm -ql kernel-debuginfo | grep vmlinux > /usr/lib/debug/lib/modules/3.14.4-200.fc20.x86_64/vmlinux > > Then you can get gdb to take the symbols from that file using > the gdb command: > > (gdb) symbol-file /path/to/vmlinux > > Rich. > > -- > Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones > Read my programming and virtualization blog: http://rwmj.wordpress.com > virt-top is 'top' for virtual machines. Tiny program with many > powerful monitoring features, net stats, disk stats, logging, etc. > http://people.redhat.com/~rjones/virt-top
On Fri, Aug 01, 2014 at 03:14:17PM -0700, Zetan Drableg wrote:> Setup debuginfo repo > /etc/yum.repos.d/debuginfo. > repo > [ol6_debuginfo] > name=Oracle Linux 6 debuginfo > baseurl=http://oss.oracle.com/ol6/debuginfo > gpgkey=https://oss.oracle.com/ol6/RPM-GPG-KEY-oracle > gpgcheck=1 > enabled=1 > > yum update > yum install kernel-debuginfo > > (gdb) set architecture i8086 > The target architecture is assumed to be i8086 > (gdb) symbol-file /usr/lib/debug/lib/modules/2.6.32-431.20.3.el6.x86_64/vmlinux > Reading symbols from > /usr/lib/debug/lib/modules/2.6.32-431.20.3.el6.x86_64/vmlinux...done. > (gdb) target remote :1234 > Remote debugging using :1234 > 0x0000fff0 in ?? () > (gdb) break *0x7c00 > Breakpoint 1 at 0x7c00This might be the wrong breakpoint ...> (gdb) cont > Continuing. > .... > Didn't hit the breakpoint... but in any case you can hit ^C at some point to pause the guest and find out where the guest is stuck. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v