;; Breakpoints can be: ;; ;; implemented or not : Implemented breakpoints were poked into the binary. ;; ;; enable or disabled : Disabled breakpoint are skipped silently. ;; ;; garbage or not : Garbage breakpoints need to be removed from the binary. ;; ;; new watch break : This is a watch breakpoint that has never ran before. ;; Its event-body is a proc which will instanciate the behaviors ;; when called. The behaviors field is false. ;; ;; old watch break : This watch breakpoint has run once, its event-body is now 'false', ;; and its behaviors field contains the behaviors. ;; =============================================================================== ;; =============================================================================== ;; =============== THE INTERFACES THE SATELLITE MODULES ========================== ;; ---- Process control satellite : ;; The process control should modify the intruction at addr so the the next run ;; to reach this addr will stop with a break event (see pc:run). Calls to ;; pc:implement are stackable, namely, after x calls to pc:implement at the same ;; address, it will take x calls to pc:unimplement to remove the implementation. (define (pc:implement addr) todo) ;; (int -> void) ;; Undoes one application of pc:implement at addr. (define (pc:unimplement addr) todo) ;; (int -> void) ;; Return true if addr has been modified by pc:implement. (define (pc:implemented? addr) todo) ;; (int -> bool) ;; A stack is (list addr:int) ;; Returns the current stack of a paused program. (define (pc:current-stack) todo) ;; (void -> stack) ;; Start the target program, or restarts it if it was paused. Calls to pc:run ;; block while the execution continues, until one of the six possible events ;; occur. At that point, pc:run returns the event. pc:run never return the ;; 'stepdone event. (define (pc:run) todo) ;; (void -> (values stack ;; (either (tuple 'break) (tuple 'exit) ;; (tuple 'stepdone) (tuple 'interupted) ;; (tuple 'signal int) ;; (tuple 'preload string) ;; (tuple 'postload string)))) ;; Tries to step the program by one instruction. If the step is successful, ;; pc:step returns the 'stepdone event. However, any other event might happend ;; before the step is completed, in which case pc:step returns that event and ;; leaves the steping incomplete. (define (pc:step) todo) ;; type is the same as pc:run ;; pc:interrupt can only be call while a thread is blocked on either pc:run or ;; pc:step. pc:interrupt will aborded the pc:run or pc:step operation and for ;; that call the return with the 'interrupted event. ;; ;; It is possible that process control receives an interrupt even while the ;; program is paused. There is a synchronization issue, whereby the two messages ;; (said 'interupt and 'break) might cross each other on the wire, and the ;; 'interupt arrives after process control has sent his event. For that reason, ;; process control should silently ignore interupts on paused processes. (define (pc:interrupt) todo) ;; (void -> void) ;; ---- Symbol table : ;; Add a binary file to the content of the symbol table. (define (st:load-binary filename) todo) ;; (string -> void) ;; Returns true is filename was loaded with st:load-binary earlier. (define (st:loaded? filename) todo) ;; (string -> bool) ;; Given a name and a code address, returns the address bound to 'name' at ;; when the program counter is at that code address. (define (st:lookup-symbol scope-addr varname) todo) ;; (string -> (either false offset:int)) ;; Given the description of a type, return its internal numbering. (define (st:lookup-type type-str) todo) ;; (typeid:string -> (tuple typename:string size:int)) ;; Returns a list of all variables accessible from the given code address. (define (st:variables-in-scope addr) todo) ;; (int -> (list (tuple name:string offset:int))) ;; Given a file line, returns the code address. (define (st:lookup-addr loc) todo) ;; (loc -> int) ;; Given a code address, returns the file line. (define (st:lookup-source addr) todo) ;; (int -> loc) ;; ---- Runtime values : ;; Returns the current value of the variable at the given address or offset, ;; with the frame point poped up 'framepops' times. (define (rv:eval-var framepops offset) todo) ;; (int int -> value) ;; =============================================================================== ;; ===============================================================================