From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ayLpn-0006u4-9U for qemu-devel@nongnu.org; Thu, 05 May 2016 12:09:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ayLpb-0001SO-6f for qemu-devel@nongnu.org; Thu, 05 May 2016 12:08:57 -0400 Date: Thu, 5 May 2016 18:08:06 +0200 From: Peter Wu Message-ID: <20160505160806.GA1044@al> References: <1462316319-4308-1-git-send-email-peter@lekensteyn.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] gdbstub: avoid busy loop while waiting for gdb List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , QEMU Trivial On Thu, May 05, 2016 at 04:37:40PM +0100, Peter Maydell wrote: > On 3 May 2016 at 23:58, Peter Wu wrote: > > While waiting for a gdb response, or while sending an acknowledgement > > there is not much to do, so just mark the socket as non-blocking to > > avoid a busy loop while paused at gdb. This only affects the user-mode > > emulation (qemu-arm -g 1234 ./a.out). > > > > Note that this issue was reported before at > > https://lists.nongnu.org/archive/html/qemu-devel/2013-02/msg02277.html. > > > > While at it, close the gdb client fd on EOF or error while reading. > > The commit message says "mark the socket as non-blocking"... > > > @@ -1599,8 +1603,6 @@ static void gdb_accept(void) > > gdb_has_xml = false; > > > > gdbserver_state = s; > > - > > - fcntl(fd, F_SETFL, O_NONBLOCK); > > } > > ...but the code change is *removing* a call to mark the > socket as non-blocking. Which is correct? > > thanks > -- PMM The commit message is misleading, it should have been "so do not mark the socket as non-blocking". If you were to apply this, please fix it up :-) -- Kind regards, Peter Wu https://lekensteyn.nl