[gdb/testsuite] Fix gdb.base/print-file-var.exp for remote target
authorTom de Vries <tdevries@suse.de>
Tue, 15 Nov 2022 14:24:54 +0000 (15:24 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 15 Nov 2022 14:24:54 +0000 (15:24 +0100)
commit4b4f2a7d2551ecb98dbb3fbfff3e3ba177916f78
tree3c280040f85919878ab0380806bb1c7236fe61d5
parent2a1742f31c21c852ebc105adc0dfb6b57570f552
[gdb/testsuite] Fix gdb.base/print-file-var.exp for remote target

When running test-case gdb.base/print-file-var.exp with target board
remote-gdbserver-on-localhost (using REMOTE_TARGET_USERNAME) we run into some
failures.

Fix these by using the name of a shared lib as returned by gdb_load_shlib.

This required splitting up the gdb_load_shlib functionality, which is now
defined as:
...
proc gdb_load_shlib { file } {
    set dest [gdb_download_shlib $file]
    gdb_locate_shlib $file
    return $dest
}
...
such that we can do gdb_download_shlib before gdb is started.

Tested on x86_64-linux.

Co-Authored-by: Ivan Tetyushkin <ivan.tetyushkin@syntacore.com>
gdb/testsuite/gdb.base/print-file-var.exp
gdb/testsuite/lib/gdb.exp