[PATCH] Make gdb.server/connect-with-no-symbol-file.exp more robust

Luis Machado lgustavo@codesourcery.com
Mon Apr 18 15:56:00 GMT 2016


On 04/18/2016 06:03 AM, Yao Qi wrote:
> Luis Machado <lgustavo@codesourcery.com> writes:
>
> Hi Luis,
>
>> Investigating further i noticed the test, as is,  may delete the original symbol
>> files, causing failures to occur.
>>
>> I went ahead and adjusted the test so it properly restores the state of the
>> files with every iteration and also moved the required commands to functions.
>>
>
> I think we shouldn't remove any generated files during the test, so that
> the fails can be manually reproduced.  Instead of deleting the file, can't
> we start gdb with files of different names?  Say, when $action is

The idea of the test is to start GDB with no symbol files. It will 
either try to load a symbol file that doesn't exist (because we deleted 
it on the host) or will get an error from GDBserver saying the file is 
not accessible

> "delete", we can just set binfile to
> connect-with-no-symbol-file-nonexist.  When $action is "permission",
> copy connect-with-no-symbol-file to
> connect-with-no-symbol-file-not_permitted, change its permission, and
> set binfile to it.  What do you think?

If the problem is making a copy of the files, wouldn't it be easier to 
do a backup of the file with tweaked permissions? We already have the 
original file backup that we use to restore state.

Tweaking the binfile may cause the test to be a little convoluted since 
we deal with real remote targets and localhost-remote targets. In the 
latter, manipulating the file on the target also manipulates the file on 
the host.



More information about the Gdb-patches mailing list