From: Dave Denholm <ddenholm@esmertec.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] qemu user mode spins when stopped at a breakpoint
Date: Wed, 25 Oct 2006 14:43:01 +0100 [thread overview]
Message-ID: <kmiri8ik9m.fsf_-_@dalmore.esmertec.com> (raw)
In-Reply-To: <km1wowk3er.fsf@dalmore.esmertec.com> (Dave Denholm's message of "Wed, 25 Oct 2006 13:04:12 +0100")
Hi,
I've just noticed that if qemu is used in user mode, with a gdb
attached, and it stops at a breakpoint, qemu spins consuming 100% cpu.
Observed with both arm and mips (after applying the patch I sent
earlier).
The problem is in gdb_handlesig() in gdbstub.c - it uses a simple loop
to read blocks from the gdb connection, but the socket has been set in
non-blocking mode (around line 920 in gdb_accept), so this loop is an
active spin.
Simple fix is to put in a blocking call to poll() in the loop, either
each time round, or whenever read() returns EWOULDBLOCK. However,
it's not immediately clear to me why the socket needs to be set
non-blocking..?
I don't think user-mode currently allows gdb to interrupt the vm while
it's running. That presumably wouldn't be too hard to do - either
poll() the socket from the main loop (perhaps it's sufficient to check
on system calls only ?), or arrange for a SIGIO to be delivered when
data is recived on the socket.
dd
--
Dave Denholm <ddenholm@esmertec.com> http://www.esmertec.com
next prev parent reply other threads:[~2006-10-25 13:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-10 12:23 [Qemu-devel] qemu-mips on x86: stat() broken in 0.8.2 Dave Denholm
2006-10-25 12:04 ` [Qemu-devel] gdb support for qemu-mips (user mode) Dave Denholm
2006-10-25 13:43 ` Dave Denholm [this message]
2006-11-04 4:20 ` 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=kmiri8ik9m.fsf_-_@dalmore.esmertec.com \
--to=ddenholm@esmertec.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.