From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28606 invoked by alias); 30 Jul 2005 23:03:15 -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 28594 invoked by uid 22791); 30 Jul 2005 23:03:11 -0000 Received: from lakermmtao08.cox.net (HELO lakermmtao08.cox.net) (68.230.240.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 30 Jul 2005 23:03:11 +0000 Received: from white ([68.9.64.121]) by lakermmtao08.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050730230308.BXF23463.lakermmtao08.cox.net@white>; Sat, 30 Jul 2005 19:03:08 -0400 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1Dz0MH-0005tt-00; Sat, 30 Jul 2005 19:03:09 -0400 Date: Sat, 30 Jul 2005 23:03:00 -0000 From: Bob Rossi To: Nick Roberts Cc: gdb-patches@sources.redhat.com Subject: Re: MI testsuite to use PTY for inferior Message-ID: <20050730230309.GA22547@white> Mail-Followup-To: Nick Roberts , gdb-patches@sources.redhat.com References: <17131.5769.342629.658975@farnswood.snap.net.nz> <20050730173855.GA21401@white> <17131.64575.780190.163527@farnswood.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17131.64575.780190.163527@farnswood.snap.net.nz> User-Agent: Mutt/1.3.28i X-SW-Source: 2005-07/txt/msg00233.txt.bz2 On Sun, Jul 31, 2005 at 10:16:31AM +1200, Nick Roberts wrote: > Bob Rossi writes: > > > This seems to try to open a new pty even if inferior_pty is false. Shouldn't > > > the condition, here and elsewhere, be: > > > > > > if { $inferior_pty } { > > > > I think this could be a style issue, but I'm not sure. I only create the > > inferior_pty variable if mi_gdb_start's INFERIOR_PTY is true. Then I > > check in later calls to see if the variable inferior_pty exists via > > 'info exists inferior_pty'. > > Perhaps I've not understood the context but what if somenone uses: > > if {[mi_gdb_start false]} { > > as a condition for a test? Hi Nick, Now I see your point, sorry I didn't see it earlier. The code in mi_gdb_start, if { [llength $args] == 1} { set inferior_pty [lindex $args 0] } does not really do what I intended. Probably this would be closer. if { [llength $args] == 1} { if { [lindex $args 0] } { set inferior_pty true } } However, since that's pretty ugly, I'll take your suggestion and always create and assign inferior_pty a value. Then I'll check it for the value of "true" before executing any code. Thanks again, Bob Rossi