-# Copyright (C) 2009-2019 Free Software Foundation, Inc.
+# Copyright (C) 2009-2020 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
return -1
}
+# Skip all tests if Python scripting is not enabled.
+gdb_exit
+gdb_start
+if { [skip_python_tests] } { continue }
+
# Build inferior to language specification.
proc build_inferior {exefile lang} {
global srcdir subdir srcfile testfile hex
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${exefile}
- # Skip all tests if Python scripting is not enabled.
- if { [skip_python_tests] } { continue }
-
if ![runto_main] then {
perror "couldn't run to breakpoint"
return
proc test_pretty_arrays {} {
global current_lang
- set an_array_pretty " \\{2,\[\r\n\]+ 3,\[\r\n\]+ 5\\}"
+ set an_array_pretty "\\{\[\r\n\]+ 2,\[\r\n\]+ 3,\[\r\n\]+ 5\[\r\n\]+\\}"
set an_array_with_repetition_pretty \
- " \\{1,\[\r\n\]+ 3 <repeats 12 times>,\[\r\n\]+ 5,\[\r\n\]+ 5,\[\r\n\]+ 5\\}"
+ "\\{\[\r\n\]+ 1,\[\r\n\]+ 3 <repeats 12 times>,\[\r\n\]+ 5,\[\r\n\]+ 5,\[\r\n\]+ 5\[\r\n\]+\\}"
check_var_with_bool_opt "pretty_arrays" "a_point_t"
check_var_with_bool_opt "pretty_arrays" "a_point_t_pointer"
if { $current_lang == "c++" } {
check_var_with_bool_opt "deref_refs" "a_point_t_ref"
check_var_with_bool_opt "deref_refs" "a_base_ref" \
- "${default_ref_regexp}: \\{_vptr\\.Base = ${default_pointer_regexp} <vtable for Deriv\\+16>, a = 42, static a_static_member = 2019\\}"
+ "${default_ref_regexp}: \\{_vptr\[.\$\]Base = ${default_pointer_regexp} <vtable for Deriv\\+16>, a = 42, static a_static_member = 2019\\}"
}
}
check_format_string "an_array" \
"array_indexes=True, pretty_arrays=True" \
- " \\{\\\[0\\\] = 2,\[\r\n\]+ \\\[1\\\] = 3,\[\r\n\]+ \\\[2\\\] = 5\\}"
+ "\\{\[\r\n\]+ \\\[0\\\] = 2,\[\r\n\]+ \\\[1\\\] = 3,\[\r\n\]+ \\\[2\\\] = 5\[\r\n\]+\\}"
check_format_string "a_struct_with_union" \
"pretty_structs=True, unions=False" \
check_format_string "a_base_ref" \
"deref_refs=True, static_members=False" \
- "${default_ref_regexp}: \\{_vptr\\.Base = ${default_pointer_regexp} <vtable for Deriv\\+16>, a = 42\\}"
+ "${default_ref_regexp}: \\{_vptr\[.\$\]Base = ${default_pointer_regexp} <vtable for Deriv\\+16>, a = 42\\}"
}
}