From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28806 invoked by alias); 29 Mar 2011 15:41:04 -0000 Received: (qmail 28791 invoked by uid 22791); 29 Mar 2011 15:41:02 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 Mar 2011 15:40:56 +0000 Received: from md2.u-strasbg.fr (md2.u-strasbg.fr [130.79.200.187]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id p2TFejmn029892 ; Tue, 29 Mar 2011 17:40:45 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms7.u-strasbg.fr [130.79.204.16]) by md2.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p2TFUgUj085279 ; Tue, 29 Mar 2011 17:30:42 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p2TFUfaA003970 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Tue, 29 Mar 2011 17:30:42 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Pedro Alves'" , Cc: "'Eli Zaretskii'" References: <004701cbede4$0ee18c20$2ca4a460$@muller@ics-cnrs.unistra.fr> <003001cbee11$49bb0880$dd311980$@muller@ics-cnrs.unistra.fr> <201103291523.46954.pedro@codesourcery.com> In-Reply-To: <201103291523.46954.pedro@codesourcery.com> Subject: [RFA] use gdb_usleep instead of sleep in remote-mips.c (was Missing sleep function for mingw hosts) Date: Tue, 29 Mar 2011 15:43:00 -0000 Message-ID: <005301cbee26$42bc8490$c8358db0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg01176.txt.bz2 > I have no clue why that `sleep' is necessary, but in any case, can't > we use already existing `gdb_usleep' function instead and be done > with it? Simply because I didn't know that gdb_usleep even existed... This makes things much easier indeed. Is the patch below OK? Pierre 2011-03-29 Pierre Muller Fix mingw compilation with --enable-targets=all. * remote-mips.c (gdb_usleep.h): Include header. (mips_enter_debug): Use gdb_usleep instead of sleep. Index: remote-mips.c =================================================================== RCS file: /cvs/src/src/gdb/remote-mips.c,v retrieving revision 1.120 diff -u -p -r1.120 remote-mips.c --- remote-mips.c 16 Mar 2011 17:59:02 -0000 1.120 +++ remote-mips.c 29 Mar 2011 14:52:12 -0000 @@ -33,6 +33,7 @@ #include "exceptions.h" #include "gdb_string.h" #include "gdb_stat.h" +#include "gdb_usleep.h" #include "regcache.h" #include #include "mips-tdep.h" @@ -1350,7 +1351,7 @@ mips_enter_debug (void) else /* Assume IDT monitor by default. */ mips_send_command ("db tty0\r", 0); - sleep (1); + gdb_usleep (1000000); serial_write (mips_desc, "\r", sizeof "\r" - 1); /* We don't need to absorb any spurious characters here, since the