[gdb/testsuite] Fix gdb.dwarf2/locexpr-data-member-location.exp with nopie
When running test-case gdb.dwarf2/locexpr-data-member-location.exp with
target board unix/-fno-PIE/-no-pie/-m32 I run into:
...
(gdb) step^M
26 return 0;^M
(gdb) FAIL: gdb.dwarf2/locexpr-data-member-location.exp: step into foo
...
The problem is that the test-case tries to mimic some gdb_compile_shlib
behaviour using:
...
set flags {additional_flags=-fpic debug}
get_func_info foo $flags
...
but this doesn't work with the target board setting, because we end up doing:
...
gcc locexpr-data-member-location-lib.c -fpic -g -lm -fno-PIE -no-pie -m32 \
-o func_addr23029.x
...
while gdb_compile_shlib properly filters out the -fno-PIE -no-pie.
Consequently, the address for foo determined by get_func_info doesn't match
the actual address of foo.
Fix this by printing the address of foo using the result of gdb_compile_shlib.