/src/tools/interpreter/debugger/liberty_interpreter_debugger_steps.e

http://github.com/tybor/Liberty · Specman e · 89 lines · 63 code · 12 blank · 14 comment · 6 complexity · 1e2d97e8124b5a131a516eea70305297 MD5 · raw file

  1. -- This file is part of Liberty Eiffel.
  2. --
  3. -- Liberty Eiffel 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, version 3 of the License.
  6. --
  7. -- Liberty Eiffel 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 Liberty Eiffel. If not, see <http://www.gnu.org/licenses/>.
  14. --
  15. class LIBERTY_INTERPRETER_DEBUGGER_STEPS
  16. create {LIBERTY_INTERPRETER_DEBUGGER}
  17. make
  18. feature {LIBERTY_INTERPRETER}
  19. after (a_count: like count) is
  20. require
  21. a_count > 0
  22. do
  23. count := a_count
  24. ensure
  25. count = a_count
  26. end
  27. at_call_entry is
  28. do
  29. count := entry_count
  30. ensure
  31. count = entry_count
  32. end
  33. at_call_exit is
  34. do
  35. count := exit_count
  36. ensure
  37. count = exit_count
  38. end
  39. step is
  40. do
  41. if count > 0 then
  42. count := count - 1
  43. if count = 0 then
  44. interpreter.break
  45. end
  46. end
  47. end
  48. feature {LIBERTY_INTERPRETER_FEATURE_CALL}
  49. enter_call is
  50. do
  51. if count = entry_count then
  52. interpreter.break
  53. end
  54. end
  55. exit_call is
  56. do
  57. if count = exit_count then
  58. interpreter.break
  59. end
  60. end
  61. feature {}
  62. make (a_interpreter: like interpreter) is
  63. require
  64. a_interpreter /= Void
  65. do
  66. interpreter := a_interpreter
  67. ensure
  68. interpreter = a_interpreter
  69. end
  70. interpreter: LIBERTY_INTERPRETER
  71. count: INTEGER
  72. entry_count: INTEGER is -13
  73. exit_count: INTEGER is -31
  74. invariant
  75. interpreter /= Void
  76. count >= 0 or else count = entry_count or else count = exit_count
  77. end -- class LIBERTY_INTERPRETER_DEBUGGER_STEPS