[gdb/testsuite] Fix various issues in gdb.mi/mi-sym-info.exp
I noticed this failure in gdb.mi/mi-sym-info.exp with gcc-4.8:
...
FAIL: gdb.mi/mi-sym-info.exp: -symbol-info-functions --max-results 1 \
(unexpected output)
...
due to function f2 instead of f3 being listed.
AFAICT, this is caused by a difference in debug info:
...
$ readelf -wi outputs/gdb.mi/mi-sym-info/mi-sym-info1.o \
| egrep "DW_AT_name.*: f[1-3]"
<72> DW_AT_name : f1
<a1> DW_AT_name : f2
<d0> DW_AT_name : f3
...
vs:
...
$ readelf -wi outputs/gdb.mi/mi-sym-info/mi-sym-info1.o \
| egrep "DW_AT_name.*: f[1-3]"
<f4> DW_AT_name : f3
<123> DW_AT_name : f2
<152> DW_AT_name : f1
...
and the command documentation does not mention an imposed order, so fix this
by allowing f2 as well.
Doing this fix, it made sense to do a refactoring of adding f2_re and f3_re
variables, in order to write (?:$f2_re|$f3_re), and I applied the same pattern
overall.
Furthermore, I found a silent FAIL due to calling mi_gdb_proc with 2 args, fix
by updating the regexp.
Then I ran with clang and found another FAIL, fix by updating the regexp.
Tested on x86_64-linux with gcc-4.8.5, gcc-7.5.0, gcc-11.2.1, clang-7.0.1 and
clang-12.0.1.