On powerpc64le-linux, I ran into:
...
FAIL: gdb.base/maint.exp: maint print objfiles: symtabs
...
The problem is that:
- the "Cooked index in use" line occurs twice in the gdb output:
- once for exec maint, and
- once for "Object file system-supplied DSO".
- the matching of the second "Cooked index in use" also consumes
the "Symtabs:" string, and consequently the corresponding
clause does not trigger and $symtabs remains 0.
Fix this by limiting the output of the command to the exec.
Tested on x86_64-linux and powerpcle-linux.
set psymtabs 0
set cooked_index 0
set symtabs 0
-gdb_test_multiple "maint print objfiles" "" -lbl {
+set cmd "maint print objfiles"
+set re "maint"
+gdb_test_multiple "$cmd $re" "$cmd" -lbl {
-re "\r\nObject file.*maint($EXEEXT)?: Objfile at ${hex}" {
set header 1
exp_continue