From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26934 invoked by alias); 8 Apr 2003 22:44:29 -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 26917 invoked from network); 8 Apr 2003 22:44:29 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 8 Apr 2003 22:44:29 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h38MiTe20540 for ; Tue, 8 Apr 2003 18:44:29 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h38MiTJ14429 for ; Tue, 8 Apr 2003 18:44:29 -0400 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h38MiJm14890; Tue, 8 Apr 2003 18:44:20 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id A387C2C43F; Tue, 8 Apr 2003 18:48:37 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16019.20933.407808.340358@localhost.redhat.com> Date: Tue, 08 Apr 2003 22:44:00 -0000 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] gdb.base/args.exp: Invoke gdb_load for simulator targets In-Reply-To: <1030408222709.ZM13182@localhost.localdomain> References: <1030408222709.ZM13182@localhost.localdomain> X-SW-Source: 2003-04/txt/msg00143.txt.bz2 Kevin Buettner writes: > I'm testing gdb against a simulator and I'm seeing the following in > the gdb.log output: > > (gdb) run > Starting program: .../gdb/testsuite/gdb.base/args 1 3 > Don't know how to run. Try "help target". > (gdb) FAIL: gdb.base/args.exp: correct args printed > > My first inclination was to simply skip this test for simulator > targets, but I decided that there's no reason not to run it. I've > added a bit of code to invoke gdb_load for simulator targets and > wrapped it up in a proc so that it'll be easier to augment as other > targets are identified which can use a similar mechanism. > > Comments? (This is reasonably obvious, so I'll check this in a day or > so if there are no objections.) > Ah, thanks for fixing this Kevin. I remembered now that Michael Snyder complained about the same problem, and I forgot to go back and fix it. elena > * gdb.base/args.exp: Invoke gdb_load for simulator targets. > Modify regexps to match extra output after program exit in a > simulator. > > Index: gdb.base/args.exp > =================================================================== > RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/args.exp,v > retrieving revision 1.3 > diff -u -p -r1.3 args.exp > --- args.exp 2003/03/27 22:01:24 1.3 > +++ args.exp 2003/04/08 22:04:40 > @@ -31,6 +31,15 @@ if [target_info exists noargs] { > return; > } > > +# No loading needs to be done when the target is `exec'. Some targets > +# require that the program be loaded, however. > +proc args_load {} { > + global binfile > + if [target_info exists is_simulator] { > + gdb_load ${binfile} > + } > +} > + > set testfile "args" > set srcfile ${testfile}.c > set binfile ${objdir}/${subdir}/${testfile} > @@ -47,8 +56,9 @@ set GDBFLAGS "--args $binfile 1 3" > gdb_exit > gdb_start > gdb_reinitialize_dir $srcdir/$subdir > +args_load > gdb_test "run" \ > - "Starting program.*args(\\.exe)? 1 3.*3\r\n.*args\r\n1\r\n3.*Program exited normally." \ > + "Starting program.*args(\\.exe)? 1 3.*3\r\n.*args\r\n1\r\n3.*Program exited normally.*" \ > "correct args printed" > > # > @@ -58,8 +68,9 @@ set GDBFLAGS "--args $binfile 1 '' 3" > gdb_exit > gdb_start > gdb_reinitialize_dir $srcdir/$subdir > +args_load > gdb_test "run" \ > - "Starting program.*args(\\.exe)? 1 \\\\'\\\\' 3.*4\r\n.*args\r\n1\r\n''\r\n3.*Program exited normally." \ > + "Starting program.*args(\\.exe)? 1 \\\\'\\\\' 3.*4\r\n.*args\r\n1\r\n''\r\n3.*Program exited normally.*" \ > "correct args printed, one empty" > > # > @@ -69,8 +80,9 @@ set GDBFLAGS "--args $binfile 1 '' '' 3" > gdb_exit > gdb_start > gdb_reinitialize_dir $srcdir/$subdir > +args_load > gdb_test "run" \ > - "Starting program.*args(\\.exe)? 1 \\\\'\\\\' \\\\'\\\\' 3.*5\r\n.*args\r\n1\r\n''\r\n''\r\n3.*Program exited normally." \ > + "Starting program.*args(\\.exe)? 1 \\\\'\\\\' \\\\'\\\\' 3.*5\r\n.*args\r\n1\r\n''\r\n''\r\n3.*Program exited normally.*" \ > "correct args printed, two empty" > > set GDBFLAGS $old_gdbflags