qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] qemu user mode spins when stopped at a breakpoint


From: Dave Denholm
Subject: [Qemu-devel] qemu user mode spins when stopped at a breakpoint
Date: Wed, 25 Oct 2006 14:43:01 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.4 (gnu/linux)

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              <address@hidden>       http://www.esmertec.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]