1
;;;; (ice-9 debugger state) -- debugger state representation
3
;;; Copyright (C) 2002, 2006 Free Software Foundation, Inc.
5
;; This library is free software; you can redistribute it and/or
6
;; modify it under the terms of the GNU Lesser General Public
7
;; License as published by the Free Software Foundation; either
8
;; version 2.1 of the License, or (at your option) any later version.
10
;; This library is distributed in the hope that it will be useful,
11
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
;; Lesser General Public License for more details.
15
;; You should have received a copy of the GNU Lesser General Public
16
;; License along with this library; if not, write to the Free Software
17
;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
(define-module (ice-9 debugger state)
26
(define state-rtd (make-record-type "debugger-state" '(stack index flags)))
27
(define state? (record-predicate state-rtd))
29
(let ((make-state-internal (record-constructor state-rtd
30
'(stack index flags))))
31
(lambda (stack index . flags)
32
(make-state-internal stack index flags))))
33
(define state-stack (record-accessor state-rtd 'stack))
34
(define state-index (record-accessor state-rtd 'index))
35
(define state-flags (record-accessor state-rtd 'flags))
37
(define set-state-index! (record-modifier state-rtd 'index))
39
(define (set-stack-index! state index)
40
(let* ((stack (state-stack state))
41
(ssize (stack-length stack)))
42
(set-state-index! state
44
((>= index ssize) (- ssize 1))
47
;;; (ice-9 debugger state) ends here.