dw2-error.exp 1.8 KB

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