From: Jan Kiszka <jan.kiszka@siemens.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: Debugging vmlinux with qemu and gdb. Unable to step, next, print or to get any information..
Date: Thu, 08 May 2008 10:28:51 +0200 [thread overview]
Message-ID: <4822B9C3.4070808@siemens.com> (raw)
In-Reply-To: <824D057211107844BA95DB341B4BF12E01139BF2@hanvsmail04.eu.thmulti.com>
Keilhau Timo ( Student ) wrote:
> Hello List!
>
> I am trying to debug linux 2.6.25 kernel with qemu -s and gdb on 64 bit
> amd system.
> But I am experiencing strange behaviour with qemu and gdb..
> Gdb stops at a given breakpoint but I cant step, next, print etc..
>
> Software:
> Host OS used: opensuse 10.3
> Host kernelversion: 2.6.22.5-31-default
> guest: Debian Etch 4.0r3 amd64 with 2.6.25
> The kernel used to debug: linux-2.6.25.tar.bz2
> Virtualization Software: qemu pc emulator version 0.9.0
> Host make utillity GNU Make 3.81
> Host debugger: GNU gdb 6.6.50.20070726-cvs
> (Also tried gdb 6.6, gdb 6.8 compiled from source)
>
> Look here:
>
> // Starting qemu on host:
>
> $ qemu-system-x86_64 -s -kernel bzImage -hda
> qemu_mini_debian_root_fs.img -append "root=/dev/hda1" -initrd
> debian_boot/initrd.img-2.6.25-customtk-i -no-kqemu -redir
> tcp:10022:10.0.2.15:22
>
> // Boots fine.
> // vmlinux is compiled with CFLAGS=-g3 -ggdb, I have also tried only
> with -g
> // On host:
>
> $ nm vmlinux | grep sys_sendmsg
> ffffffff803e9ac5 T sys_sendmsg
>
>
> // Starting gdb on host and setting a breakpoint:
>
> $ gdb vmlinux
>
> GNU gdb 6.6.50.20070726-cvs
> Copyright (C) 2007 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for
> details.
> This GDB was configured as "x86_64-suse-linux"...
> Using host libthread_db library "/lib64/libthread_db.so.1".
> (gdb) l sys_sendmsg
> 1783 /*
> 1784 * BSD sendmsg interface
> 1785 */
> 1786
> 1787 asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg,
> unsigned flags)
> 1788 {
> 1789 struct compat_msghdr __user *msg_compat =
> 1790 (struct compat_msghdr __user *)msg;
> 1791 struct socket *sock;
> 1792 char address[MAX_SOCK_ADDR];
> (gdb) b 1787
> Breakpoint 1 at 0xffffffff803e9ac5: file net/socket.c, line 1787.
> (gdb)
>
> // Now connect to qemu's gdb-stub:
>
> (gdb) target remote :1234
> Remote debugging using :1234
> 0x0000000000000000 in ?? ()
> (gdb) c
> Continuing.
>
> // On guest launching a ping for example, to trigger the breakpoint:
>
> $ ping 212.76.144.43
>
> // On Host gdb stops, but it looks strange no address info etc is
> shown?!?!
>
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x0000000000000000 in ?? ()
Make sure gdb is assuming the right arch at this point (=> set arch
i386:x86-64). If you initially break into the guest when it is still in
real mode, gdb stays in i386 mode even if the guest's mode changes.
Jan
next prev parent reply other threads:[~2008-05-08 8:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-08 7:53 [Qemu-devel] Debugging vmlinux with qemu and gdb. Unable to step, next, print or to get any information Keilhau Timo ( Student )
2008-05-08 8:28 ` Jan Kiszka [this message]
2008-05-08 9:09 ` [Qemu-devel] " Keilhau Timo ( Student )
2008-05-08 18:39 ` Jan Kiszka
2008-05-09 2:31 ` [Qemu-devel] " Mulyadi Santosa
2008-05-09 4:39 ` Jason Wessel
2008-05-09 7:23 ` Mulyadi Santosa
2008-05-09 8:29 ` Jan Kiszka
2008-05-09 9:03 ` Keilhau Timo ( Student )
2008-05-09 10:03 ` Mulyadi Santosa
2008-05-09 8:38 ` Edgar E. Iglesias
2008-05-09 14:40 ` Daniel Jacobowitz
2008-05-09 14:47 ` Jason Wessel
2008-05-09 16:39 ` Daniel Jacobowitz
2008-05-12 9:41 ` Edgar E. Iglesias
2008-05-12 12:51 ` Jason Wessel
2008-05-12 13:30 ` Edgar E. Iglesias
2008-05-12 14:02 ` Edgar E. Iglesias
2008-05-12 14:31 ` Jason Wessel
2008-05-12 14:33 ` Paul Brook
2008-05-12 14:47 ` Edgar E. Iglesias
2008-05-12 14:48 ` Jason Wessel
2008-05-12 12:51 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4822B9C3.4070808@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.