From: Jan Kiszka <jan.kiszka@web.de>
To: Hu Yaohui <loki2441@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Fwd: Guest VM debug (Int 3 panic)
Date: Thu, 26 Sep 2013 08:08:18 +0200 [thread overview]
Message-ID: <5243CF52.6020400@web.de> (raw)
In-Reply-To: <CAHqbYQsejuhNijpCy=dmY8xi9Uem8FDFgmNkzY3VQdhcQngYfw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1738 bytes --]
On 2013-09-25 20:08, Hu Yaohui wrote:
> Hi All,
> I am trying to debug guest OS through qemu with kvm enabled.
> Following is what I have done:
> 1: fire the qemu-kvm
> <snip>
> sudo qemu-system-x86_64 -hda vdisk.img -m 4096 -smp 2 -vnc :2 -boot c -s
> </snip>
>
> 2: wait until login into guest OS (ubuntu 10.04)
>
> 3: fire gdb
> <snip>
> gdb vmlinux
> target remote :1234
> b do_fork
> set arch i386:x86-64
"set arch" is unneeded. vmlinux already tells gdb that you are debugging
x86-64.
> c
> </snip>
>
> 4: after I typed "ls" in guest OS. The guest OS paniced with some message
> related to "int 3 blah blah". Then crashed.
>
> Someone said we should use hardware breakpoint when kvm is enabled, or
You can use hardware breakpoints as well but it is not required unless
the target code can be overwritten (e.g. due to a reset).
> "monitor system_reset" after set the breakpoint, but it didn't work for me.
> The hardware breakpoint could not been hit anyway.
>
> I have tried with "-no-kvm", it works normally with breakpoints. But I want
> to debug the guest OS with kvm enabled. I don't know whether someone has
> met this similar situation.
You didn't tell us which version of QEMU (or is it old qemu-kvm?) you
are using, what host kernel and which CPU type (AMD vs. Intel). Did you
try a recent version of all of them already? I'm currently not aware of
gdb problems with QEMU/KVM, I'm rather using it on an almost daily basis
(typically git head versions).
If you want to debug your issue: there is ftrace to record what KVM
events happen, and you can switch gdb into verbose mode as well,
comparing the communication between KVM on/off: set debug remote 1.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
next prev parent reply other threads:[~2013-09-26 6:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-25 17:55 [Qemu-devel] Guest VM debug (Int 3 panic) Hu Yaohui
2013-09-25 18:08 ` [Qemu-devel] Fwd: " Hu Yaohui
2013-09-26 6:08 ` Jan Kiszka [this message]
2013-09-26 14:14 ` Hu Yaohui
2013-09-26 17:26 ` Jan Kiszka
2013-09-26 18:53 ` Hu Yaohui
2013-09-26 19:07 ` Jan Kiszka
2013-09-26 19:20 ` Hu Yaohui
2013-09-26 21:51 ` Hu Yaohui
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=5243CF52.6020400@web.de \
--to=jan.kiszka@web.de \
--cc=loki2441@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).