-# Copyright 2010 Free Software Foundation, Inc.
+# Copyright 2010-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
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+load_lib dwarf.exp
# Test some DWARF piece operators.
# This test can only be run on targets which support DWARF-2 and use gas.
-# For now pick a sampling of likely targets.
-if {![istarget *-*-linux*]
- && ![istarget *-*-gnu*]
- && ![istarget *-*-elf*]
- && ![istarget *-*-openbsd*]
- && ![istarget arm-*-eabi*]
- && ![istarget powerpc-*-eabi*]} {
+if {![dwarf2_support]} {
return 0
}
# This test can only be run on x86 targets.
-if {![istarget i?86-*]} {
+if {![is_x86_like_target]} {
return 0
}
-set testfile "pieces"
-set srcfile ${testfile}.S
+standard_testfile .S
set csrcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}.x
-if {[prepare_for_testing ${testfile}.exp ${testfile}.x $srcfile]} {
+if {[prepare_for_testing "failed to prepare" ${testfile} $srcfile]} {
return -1
}
gdb_continue_to_breakpoint "continue to f3 breakpoint for pieces"
gdb_test "print a.i" " = 4" "print a.i in pieces:f3"
gdb_test "print a.j" " = 14" "print a.j in pieces:f3"
- # Right now gdb says "value optimized out" here, but that is wrong.
- setup_kfail "no bug yet" *-*-*
gdb_test "print a.i = 7" " = 7" "set a.i in pieces:f3"
gdb_test "print a.i" " = 7" "print new a.i in pieces:f3"
}
"set f6 breakpoint for pieces"
gdb_continue_to_breakpoint "continue to f6 breakpoint for pieces"
gdb_test "print a" \
- "warning: bits .* in computed object were.* = {i = 7, j = 8, q = 0}" \
+ " = {i = 7, j = 8, q = .optimized out.}" \
"print a with optimized out piece"
# Note: no warning for this case.
gdb_test_multiple "print a.i" \