* [patch] gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user.
@ 2010-02-04 0:25 Doug Evans
2010-02-04 0:38 ` Michael Snyder
2010-02-04 15:49 ` Tom Tromey
0 siblings, 2 replies; 6+ messages in thread
From: Doug Evans @ 2010-02-04 0:25 UTC (permalink / raw)
To: gdb-patches
Hi.
I will check this in tomorrow if there are no objections.
It is useful to run the testsuite on the installed gdb.
e.g. make check RUNTESTFLAGS=GDB=/usr/bin/gdb
When testing the installed gdb one would like to test exactly what the
user runs. For environments that have a system.gdbinit (gdb was configured
with --with-system-gdbinit) that means using the installed system.gdbinit
and not anything from the source/build tree.
In order to do this one either needs to not pass "-nx" when dejagnu starts gdb
or pass "-x /path/to/system.gdbinit" in addition to -nx.
I like the former as it's closer to what the user does.
There is also the issue of not loading ~/.gdbinit when running the
testsuite, but can be solved by pointing $HOME at a directory without
a .gdbinit when running the testsuite.
[-nx also skips loading of $pwd/.gdbinit, but the testsuite build directory
generally doesn't have one and that's good enough for me for now]
2010-02-03 Doug Evans <dje@google.com>
* gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user.
Index: gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.135
diff -u -p -r1.135 gdb.exp
--- gdb.exp 14 Jan 2010 21:12:00 -0000 1.135
+++ gdb.exp 4 Feb 2010 00:15:25 -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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user.
2010-02-04 0:25 [patch] gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user Doug Evans
@ 2010-02-04 0:38 ` Michael Snyder
2010-02-04 0:44 ` Doug Evans
2010-02-04 15:49 ` Tom Tromey
1 sibling, 1 reply; 6+ messages in thread
From: Michael Snyder @ 2010-02-04 0:38 UTC (permalink / raw)
To: Doug Evans, gdb-patches
Doug Evans wrote:
> Hi.
>
> I will check this in tomorrow if there are no objections.
How will this affect me?
> It is useful to run the testsuite on the installed gdb.
> e.g. make check RUNTESTFLAGS=GDB=/usr/bin/gdb
>
> When testing the installed gdb one would like to test exactly what the
> user runs. For environments that have a system.gdbinit (gdb was configured
> with --with-system-gdbinit) that means using the installed system.gdbinit
> and not anything from the source/build tree.
> In order to do this one either needs to not pass "-nx" when dejagnu starts gdb
> or pass "-x /path/to/system.gdbinit" in addition to -nx.
> I like the former as it's closer to what the user does.
>
> There is also the issue of not loading ~/.gdbinit when running the
> testsuite, but can be solved by pointing $HOME at a directory without
> a .gdbinit when running the testsuite.
>
> [-nx also skips loading of $pwd/.gdbinit, but the testsuite build directory
> generally doesn't have one and that's good enough for me for now]
>
> 2010-02-03 Doug Evans <dje@google.com>
>
> * gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user.
>
> Index: gdb.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
> retrieving revision 1.135
> diff -u -p -r1.135 gdb.exp
> --- gdb.exp 14 Jan 2010 21:12:00 -0000 1.135
> +++ gdb.exp 4 Feb 2010 00:15:25 -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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user.
2010-02-04 0:38 ` Michael Snyder
@ 2010-02-04 0:44 ` Doug Evans
0 siblings, 0 replies; 6+ messages in thread
From: Doug Evans @ 2010-02-04 0:44 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
On Wed, Feb 3, 2010 at 4:38 PM, Michael Snyder <msnyder@vmware.com> wrote:
> Doug Evans wrote:
>>
>> Hi.
>>
>> I will check this in tomorrow if there are no objections.
>
> How will this affect me?
Previously INTERNAL_GDBFLAGS was always set to "-nw -nx". With the
patch it is only set to that if it hasn't already been set (e.g. by
the user when starting dejagnu, e.g. with make check
RUNTESTFLAGS=INTERNAL_GDBFLAGS=mumble). I'd expect therefore that no
one is currently running dejagnu and setting INTERNAL_GDBFLAGS.
Therefore it shouldn't affect you.
>> It is useful to run the testsuite on the installed gdb.
>> e.g. make check RUNTESTFLAGS=GDB=/usr/bin/gdb
>>
>> When testing the installed gdb one would like to test exactly what the
>> user runs. For environments that have a system.gdbinit (gdb was
>> configured
>> with --with-system-gdbinit) that means using the installed system.gdbinit
>> and not anything from the source/build tree.
>> In order to do this one either needs to not pass "-nx" when dejagnu starts
>> gdb
>> or pass "-x /path/to/system.gdbinit" in addition to -nx.
>> I like the former as it's closer to what the user does.
>>
>> There is also the issue of not loading ~/.gdbinit when running the
>> testsuite, but can be solved by pointing $HOME at a directory without
>> a .gdbinit when running the testsuite.
>>
>> [-nx also skips loading of $pwd/.gdbinit, but the testsuite build
>> directory
>> generally doesn't have one and that's good enough for me for now]
>>
>> 2010-02-03 Doug Evans <dje@google.com>
>>
>> * gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by
>> user.
>>
>> Index: gdb.exp
>> ===================================================================
>> RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
>> retrieving revision 1.135
>> diff -u -p -r1.135 gdb.exp
>> --- gdb.exp 14 Jan 2010 21:12:00 -0000 1.135
>> +++ gdb.exp 4 Feb 2010 00:15:25 -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.
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user.
2010-02-04 0:25 [patch] gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user Doug Evans
2010-02-04 0:38 ` Michael Snyder
@ 2010-02-04 15:49 ` Tom Tromey
2010-02-05 19:26 ` Doug Evans
1 sibling, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2010-02-04 15:49 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
>>>>> "Doug" == Doug Evans <dje@google.com> 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.
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user.
2010-02-04 15:49 ` Tom Tromey
@ 2010-02-05 19:26 ` Doug Evans
2010-02-05 21:43 ` Eli Zaretskii
0 siblings, 1 reply; 6+ messages in thread
From: Doug Evans @ 2010-02-05 19:26 UTC (permalink / raw)
To: tromey, Eli Zaretskii; +Cc: gdb-patches
On Thu, Feb 4, 2010 at 7:49 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> 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 <dje@google.com>
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user.
2010-02-05 19:26 ` Doug Evans
@ 2010-02-05 21:43 ` Eli Zaretskii
0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2010-02-05 21:43 UTC (permalink / raw)
To: Doug Evans; +Cc: tromey, gdb-patches
> Date: Fri, 5 Feb 2010 11:26:05 -0800
> From: Doug Evans <dje@google.com>
> Cc: gdb-patches@sourceware.org
>
> On Thu, Feb 4, 2010 at 7:49 AM, Tom Tromey <tromey@redhat.com> wrote:
> >>>>>> "Doug" == Doug Evans <dje@google.com> 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?
Okay for the gdbinit.texinfo part.
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-02-05 21:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-04 0:25 [patch] gdb.exp (INTERNAL_GDBFLAGS): Don't override value provided by user Doug Evans
2010-02-04 0:38 ` Michael Snyder
2010-02-04 0:44 ` Doug Evans
2010-02-04 15:49 ` Tom Tromey
2010-02-05 19:26 ` Doug Evans
2010-02-05 21:43 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox