]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.dwarf2/dw2-error.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / dw2-error.exp
1 # Copyright 2012-2024 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16 load_lib dwarf.exp
17
18 # This test can only be run on targets which support DWARF-2 and use gas.
19 require dwarf2_support
20
21 standard_testfile .S
22
23 require is_x86_64_m64_target
24
25 # We can't use prepare_for_testing here because we need to check the
26 # 'file' command's output.
27 if {[build_executable $testfile.exp $testfile $srcfile {nodebug quiet}]} {
28 return -1
29 }
30
31 clean_restart
32
33 gdb_test_no_output "set breakpoint pending off"
34 gdb_test_no_output "maint set dwarf synchronous on"
35
36 set host_binfile [gdb_remote_download host $binfile]
37
38 # First test that reading symbols fails.
39 gdb_test "file $host_binfile" \
40 {Reading symbols.*Dwarf Error: wrong version in compilation unit header \(is 153, should be 2, 3, 4 or 5\).*} \
41 "file $testfile"
42
43 # We can't use proc readnow, because the PR makes it return 0.
44 gdb_test_multiple "maint print objfiles $host_binfile" "" {
45 -re "^maint print objfiles \[^\r\n\]*\r\n$gdb_prompt $" {
46 setup_kfail "gdb/26797" *-*-*
47 }
48 -re -wrap "" {
49 }
50 }
51
52 # Now check that we can still break given the minimal symbol.
53 gdb_test "break -q main" "Breakpoint $decimal.*"