chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] thread scheduling: how about an idle-thread-hook?


From: felix
Subject: Re: [Chicken-users] thread scheduling: how about an idle-thread-hook?
Date: Tue, 13 Aug 2002 09:11:35 +0200

> How was the debugger implemented? Debuggers have always interested me and
maybe
> one day I'd like to write one.

Nothing too sophisticated, it just decorated the source code with lots
of `dynamic-wind's and such. This worked quite well, but the problem
was that the code was blown up extraordinarily. It would have to be
done on a a lower-level (i.e. when generating C code).
So you would have (roughly):

Original:

(define (foo . x)
    (reverse x) )

(foo 1 2 3)

Debugged:

(define (foo . args)
  (dynamic-wind
    (lambda () (##sys#dbg-entry 'foo args))
    (lambda ()
      (call-with-values
        (lambda () (apply (lambda x (reverse x)) args))
        (lambda results
           (##sys#dbg-exit 'foo results) ) )
    (lambda () #f) ) )

(##sys#dbg-call foo 1 2 3)


cheers,
felix






reply via email to

[Prev in Thread] Current Thread [Next in Thread]