[PATCH][gdb/testsuite] Use clean_restart where possible

Simon Marchi simark@simark.ca
Wed Nov 11 15:49:07 GMT 2020


On 2020-11-11 4:18 a.m., Tom de Vries wrote:
> [ was: Re: [PATCH][gdb/testsuite] Add
> gdb.dwarf2/fission-multi-cu-clang.exp ]
> On 11/10/20 8:21 PM, Simon Marchi wrote:
>>> +gdb_exit
>>> +gdb_start
>>> +gdb_reinitialize_dir $srcdir/$subdir
>>
>> clean_restart?
>
> Hmm yes, that's one of those things I just pick up by starting a
> test-case using a copy of another test-case.
>
> So, let's fix this in those other test-cases as well.
>
> FWIW, I'm open to suggestions to do this in an easier way than using awk.
>
> Thanks,
> - Tom
>

I don't know awk, so that looks very impressive to me!  I think it's a
good idea to fix them once and for all.

It would be worth grepping for gdb_reinitialize_dir, to catch more spots
that can be changed.  For example, in gdb.base/overlays.exp we have the
sequence without gdb_exit:

 49 gdb_start
 50 gdb_reinitialize_dir $srcdir/$subdir
 51 gdb_load ${binfile}

Those can also be changed with clean_restart.

Simon


More information about the Gdb-patches mailing list