From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6521 invoked by alias); 11 Nov 2008 01:27:22 -0000 Received: (qmail 6428 invoked by uid 22791); 11 Nov 2008 01:27:20 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 11 Nov 2008 01:26:43 +0000 Received: from spaceape11.eur.corp.google.com (spaceape11.eur.corp.google.com [172.28.16.145]) by smtp-out.google.com with ESMTP id mAB1QeTc000392 for ; Mon, 10 Nov 2008 17:26:41 -0800 Received: from el-out-1112.google.com (elez25.prod.google.com [10.126.177.25]) by spaceape11.eur.corp.google.com with ESMTP id mAB1QcH2019427 for ; Mon, 10 Nov 2008 17:26:39 -0800 Received: by el-out-1112.google.com with SMTP id z25so1304167ele.1 for ; Mon, 10 Nov 2008 17:26:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.90.53.5 with SMTP id b5mr6647017aga.74.1226366798376; Mon, 10 Nov 2008 17:26:38 -0800 (PST) In-Reply-To: <20081109164733.GA5112@adacore.com> References: <20081021190500.BB7251C7954@localhost> <200810271252.35628.pedro@codesourcery.com> <20081030030147.GB3635@adacore.com> <20081109164733.GA5112@adacore.com> Date: Tue, 11 Nov 2008 04:11:00 -0000 Message-ID: Subject: Re: [RFA] Move -nx from GDBFLAGS to INTERNAL_GDBFLAGS in testsuite From: Doug Evans To: "gdb-patches@sourceware.org" Content-Type: multipart/mixed; boundary=001636283b0a61ad4e045b5fc541 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00203.txt.bz2 --001636283b0a61ad4e045b5fc541 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 295 On Sun, Nov 9, 2008 at 8:47 AM, Joel Brobecker wrote: >> Any other comments? Can I check it in after moving -nw into >> INTERNAL_GDBCFLAGS? > > Yes. Just remember to post the patch that you eventually check in. > > Thank you, > -- > Joel Here's the patch I checked in. --001636283b0a61ad4e045b5fc541 Content-Type: text/plain; name="gdb-081110-gdbflags-1.patch.txt" Content-Disposition: attachment; filename="gdb-081110-gdbflags-1.patch.txt" Content-Transfer-Encoding: 7bit X-Attachment-Id: f_fndv343r0 Content-length: 10791 2008-11-10 Doug Evans * lib/gdb.exp (GDBFLAGS): Move -nx ... (INTERNAL_GDBFLAGS): ... to here. Move -nw to here as well. (default_gdb_version): Add $INTERNAL_GDBFLAGS to gdb invocations. (default_gdb_start,default_gdb_exit): Ditto. * lib/mi-support.exp (default_mi_gdb_start): Ditto. (mi_uncatched_gdb_exit): Add $INTERNAL_GDBFLAGS to log message. * gdb.base/corefile.exp: Add $INTERNAL_GDBFLAGS to gdb invocations. * gdb.base/dbx.exp (dbx_gdb_start): Ditto. * gdb.base/args.exp (GDBFLAGS): Don't overwrite, append. * gdb.base/remotetimeout.exp (GDBFLAGS): Ditto. Index: gdb.base/args.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/args.exp,v retrieving revision 1.16 diff -u -p -u -p -r1.16 args.exp --- gdb.base/args.exp 30 Oct 2008 10:07:16 -0000 1.16 +++ gdb.base/args.exp 11 Nov 2008 01:15:00 -0000 @@ -71,7 +71,8 @@ proc args_test { name arglist } { # Test that the --args are processed correctly. # set old_gdbflags $GDBFLAGS -set GDBFLAGS "-nx --args $binfile 1 3" + +set GDBFLAGS "$old_gdbflags --args $binfile 1 3" args_test basic {{1} {3}} # @@ -79,21 +80,21 @@ args_test basic {{1} {3}} # The syntax needed is a little peculiar; DejaGNU treats the arguments as a # list and expands them itself, since no shell redirection is involved. # -set GDBFLAGS "-nx --args $binfile 1 {} 3" +set GDBFLAGS "$old_gdbflags --args $binfile 1 {} 3" args_test "one empty" {{1} {} {3}} # # try with 2 empty args # -set GDBFLAGS "-nx --args $binfile 1 {} {} 3" +set GDBFLAGS "$old_gdbflags --args $binfile 1 {} {} 3" args_test "two empty" {{1} {} {} 3} # Try with arguments containing literal single quotes. -set GDBFLAGS "-nx --args $binfile 1 '' 3" +set GDBFLAGS "$old_gdbflags --args $binfile 1 '' 3" args_test "one empty (with single quotes)" {{1} {''} {3}} -set GDBFLAGS "-nx --args $binfile 1 '' '' 3" +set GDBFLAGS "$old_gdbflags --args $binfile 1 '' '' 3" args_test "two empty (with single quotes)" {{1} {''} {''} {3}} # try with arguments containing literal newlines. Index: gdb.base/corefile.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/corefile.exp,v retrieving revision 1.15 diff -u -p -u -p -r1.15 corefile.exp --- gdb.base/corefile.exp 6 Aug 2008 12:52:07 -0000 1.15 +++ gdb.base/corefile.exp 11 Nov 2008 01:15:01 -0000 @@ -105,10 +105,7 @@ if { $found == 0 } { # To do this, we must shutdown the currently running gdb and restart # with the -core args. We can't use gdb_start because it looks for # the first gdb prompt, and the message we are looking for occurs -# before the first prompt. Also, we can't include GDBFLAGS because -# if it is empty, this confuses gdb with an empty argument that it -# grumbles about (said grumbling currently being ignored in gdb_start). -# **FIXME** +# before the first prompt. # # Another problem is that on some systems (solaris for example), there # is apparently a limit on the length of a fully specified path to @@ -117,13 +114,13 @@ if { $found == 0 } { gdb_exit if $verbose>1 then { - send_user "Spawning $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile\n" + send_user "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS -core=$objdir/$subdir/corefile\n" } set oldtimeout $timeout set timeout [expr "$timeout + 60"] verbose "Timeout is now $timeout seconds" 2 -eval "spawn $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile" +eval "spawn $GDB $INTERNAL_GDBFLAGS $GDBFLAGS -core=$objdir/$subdir/corefile" expect { -re "Couldn't find .* registers in core file.*$gdb_prompt $" { fail "args: -core=corefile (couldn't find regs)" @@ -150,11 +147,11 @@ expect { close; if $verbose>1 then { - send_user "Spawning $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile\n" + send_user "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=$objdir/$subdir/corefile\n" } -eval "spawn $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile"; +eval "spawn $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=$objdir/$subdir/corefile"; expect { -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" { pass "args: execfile -core=corefile" Index: gdb.base/dbx.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/dbx.exp,v retrieving revision 1.12 diff -u -p -u -p -r1.12 dbx.exp --- gdb.base/dbx.exp 6 Aug 2008 12:52:07 -0000 1.12 +++ gdb.base/dbx.exp 11 Nov 2008 01:15:01 -0000 @@ -48,11 +48,11 @@ if { [gdb_compile "${binfile1}.o ${binf proc dbx_gdb_start { } { global verbose global GDB - global GDBFLAGS + global INTERNAL_GDBFLAGS GDBFLAGS global prompt global spawn_id global timeout - verbose "Spawning $GDB -nw $GDBFLAGS" + verbose "Spawning $GDB -dbx $INTERNAL_GDBFLAGS $GDBFLAGS" if { [which $GDB] == 0 } then { perror "$GDB does not exist." @@ -61,7 +61,7 @@ proc dbx_gdb_start { } { set oldtimeout $timeout set timeout [expr "$timeout + 60"] - eval "spawn $GDB -nw -dbx $GDBFLAGS" + eval "spawn $GDB -dbx $INTERNAL_GDBFLAGS $GDBFLAGS" gdb_expect { -re ".*\r\n$gdb_prompt $" { verbose "GDB initialized." Index: gdb.base/remotetimeout.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/remotetimeout.exp,v retrieving revision 1.4 diff -u -p -u -p -r1.4 remotetimeout.exp --- gdb.base/remotetimeout.exp 1 Jan 2008 22:53:19 -0000 1.4 +++ gdb.base/remotetimeout.exp 11 Nov 2008 01:15:01 -0000 @@ -34,7 +34,7 @@ if [target_info exists noargs] { # Test that -l is processed correctly. # set old_gdbflags $GDBFLAGS -set GDBFLAGS "-l 42" +set GDBFLAGS "$GDBFLAGS -l 42" gdb_exit gdb_start gdb_test "show remotetimeout" \ Index: lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.107 diff -u -p -u -p -r1.107 gdb.exp --- lib/gdb.exp 13 Sep 2008 17:54:06 -0000 1.107 +++ lib/gdb.exp 11 Nov 2008 01:15:01 -0000 @@ -42,12 +42,20 @@ if ![info exists GDB] { } verbose "using GDB = $GDB" 2 +# GDBFLAGS is available for the user to set on the command line. +# E.g. make check RUNTESTFLAGS=GDBFLAGS=mumble +# Testcases may use it to add additional flags, but they must: +# - append new flags, not overwrite +# - restore the original value when done global GDBFLAGS if ![info exists GDBFLAGS] { - set GDBFLAGS "-nx" + set GDBFLAGS "" } verbose "using GDBFLAGS = $GDBFLAGS" 2 +# INTERNAL_GDBFLAGS contains flags that the testsuite requires. +set INTERNAL_GDBFLAGS "-nw -nx" + # The variable gdb_prompt is a regexp which matches the gdb prompt. # Set it if it is not already set. global gdb_prompt @@ -94,22 +102,22 @@ set octal "\[0-7\]+" # proc default_gdb_version {} { global GDB - global GDBFLAGS + global INTERNAL_GDBFLAGS GDBFLAGS global gdb_prompt set fileid [open "gdb_cmd" w]; puts $fileid "q"; close $fileid; set cmdfile [remote_download host "gdb_cmd"]; - set output [remote_exec host "$GDB -nw --command $cmdfile"] + set output [remote_exec host "$GDB $INTERNAL_GDBFLAGS --command $cmdfile"] remote_file build delete "gdb_cmd"; remote_file host delete "$cmdfile"; set tmp [lindex $output 1]; set version "" regexp " \[0-9\]\[^ \t\n\r\]+" "$tmp" version if ![is_remote host] { - clone_output "[which $GDB] version $version $GDBFLAGS\n" + clone_output "[which $GDB] version $version $INTERNAL_GDBFLAGS $GDBFLAGS\n" } else { - clone_output "$GDB on remote host version $version $GDBFLAGS\n" + clone_output "$GDB on remote host version $version $INTERNAL_GDBFLAGS $GDBFLAGS\n" } } @@ -1010,7 +1018,7 @@ proc gdb_reinitialize_dir { subdir } { # proc default_gdb_exit {} { global GDB - global GDBFLAGS + global INTERNAL_GDBFLAGS GDBFLAGS global verbose global gdb_spawn_id; @@ -1020,7 +1028,7 @@ proc default_gdb_exit {} { return; } - verbose "Quitting $GDB $GDBFLAGS" + verbose "Quitting $GDB $INTERNAL_GDBFLAGS $GDBFLAGS" if { [is_remote host] && [board_info host exists fileid] } { send_gdb "quit\n"; @@ -1150,14 +1158,14 @@ proc gdb_file_cmd { arg } { proc default_gdb_start { } { global verbose global GDB - global GDBFLAGS + global INTERNAL_GDBFLAGS GDBFLAGS global gdb_prompt global timeout global gdb_spawn_id; gdb_stop_suppressing_tests; - verbose "Spawning $GDB -nw $GDBFLAGS" + verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS" if [info exists gdb_spawn_id] { return 0; @@ -1169,7 +1177,7 @@ proc default_gdb_start { } { exit 1 } } - set res [remote_spawn host "$GDB -nw $GDBFLAGS [host_info gdb_opts]"]; + set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]"]; if { $res < 0 || $res == "" } { perror "Spawning $GDB failed." return 1; Index: lib/mi-support.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v retrieving revision 1.75 diff -u -p -u -p -r1.75 mi-support.exp --- lib/mi-support.exp 23 Oct 2008 23:11:21 -0000 1.75 +++ lib/mi-support.exp 11 Nov 2008 01:15:01 -0000 @@ -39,7 +39,7 @@ proc mi_gdb_exit {} { proc mi_uncatched_gdb_exit {} { global GDB - global GDBFLAGS + global INTERNAL_GDBFLAGS GDBFLAGS global verbose global gdb_spawn_id; global gdb_prompt @@ -56,7 +56,7 @@ proc mi_uncatched_gdb_exit {} { return; } - verbose "Quitting $GDB $GDBFLAGS $MIFLAGS" + verbose "Quitting $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS" if { [is_remote host] && [board_info host exists fileid] } { send_gdb "999-gdb-exit\n"; @@ -94,7 +94,7 @@ proc mi_uncatched_gdb_exit {} { proc default_mi_gdb_start { args } { global verbose global GDB - global GDBFLAGS + global INTERNAL_GDBFLAGS GDBFLAGS global gdb_prompt global mi_gdb_prompt global timeout @@ -116,7 +116,7 @@ proc default_mi_gdb_start { args } { sid_start } - verbose "Spawning $GDB -nw $GDBFLAGS $MIFLAGS" + verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS" if [info exists gdb_spawn_id] { return 0; @@ -138,7 +138,7 @@ proc default_mi_gdb_start { args } { set mi_inferior_tty_name $spawn_out(slave,name) } - set res [remote_spawn host "$GDB -nw $GDBFLAGS $MIFLAGS [host_info gdb_opts]"]; + set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS [host_info gdb_opts]"]; if { $res < 0 || $res == "" } { perror "Spawning $GDB failed." return 1; --001636283b0a61ad4e045b5fc541--