From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31202 invoked by alias); 5 Feb 2010 19:26:14 -0000 Received: (qmail 31193 invoked by uid 22791); 5 Feb 2010 19:26:13 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Feb 2010 19:26:09 +0000 Received: from wpaz17.hot.corp.google.com (wpaz17.hot.corp.google.com [172.24.198.81]) by smtp-out.google.com with ESMTP id o15JQ6VB027995 for ; Fri, 5 Feb 2010 11:26:06 -0800 Received: from wwc33 (wwc33.prod.google.com [10.241.241.161]) by wpaz17.hot.corp.google.com with ESMTP id o15JPYks012193 for ; Fri, 5 Feb 2010 11:26:05 -0800 Received: by wwc33 with SMTP id 33so697376wwc.26 for ; Fri, 05 Feb 2010 11:26:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.86.65 with SMTP id v43mr1744957wee.118.1265397965448; Fri, 05 Feb 2010 11:26:05 -0800 (PST) In-Reply-To: References: <20100204002516.DF79F84414@ruffy.mtv.corp.google.com> Date: Fri, 05 Feb 2010 19:26:00 -0000 Message-ID: Subject: Re: [patch] gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user. From: Doug Evans To: tromey@redhat.com, Eli Zaretskii Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true 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: 2010-02/txt/msg00173.txt.bz2 On Thu, Feb 4, 2010 at 7:49 AM, Tom Tromey wrote: >>>>>> "Doug" == Doug Evans writes: > > Doug> I will check this in tomorrow if there are no objections. > > I think it is fine, but it could use an addition to the testsuite > documentation in gdbint.texinfo. How about this? 2010-02-05 Doug Evans testsuite/ * lib/gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user. doc/ * gdbint.texinfo (Testsuite): Document INTERNAL_GDBFLAGS. Index: testsuite/lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.135 diff -u -p -r1.135 gdb.exp --- testsuite/lib/gdb.exp 14 Jan 2010 21:12:00 -0000 1.135 +++ testsuite/lib/gdb.exp 5 Feb 2010 19:19:39 -0000 @@ -54,7 +54,10 @@ if ![info exists GDBFLAGS] { verbose "using GDBFLAGS = $GDBFLAGS" 2 # INTERNAL_GDBFLAGS contains flags that the testsuite requires. -set INTERNAL_GDBFLAGS "-nw -nx" +global INTERNAL_GDBFLAGS +if ![info exists INTERNAL_GDBFLAGS] { + 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. Index: doc/gdbint.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v retrieving revision 1.317 diff -u -p -r1.317 gdbint.texinfo --- doc/gdbint.texinfo 5 Feb 2010 18:30:44 -0000 1.317 +++ doc/gdbint.texinfo 5 Feb 2010 19:19:40 -0000 @@ -7647,6 +7647,33 @@ different gdbserver. make check RUNTESTFLAGS="GDB=/usr/bin/gdb GDBSERVER=/usr/bin/gdbserver" @end smallexample +@item @code{INTERNAL_GDBFLAGS} + +When running the testsuite normally one doesn't want whatever is in +@file{~/.gdbinit} to interfere with the tests, therefore the test harness +passes @option{-nx} to @value{GDBN}. One also doesn't want any windowed +version of @value{GDBN}, e.g., @command{gdbtui}, to run. +This is achieved via @code{INTERNAL_GDBFLAGS}. + +@smallexample +set INTERNAL_GDBFLAGS "-nw -nx" +@end smallexample + +This is all well and good, except when testing an installed @value{GDBN} +that has been configured with @option{--with-system-gdbinit}. Here one +does not want @file{~/.gdbinit} loaded but one may want the system +@file{.gdbinit} file loaded. This can be achieved by pointing @code{$HOME} +at a directory without a @file{.gdbinit} and by overriding +@code{INTERNAL_GDBFLAGS} and removing @option{-nx}. + +@smallexample +cd testsuite +HOME=`pwd` runtest \ + GDB=/usr/bin/gdb \ + GDBSERVER=/usr/bin/gdbserver \ + INTERNAL_GDBFLAGS=-nw +@end smallexample + @end itemize There are two ways to run the testsuite and pass additional parameters