From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25937 invoked by alias); 11 Mar 2002 16:12:32 -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 25854 invoked from network); 11 Mar 2002 16:12:25 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 11 Mar 2002 16:12:25 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 16kSPR-0002xJ-00; Mon, 11 Mar 2002 11:12:25 -0500 Date: Mon, 11 Mar 2002 08:12:00 -0000 From: Daniel Jacobowitz To: Michal Ludvig Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] remote debugging patches Message-ID: <20020311111225.A11174@nevyn.them.org> Mail-Followup-To: Michal Ludvig , gdb-patches@sources.redhat.com References: <3C8BA71F.20807@suse.cz> <3C8BBEFC.5040504@cygnus.com> <3C8CC863.8030206@suse.cz> <20020311103650.A9182@nevyn.them.org> <3C8CD61B.8070704@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C8CD61B.8070704@suse.cz> User-Agent: Mutt/1.3.23i X-SW-Source: 2002-03/txt/msg00161.txt.bz2 On Mon, Mar 11, 2002 at 05:06:51PM +0100, Michal Ludvig wrote: > Daniel Jacobowitz wrote: > >But you had #define WAIT_FOREVER_FLAG 0. > > During the weekend I was debugging problems in communication between > gdb(i386) and gdbserver(x8664). Whenever I was stepping through > gdbserver, the other side timeouted. I've found, that last argument to > getpkt() is called 'forever', but in all calls was set to '0'. I didn't > want these timeouts, so I changed all occurences of 0 to > WAIT_FOREVER_FLAG, which could be set in compile-time. Most users and > developpers (unless they will work on remote.c or alike) will leave this > unchanged to 0, but sometimes it may be handy to set to 1 and recompile. > >I think what Andrew had in mind was more like > > > >enum { > > do_not_wait_forever = 0, > > wait_forever = 1 > >}; > > > >and change calls to > > getpkt (blah, do_not_wait_forever) > > I don't understand the point of this :-( Then I'd have to change all > occurences of do_not_wait_forever to wait_forever in the whole file to > change the behaviour? Isn't it much easier to change just one line on > top of the file from 'no' to 'yes' instead? Ah! This is why you should say clearly what you're trying to accomplish instead of just posting a patch :) The right thing to do here is more like: - Create the enum, as Andrew or I described it - Create the global variable, with a name that does not suggest its value, only its meaning. Something like ``getpkt_default_timeout_flag''. - Change all appropriate calls to use the variable. - Add ``set remote wait-forever on/off'' to update the variable. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer