[plt-scheme] Getting stack traces

From: Robby Findler (robby at cs.uchicago.edu)
Date: Mon Mar 17 12:38:43 EST 2003

Another hint: it is easiest to have two complete copies of the drscheme
source tree when debugging your tools. One you use for editing and such
and the other you use for testing your tool. It can get really
confusing if you use the same one for both tasks.

Robby

At 17 Mar 2003 12:26:27 -0500, Guillaume Marceau wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> Hello list,
> 
> I am writing a type checker for DrScheme. I am packaging it as a tool,
> just like the current Syntax Checker. That mean I am loading it
> throught the PLTCOLLECTS environment variable and I have a spiffy
> button on DrScheme's toolbar.
> 
> 
> Unfortunatly, if I make a mistake and DrScheme crashes while running my
> type checking code, I get very little information about the crash. For
> instance, I just fixed the following mistake:
> 
>   (define (fn-type? typ) 
>     (and (list typ)  ;;;;   <---  missing "?" !
>          (eq? (first typ) '->)))
>   
> When running, it looks like :
> 
>   # /home/gmarceau/collects/type-checker/ > drscheme ass2.ss
>      < The DrScheme's windows comes up, and I click on the button >
>   Begin traversal... 
>   first: expects argument of type <non-empty list>; given v1
> 
> 
> Without a line number for the crash, I had to binary search down my code
> using calls to display. Certainly less than optimal.
> 
> I tried loading errortrace.ss :
> 
>   (module unifier mzscheme
>   
>     (require "base-gm.ss"
>              "hash-union.ss"
>              "env.ss"
>              "graph.ss"
>              (lib "errortrace.ss" "errortrace"))
>     ...)
> 
> 
> Yes that did not seem to work. I've read throught
> collects/errortrace/doc.txt, but I could not find what I am doing
> wrong (if anything). I'm using 'expand-program' to walk throught the ast
> of the text of the current the program window. Maybe that has something to
> do with the problem.
> 
> 
> I figured if I could start a DrScheme within DrScheme, and click on my
> Type Check button in the embeeded DrScheme, the first DrScheme would give
> me a clickable stack trace. Does anyone know how to do that?
> 
> 
> -- 
>   "In Google non est, ergo non est." 
> 
> - Guillaume
> 
> 
> 
> 
> 
> 



Posted on the users mailing list.