1 # Copyright 2012-2024 Free Software Foundation, Inc.
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.
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.
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/>.
18 # This test can only be run on targets which support DWARF-2 and use gas.
19 require dwarf2_support
23 require is_x86_64_m64_target
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}]} {
33 gdb_test_no_output "set breakpoint pending off"
34 gdb_test_no_output "maint set dwarf synchronous on"
36 set host_binfile [gdb_remote_download host $binfile]
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\).*} \
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" *-*-*
52 # Now check that we can still break given the minimal symbol.
53 gdb_test "break -q main" "Breakpoint $decimal.*"