CVSROOT: /sources/qemu Module name: qemu Changes by: Fabrice Bellard <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 <sys/socket.h> -#include <netinet/in.h> -#include <netinet/tcp.h> +#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 <signal.h> +#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; } _______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel