From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2353 invoked by alias); 18 Feb 2002 23:32:19 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 2276 invoked from network); 18 Feb 2002 23:32:14 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 18 Feb 2002 23:32:14 -0000 Received: from makita.cygnus.com (makita.cygnus.com [205.180.230.78]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id PAA05348; Mon, 18 Feb 2002 15:32:12 -0800 (PST) Received: from localhost (keiths@localhost) by makita.cygnus.com (8.8.8+Sun/8.6.4) with ESMTP id PAA26828; Mon, 18 Feb 2002 15:32:11 -0800 (PST) X-Authentication-Warning: makita.cygnus.com: keiths owned process doing -bs Date: Mon, 18 Feb 2002 15:32:00 -0000 From: Keith Seitz X-X-Sender: To: Michael Elizabeth Chastain cc: Subject: Re: how to call gdb_test "" ... ? In-Reply-To: <200202182237.g1IMbH122114@duracef.shout.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-02/txt/msg00235.txt.bz2 On Mon, 18 Feb 2002, Michael Elizabeth Chastain wrote: > That is to say, I want to send a "list" command, and then send some > empty commands and look at the results as usual. > > gdb_test does not work with an argument of "". I'll go out on a limb here and say offer that gdb_test be modified: 1) To make it legible: proc gdb_test { args } { # snip set command [lindex $args 0] set pattern [lindex $args 1] # snip set result -1 set string "${command}\n" if { $command != "" } { while { "$string" != "" } { set foo [string first "\n" "$string"] set len [string length "$string"] if { $foo < [expr $len - 1] } { if [send_gdb "$str"] != "" } { #snip } # snip } set string [string range "$string" [expr $foo + 1] end } # snip Why is this done???? Why not just: proc gdb_test {command pattern args} { # snip set cmd "$command\n" foreach cmd [split $command \n] { if {$cmd != ""} { if {[send_gdb $cmd] != ""} { #snip } } # snip I don't know. Whomever wrote it did not understand tcl at all. 2) To allow empty commands, i.e., skip the send, do the expect Actually, I don't see from reading the code for gdb_test why "" would be disallowed. Is it giving you some sort of error? Ok, off my soapbox now. Keith