diff options
Diffstat (limited to 'gdb/testsuite/gdb.ada/mi_var_access.exp')
-rw-r--r-- | gdb/testsuite/gdb.ada/mi_var_access.exp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.ada/mi_var_access.exp b/gdb/testsuite/gdb.ada/mi_var_access.exp index 15419bb..9bfaeff 100644 --- a/gdb/testsuite/gdb.ada/mi_var_access.exp +++ b/gdb/testsuite/gdb.ada/mi_var_access.exp @@ -1,4 +1,4 @@ -# Copyright 2020-2024 Free Software Foundation, Inc. +# Copyright 2020-2025 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -52,11 +52,18 @@ mi_continue_to_line \ "mi_access.adb:$bp_location" \ "stop at stop 2" +# A helper to quote some expected output, then arrange for the package +# component to be optional. +proc optional_quote {out} { + set out [string_to_regexp $out] + return [regsub -all "pck\\\\." $out "(pck\\.)?"] +} + # If the VAROBJ_UPDATE_RESULT.TYPE is true, the new_type and new_num_children # strings and values will be printed. This currently happens on PowerPC but # not X86-64. set re_default [string_to_regexp {^done,changelist=[{name="A_String_Access",in_scope="true",type_changed="false",has_more="0"}]}] -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"}]}] +set re_varobj_update_result_type [optional_quote {^done,changelist=[{name="A_String_Access",in_scope="true",type_changed="true",new_type="pck.string_access",new_num_children="1",has_more="0"}]}] mi_gdb_test "-var-update A_String_Access" \ "($re_default|$re_varobj_update_result_type)" \ "update at stop 2" @@ -71,5 +78,5 @@ mi_continue_to_line \ "stop at stop 3" mi_gdb_test "-var-update A_String_Access" \ - [string_to_regexp {^done,changelist=[{name="A_String_Access",in_scope="true",type_changed="true",new_type="pck.string_access",new_num_children="0",has_more="0"}]}] \ + [optional_quote {^done,changelist=[{name="A_String_Access",in_scope="true",type_changed="true",new_type="pck.string_access",new_num_children="0",has_more="0"}]}] \ "update at stop 3" |