Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FqXBH-0005Pf-QG for qemu-devel@nongnu.org; Wed, 14 Jun 2006 11:21:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FqXBF-0005Nd-9Z for qemu-devel@nongnu.org; Wed, 14 Jun 2006 11:21:18 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FqXBF-0005Na-1n for qemu-devel@nongnu.org; Wed, 14 Jun 2006 11:21:17 -0400 Received: from [199.232.41.3] (helo=savannah.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FqXKR-0000ol-9F for qemu-devel@nongnu.org; Wed, 14 Jun 2006 11:30:47 -0400 Received: from savannah.gnu.org ([127.0.0.1]) by savannah.gnu.org with esmtp (Exim 3.36 #1 (Debian)) id 1FqXBD-0000HQ-00 for ; Wed, 14 Jun 2006 11:21:15 -0400 Received: from bellard by savannah.gnu.org with local (Exim 4.50) id 1FqXBD-0000HK-78 for qemu-devel@nongnu.org; Wed, 14 Jun 2006 15:21:15 +0000 Message-Id: From: Fabrice Bellard Date: Wed, 14 Jun 2006 15:21:15 +0000 Subject: [Qemu-devel] qemu configure gdbstub.c Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org CVSROOT: /sources/qemu Module name: qemu Changes by: Fabrice Bellard 06/06/14 15:21:15 Modified files: . : configure gdbstub.c Log message: gdb stub for win32 CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/configure?cvsroot=qemu&r1=1.104&r2=1.105 http://cvs.savannah.gnu.org/viewcvs/qemu/gdbstub.c?cvsroot=qemu&r1=1.36&r2=1.37 Patches: Index: configure =================================================================== RCS file: /sources/qemu/qemu/configure,v retrieving revision 1.104 retrieving revision 1.105 diff -u -b -r1.104 -r1.105 --- configure 14 Jun 2006 12:56:19 -0000 1.104 +++ configure 14 Jun 2006 15:21:14 -0000 1.105 @@ -312,7 +312,6 @@ if test "$mingw32" = "yes" ; then linux="no" EXESUF=".exe" - gdbstub="no" oss="no" if [ "$cpu" = "i386" ] ; then kqemu="yes" Index: gdbstub.c =================================================================== RCS file: /sources/qemu/qemu/gdbstub.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -b -r1.36 -r1.37 --- gdbstub.c 27 Apr 2006 21:05:14 -0000 1.36 +++ gdbstub.c 14 Jun 2006 15:21:14 -0000 1.37 @@ -30,10 +30,18 @@ #include "vl.h" #endif -#include -#include -#include +#include "qemu_socket.h" +#ifdef _WIN32 +/* XXX: these constants may be independent of the host ones even for Unix */ +#ifndef SIGTRAP +#define SIGTRAP 5 +#endif +#ifndef SIGINT +#define SIGINT 2 +#endif +#else #include +#endif //#define DEBUG_GDB @@ -69,7 +77,7 @@ int ret; for(;;) { - ret = read(s->fd, &ch, 1); + ret = recv(s->fd, &ch, 1, 0); if (ret < 0) { if (errno != EINTR && errno != EAGAIN) return -1; @@ -87,7 +95,7 @@ int ret; while (len > 0) { - ret = write(s->fd, buf, len); + ret = send(s->fd, buf, len, 0); if (ret < 0) { if (errno != EINTR && errno != EAGAIN) return; @@ -829,7 +837,7 @@ int i, size; uint8_t buf[4096]; - size = read(s->fd, buf, sizeof(buf)); + size = recv(s->fd, buf, sizeof(buf), 0); if (size < 0) return; if (size == 0) { @@ -866,7 +874,7 @@ /* set short latency */ val = 1; - setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val)); + setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&val, sizeof(val)); #ifdef CONFIG_USER_ONLY s = &gdbserver_state; @@ -881,9 +889,11 @@ s->env = first_cpu; /* XXX: allow to change CPU */ s->fd = fd; +#ifdef CONFIG_USER_ONLY fcntl(fd, F_SETFL, O_NONBLOCK); +#else + socket_set_nonblock(fd); -#ifndef CONFIG_USER_ONLY /* stop the VM */ vm_stop(EXCP_INTERRUPT); @@ -907,7 +917,7 @@ /* allow fast reuse */ val = 1; - setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); + setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&val, sizeof(val)); sockaddr.sin_family = AF_INET; sockaddr.sin_port = htons(port); @@ -923,7 +933,7 @@ return -1; } #ifndef CONFIG_USER_ONLY - fcntl(fd, F_SETFL, O_NONBLOCK); + socket_set_nonblock(fd); #endif return fd; }