This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Avoid crash when calling warning too early
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Fri, 9 Nov 2018 19:41:36 +0000
- Subject: Re: [PATCH v2] Avoid crash when calling warning too early
- References: <20181031181820.24308-1-tom@tromey.com>
On 10/31/2018 06:18 PM, Tom Tromey wrote:
> +set save $INTERNAL_GDBFLAGS
> +set INTERNAL_GDBFLAGS "-nw -nx -data-directory $tname"
> +
> +gdb_start
> +
> +# Make sure gdb started up.
> +gdb_test "echo 23\\n" "23"
I guess this could also check that the warning was emitted?
> +
> +set INTERNAL_GDBFLAGS $save
FYI, you can use:
save_vars { INTERNAL_GDBFLAGS } {
set INTERNAL_GDBFLAGS "-nw -nx -data-directory $tname"
...
}
But, note that gdb/testsuite/README says this about
INTERNAL_GDBFLAGS:
~~~
The testsuite does not override a value provided by the user.
~~~
I think that the test should instead be replacing/sed'ing
the existing -data-directory option, instead of overriding
INTERNAL_GDBFLAGS completely.
That's what gdb.base/gdbinit-history.exp does.
Thanks,
Pedro Alves