Skip to content

Commit a2d9ce4

Browse files
committed
gdb.ada/mi_var_access.exp
The NUMCHILD value for the "A_String_Access" test differs for X86 and PowerPC. The patch substitutes $decimal instead of "1" to match the value of NUMCHILD. The test "-var-update A_String_Access" generates different output depending on the value of VAROBJ_UPDATE_RESULT.TYPE_CHANGED. If the value is true, the strings "new_type" and "new_num_children" are printed along with their values. The VAROBJ_UPDATE_RESULT.TYPE_CHANGED value is true on PowerPC which produces the output: Expecting: ^(-var-update A_String_Access[ ]+)?(\^done,changelist=\[\{name="A_String_Access",in_scope="true",type_changed="false",has_more="0"\}\][ ]+[(]gdb[)] [ ]*) -var-update A_String_Access ^done,changelist=[{name="A_String_Access",in_scope="true",type_changed="true",new_type="pck.string_access",new_num_children="1",has_more="0"}] (gdb) FAIL: gdb.ada/mi_var_access.exp: update at stop 2 (unexpected output) The patch adds a second possible result string for the test $re_varobj_update_result_type to match the case when type_changed is true. Currently for the mi_var_access.exp test VAROBJ_UPDATE_RESULT.TYPE_CHANGED is true on PowerPC and false on X86-64. Fixes 2 failures on PowerPC. Approved-By: Tom Tromey <[email protected]>
1 parent f8b12b8 commit a2d9ce4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

gdb/testsuite/gdb.ada/mi_var_access.exp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ mi_continue_to_line \
3838
"stop at start of mi_access"
3939

4040
# The bug was that creating a varobj for A_String_Access would crash.
41-
set re_ok "\\^done,name=\"A_String_Access\",numchild=\"1\",.*"
41+
# The value of NUMCHILD may vary on different systems. Use generic $decimal
42+
# to match possible values.
43+
set re_ok "\\^done,name=\"A_String_Access\",numchild=\"$decimal\",.*"
4244
set re_error "\\^error,msg=\"Value out of range\.\".*"
4345
mi_gdb_test "-var-create A_String_Access * A_String_Access" \
4446
"($re_ok|$re_error)" \
@@ -49,8 +51,13 @@ mi_continue_to_line \
4951
"mi_access.adb:$bp_location" \
5052
"stop at stop 2"
5153

54+
# If the VAROBJ_UPDATE_RESULT.TYPE is true, the new_type and new_num_children
55+
# strings and values will be printed. This currently happens on PowerPC but
56+
# not X86-64.
57+
set re_default [string_to_regexp {^done,changelist=[{name="A_String_Access",in_scope="true",type_changed="false",has_more="0"}]}]
58+
set re_varobj_update_result_type [string_to_regexp {^done,changelist=[{name="A_String_Access",in_scope="true",type_changed="true",new_type="pck.string_access",new_num_children="1",has_more="0"}]}]
5259
mi_gdb_test "-var-update A_String_Access" \
53-
[string_to_regexp {^done,changelist=[{name="A_String_Access",in_scope="true",type_changed="false",has_more="0"}]}] \
60+
"($re_default|$re_varobj_update_result_type)" \
5461
"update at stop 2"
5562

5663
mi_gdb_test "-var-list-children A_String_Access" \

0 commit comments

Comments
 (0)