mi_ref_changeable.exp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Copyright 2018-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_rb20_056
  18. if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
  19. return -1
  20. }
  21. load_lib mi-support.exp
  22. set MIFLAGS "-i=mi"
  23. mi_clean_restart $binfile
  24. if {[mi_runto_main] < 0} {
  25. return 0
  26. }
  27. # Continue until STOP_1, and create a varobj for variables "A" and "B".
  28. set bp_location [gdb_get_line_number "STOP_1" ${testdir}/foo_rb20_056.adb]
  29. mi_continue_to_line \
  30. "foo_rb20_056.adb:$bp_location" \
  31. "stop at STOP_1"
  32. mi_gdb_test "-var-create a * a" \
  33. "\\^done,name=\"a\",numchild=\"19\",.*" \
  34. "create varobj for a"
  35. mi_gdb_test "-var-create b * b" \
  36. "\\^done,name=\"b\",numchild=\"19\",.*" \
  37. "create varobj for b"
  38. # Continue until STOP_2, and request an update of varobjs a and b.
  39. # One should reported as changed (b), and the other should report
  40. # no change.
  41. set bp_location [gdb_get_line_number "STOP_2" ${testdir}/foo_rb20_056.adb]
  42. mi_continue_to_line \
  43. "foo_rb20_056.adb:$bp_location" \
  44. "stop at STOP_2"
  45. mi_gdb_test "-var-update a" \
  46. "\\^done,changelist=\\\[\\\]" \
  47. "-var-update a at STOP_2"
  48. mi_gdb_test "-var-update b" \
  49. "\\^done,changelist=\\\[{name=\"b\".*}\\\]" \
  50. "-var-update b at STOP_2"