From: Jan Kiszka <jan.kiszka@siemens.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 00/17] kvm-userspace: Fix and improve guest debugging and x86 debug registers
Date: Tue, 18 Nov 2008 10:08:36 +0100 [thread overview]
Message-ID: <49228614.3020000@siemens.com> (raw)
In-Reply-To: <m31vxarmzj.fsf@crossbow.pond.sub.org>
Markus Armbruster wrote:
> Jan Kiszka <jan.kiszka@siemens.com> writes:
>
> [...]
>> To summarize the contributions of this series (+ its related kernel
>> bits):
>> - fully functional guest debugging via gdbstub,
>> including hardware breakpoints and watchpoints
>> (pick up current gdb cvs to have hbreak via remote gdb)
>> - (Almost) unlimited number of standard breakpoints
>> - SMP guest debugging support
>> - x86 debug registers support (makes guest's gdb and kgdb happy)
>>
>> The patches are in daily use for several moons here and have proven to
>> be very helpful for tricky kernel debugging task. Specifically,
>> reproducing and then tracking down certain races/deadlocks on SMP boxes
>> is far more comfortable with KVM than on "real metal".
>
> Sounds intriguing. Could you explain briefly what exactly you do to
> wire a debuffer to a guest, so dummies like me can give it a whirl?
It's fairly simple, at least for Linux guests: Compile and install a
guest kernel with CONFIG_DEBUG_INFO, then fire up qemu with '-s'. It
will tell you that it's now listening on TCP port 1234 for incoming
remote gdb connections. Next you can start gdb (or some frontend like
ddd) with the recently compiled 'vmlinux' and connect to qemu via
'tar[et] re[mote] :1234'. You are now able to do source-level debugging
with you guest kernel.
Some things you may want to play with:
o Switching between the guest VCPUs (use 'info threads' and
'thread <n>')
o Hardware breakpoints ('hbreak <symbol>'), useful if you don't want
kvm to insert INT3 in the guest code or if the target address is
currently not addressable
o Hardware watchpoints ('watch <expression>')
BTW, the recommended gdb version for full functionality is not yet
released AFAIK: it's post 6.8. Release 6.8 introduced hbreak/watch via
remote links and fixed thread selection for single-stepping, but had
problems here with reading vmlinux symbols.
Yesterday I posted a new version of the qemu bits in this series and I'm
now hoping for their inclusion. A rebase of the kvm part will soon be
set out as well, but if you stumble over problems with what is currently
available for kvm earlier, let me know, will then try to accelerate things.
Enjoy,
Jan
--
Siemens AG, Corporate Technology, CT SE 2 ES-OS
Corporate Competence Center Embedded Linux
prev parent reply other threads:[~2008-11-18 9:09 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-06 9:14 [PATCH 00/17] kvm-userspace: Fix and improve guest debugging and x86 debug registers Jan Kiszka
2008-10-06 9:14 ` [PATCH 01/17] kvm-userspace: Remove old guest debugging hooks Jan Kiszka
2008-10-06 9:14 ` [PATCH 02/17] qemu: Return appropriate watch message to gdb Jan Kiszka
2008-10-06 9:14 ` [PATCH 03/17] qemu: Refactor and enhance break/watchpoint API Jan Kiszka
2008-10-06 9:14 ` [PATCH 04/17] qemu: Set mem_io_vaddr on io_read Jan Kiszka
2008-10-06 9:14 ` [PATCH 05/17] qemu: Respect length of watchpoints Jan Kiszka
2008-10-07 12:04 ` Avi Kivity
2008-10-08 20:22 ` Jan Kiszka
2008-10-06 9:14 ` [PATCH 06/17] qemu: Introduce next_cflags Jan Kiszka
2008-10-07 12:07 ` Avi Kivity
2008-10-06 9:14 ` [PATCH 07/17] qemu: Switch self-modified code recompilation to next_cflags Jan Kiszka
2008-10-06 9:14 ` [PATCH 08/17] qemu: Restore pc on watchpoint hits - v3 Jan Kiszka
2008-10-06 9:14 ` [PATCH 09/17] qemu: Remove premature memop TB terminations Jan Kiszka
2008-10-06 9:14 ` [PATCH 10/17] qemu: Improve debugging of SMP guests Jan Kiszka
2008-10-07 12:12 ` Avi Kivity
2008-10-08 20:25 ` Jan Kiszka
2008-10-06 9:14 ` [PATCH 11/17] qemu: Introduce BP_WATCHPOINT_HIT flag Jan Kiszka
2008-10-06 9:14 ` [PATCH 12/17] qemu: Add debug exception hook Jan Kiszka
2008-10-06 9:14 ` [PATCH 13/17] qemu: Introduce BP_CPU as a breakpoint type Jan Kiszka
2008-10-06 9:14 ` [PATCH 14/17] qemu: x86: Debug register emulation Jan Kiszka
2008-10-07 12:15 ` Avi Kivity
2008-10-08 20:25 ` Jan Kiszka
2008-10-06 9:14 ` [PATCH 15/17] kvm-userspace: Switch to new guest debug interface Jan Kiszka
2008-10-06 9:14 ` [PATCH 16/17] kvm-userspace: Provide compat wrapper for set_debugreg Jan Kiszka
2008-10-07 12:17 ` Avi Kivity
2008-10-08 20:25 ` Jan Kiszka
2008-10-06 9:14 ` [PATCH 17/17] kvm-userspace: remove obsolete special_reload_dr7 hack Jan Kiszka
2008-10-07 12:18 ` [PATCH 00/17] kvm-userspace: Fix and improve guest debugging and x86 debug registers Avi Kivity
2008-10-07 12:20 ` Jan Kiszka
2008-11-17 22:44 ` Markus Armbruster
2008-11-18 9:08 ` Jan Kiszka [this message]
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=49228614.3020000@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=armbru@redhat.com \
--cc=kvm@vger.kernel.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).