[gdb/testsuite] Fix gdb.cp/nsalias.exp with -readnow
When running test-case gdb.cp/nsalias.exp with target board readnow, we get:
...
FAIL: gdb.cp/nsalias.exp: complaint for too many recursively imported \
declarations
...
The complaint is not detected, because:
- the complaint is triggered during the file command instead of during
"print N100::x"
- the "set complaints 1" is not effective because it's issued
after the file command
Fix the FAIL by setting the complaints limit earlier, and detecting the
complaint also during the file command.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2020-10-28 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (gdb_file_cmd): Set gdb_file_cmd_msg.
* gdb.cp/nsalias.exp: Set complaints limit before file cmd. Expect
complaint during file command for -readnow.