From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13649 invoked by alias); 12 Jul 2002 18:03:52 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 13632 invoked from network); 12 Jul 2002 18:03:52 -0000 Received: from unknown (HELO conn.mc.mpls.visi.com) (208.42.156.2) by sources.redhat.com with SMTP; 12 Jul 2002 18:03:52 -0000 Received: from grante.comtrol.com (isis.visi.com [209.98.98.8]) by conn.mc.mpls.visi.com (Postfix) with SMTP id 5F36982AA for ; Fri, 12 Jul 2002 13:03:51 -0500 (CDT) Received: (qmail 9643 invoked by uid 500); 12 Jul 2002 18:07:39 -0000 Date: Fri, 12 Jul 2002 11:04:00 -0000 From: Grant Edwards To: gdb@sources.redhat.com Cc: gdb-patches@sources.redhat.com Subject: Re: RDI code busy-waiting on running target? Message-ID: <20020712130727.A7707@visi.com> References: <20020711175854.A29971@visi.com> <20020711184343.A4472@visi.com> <20020712102650.A6637@visi.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8t9RHnE3ZwKMSgU+" Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20020712102650.A6637@visi.com>; from grante@visi.com on Fri, Jul 12, 2002 at 10:26:53AM -0500 X-SW-Source: 2002-07/txt/msg00275.txt.bz2 --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 364 On Fri, Jul 12, 2002 at 10:26:53AM -0500, Grant Edwards wrote: > > I've noticed that gdb uses all the CPU it can get while the > > target is running (e.g. busy-waiting 'till target stops). > > Here's a patch that fixes it. Thanks to Dan Kegel for pointing out that an auto struct with initializer isn't kosher. One more try... -- Grant Edwards grante@visi.com --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Description: rdi-busy-wait.patch Content-Disposition: attachment; filename="rdi-busy-wait.patch" Content-length: 1254 diff -r -U8 gdb-5.2-orig/gdb/ChangeLog gdb-5.2/gdb/ChangeLog --- gdb-5.2-orig/gdb/ChangeLog Fri Apr 26 20:05:21 2002 +++ gdb-5.2/gdb/ChangeLog Fri Jul 12 10:22:38 2002 @@ -1,8 +1,13 @@ +2002-07-11 Grant Edwards + + * rdi-share/ardi.c: add 10ms sleep to busy-wait loop + when target is running. + 2002-04-26 GDB Administrator GDB 5.2 Released. * version.in: Update to version 5.2. 2002-04-26 Michal Ludvig * x86-64-tdep.c (x86_64_skip_prologue): Print note when debugging diff -r -U8 gdb-5.2-orig/gdb/rdi-share/ardi.c gdb-5.2/gdb/rdi-share/ardi.c --- gdb-5.2-orig/gdb/rdi-share/ardi.c Thu Oct 12 17:56:31 2000 +++ gdb-5.2/gdb/rdi-share/ardi.c Fri Jul 12 13:03:35 2002 @@ -1409,16 +1409,22 @@ #endif interrupt_request = FALSE; stop_request = FALSE; signal(SIGINT, ardi_sigint_handler); while( executing ) { + struct timeval timeout; + timeout.tv_sec = 0; + timeout.tv_usec = 10000; + + select(0,0,0,0,&timeout); + if (ui_loop_hook) ui_loop_hook(0); if (interrupt_request || stop_request) { interrupt_target(); interrupt_request = FALSE; stop_request = FALSE; --8t9RHnE3ZwKMSgU+--