[gdb/testsuite] Fix regexp in gdb.ada/mi_var_access.exp some more

When running test-case gdb.ada/mi_var_access.exp on arm-linux (debian trixie),
I run into:
...
Expecting: ^(-var-create A_String_Access \* A_String_Access[
]+)?((\^done,name="A_String_Access",numchild="[0-9]+",.*|\^error,msg="Value out of range.".*)[
]+[(]gdb[)]
[ ]*)
-var-create A_String_Access * A_String_Access
^error,msg="Cannot access memory at address 0x4"
(gdb)
FAIL: gdb.ada/mi_var_access.exp: Create varobj (unexpected output)
...

This is similar to the problem fixed by commit c5a72a8d1c ("[gdb/testsuite]
Fix regexp in gdb.ada/mi_var_access.exp").

The problem in both cases is that we're printing an uninitialized variable,
and consequently we can run into various error messages during printing.

Fix this as in the other commit, by accepting the error message.

Tested on arm-linux.
This commit is contained in:
Tom de Vries
2024-07-30 21:50:17 +02:00
parent 4f165e008d
commit 183bccfce1

View File

@@ -42,8 +42,9 @@ mi_continue_to_line \
# to match possible values.
set re_ok "\\^done,name=\"A_String_Access\",numchild=\"$decimal\",.*"
set re_error "\\^error,msg=\"Value out of range\.\".*"
set re_error2 "\\^error,msg=\"Cannot access memory at address $hex\""
mi_gdb_test "-var-create A_String_Access * A_String_Access" \
"($re_ok|$re_error)" \
"($re_ok|$re_error|$re_error2)" \
"Create varobj"
set bp_location [gdb_get_line_number "STOP2" ${testdir}/mi_access.adb]