[PP?] [PATCH] testsuite: Cleanup some temp dirs with gdb-index files

Simon Marchi simon.marchi@polymtl.ca
Fri May 14 15:23:32 GMT 2021



On 2021-05-14 11:03 a.m., Bernd Edlinger wrote:
> On 5/14/21 3:26 PM, Simon Marchi wrote:
>> On 2021-05-14 9:20 a.m., Bernd Edlinger wrote:
>>> Hi,
>>>
>>> I'd like to cleanup some files/directories which
>>> remain after the gdb testsute runs.
>>>
>>> I want to avoid using "rm -rf ..." since that can be dangerous.
>>> Therefore I remove the *.gdb-index files, if any, and use
>>> rmdir instead.  I am not sure if there is a better way,
>>> instead of using "remote_exec host sh -c" to do the globbing.
>>>
>>> Tested on x86_64-pc-linux-gnu.
>>> Is it OK for trunk?
>>>
>>>
>>> gdb/testsuite:
>>> 2021-05-14  Bernd Edlinger  <bernd.edlinger@hotmail.de>
>>>
>>>         * gdb.base/index-cache.exp: Cleanup $cache_dir/*.gdb-index and
>>>         remove the directory.
>>>         * gdb.dwarf2/per-bfd-sharing.exp: Likewise.
>>>
>>
>> LGTM, but I have one question: if the rm or rmdir ever fails (because
>> there are additional files to delete, for example), would we know about
>> it or would it silently fail?  I think it would be nice if the error
>> was noisy so we could fix it.
>>
> 
> Ah Yes, good point, that would be as silent as before.
> 
> So, how about this new version?

LGTM, but while at it let's check the return value of both commands.

Simon


More information about the Gdb-patches mailing list