71 lines
4.2 KiB
Scheme
71 lines
4.2 KiB
Scheme
(module mztake-structs mzscheme
|
|
(require (prefix frp: (lib "frp.ss" "frtime"))
|
|
(lib "more-useful-code.ss" "mztake" "private"))
|
|
|
|
(provide (all-defined-except loc make-loc)
|
|
(rename loc loc$)
|
|
(rename make-loc loc))
|
|
|
|
; ;;;;; ; ;
|
|
; ; ; ; ;
|
|
; ; ; ;
|
|
; ; ;;;;;; ;;; ; ; ;;; ;;;;; ;;;;
|
|
; ; ; ;; ; ; ; ; ; ; ;
|
|
; ;;; ; ; ; ; ; ; ;
|
|
; ;;; ; ; ; ; ; ; ;
|
|
; ; ; ; ; ; ; ; ;;;;
|
|
; ; ; ; ; ; ; ; ;
|
|
; ; ; ; ; ; ; ; ;
|
|
; ; ; ; ; ; ;; ; ; ; ; ;
|
|
; ;;;;; ;;;; ;;;; ; ;;; ;;; ;;;;
|
|
|
|
(define-struct trace-struct (evnt-rcvr thunk)) ; frp:event-receiver
|
|
|
|
(define-struct debug-client (modpath ; complete-path of the module
|
|
tracepoints ; hash-table of traces
|
|
line-col->pos ; memoized O(n) function to map line/col -> byte offset
|
|
process)) ; parent debug-process
|
|
|
|
(define-struct debug-process (custodian ; If you shutdown-all it will kill the debugger process
|
|
run-semaphore ; When you post to this the debuggee will continue executing
|
|
running-e ; Is the program (supposed-to-be) currently running
|
|
run-manager ; saves behavior that actually pauses/resumes from GC
|
|
pause-requested?
|
|
resume-requested?
|
|
|
|
exited? ; FrTime cell receives #t when the target exits
|
|
exceptions ; (an event stream) Exceptions thrown during the evaluation of the target
|
|
main-client ; the main client module that will be run
|
|
clients ; list of all the clients attached to this process
|
|
|
|
where ; a behavior signaling each position where we pause
|
|
marks)) ; while paused, the marks at the point of the pause (else false)
|
|
|
|
(define-struct loc (modpath line col))
|
|
|
|
;###########################################################################################################
|
|
|
|
|
|
|
|
|
|
; ;;;;; ; ; ;;;;; ;
|
|
; ; ; ; ; ;; ; ;
|
|
; ; ; ; ; ;
|
|
; ; ;;;;;; ;;; ; ; ;;; ;;;;; ; ; ;;; ;;; ;;;; ;;;;; ;;;; ; ;;; ;;;;
|
|
; ; ; ;; ; ; ; ; ; ; ;; ; ; ; ; ; ; ; ;; ; ;
|
|
; ;;; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
|
|
; ;;; ; ; ; ; ; ; ; ; ; ; ;;;;; ; ; ; ; ;
|
|
; ; ; ; ; ; ; ; ; ; ;;;;;;; ; ; ; ; ; ; ;;;;
|
|
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
|
|
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
|
|
; ; ; ; ; ; ;; ; ; ; ;; ; ; ; ; ; ;; ; ; ; ; ; ;
|
|
; ;;;;; ;;;; ;;;; ; ;;; ;;; ;;;;; ; ;;;; ;;;; ; ;;; ;;;; ; ;;;;
|
|
|
|
(define (create-empty-debug-client)
|
|
(make-debug-client null ; modpath
|
|
(make-hash) ; tracepoints
|
|
null ; line-col->pos function
|
|
null)) ; process
|
|
|
|
;###########################################################################################################
|
|
) |