info_exc.exp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Copyright 2013-2022 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. load_lib "ada.exp"
  16. if { [skip_ada_tests] } { return -1 }
  17. standard_ada_testfile foo
  18. if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
  19. return -1
  20. }
  21. clean_restart ${testfile}
  22. if ![runto_main] then {
  23. return 0
  24. }
  25. gdb_test "info exceptions" \
  26. [multi_line "All defined Ada exceptions:" \
  27. "constraint_error: $hex" \
  28. "program_error: $hex" \
  29. "storage_error: $hex" \
  30. "tasking_error: $hex" \
  31. ".*\[\r\n\]*const.aint_global_gdb_e: $hex\[\r\n\]*.*" ]
  32. gdb_test "info exceptions task" \
  33. [multi_line "All Ada exceptions matching regular expression \"task\":" \
  34. "tasking_error: $hex"]
  35. gdb_test "info exceptions global_gdb" \
  36. [multi_line "All Ada exceptions matching regular expression \"global_gdb\":" \
  37. "const.aint_global_gdb_e: $hex"]
  38. gdb_test "info exceptions const.aint" \
  39. [multi_line "All Ada exceptions matching regular expression \"const\\.aint\":" \
  40. "constraint_error: $hex" \
  41. "const.aint_global_gdb_e: $hex"]
  42. foreach cmd {exception handlers} {
  43. gdb_test "complete catch $cmd const.a" \
  44. "catch $cmd const.aint_global_gdb_e"
  45. }