[plt-scheme] Suggestion: Backtrace Remembers Last, not First Tail-Recursive Procedure

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Apr 8 10:02:29 EDT 2010

At Wed, 07 Apr 2010 23:07:32 -0700, Synx wrote:
> > Could it be that `stat:fold-files' and the functions
> > that call it are all inlined into `main'?
> 
> It's possible. Does PLT do inlining on procedures across different modules?

Not yet. If multiple modules would have to be involved to inline
`stat:fold-files' into `main', then I probably guess incorrectly about
why the exception stacktrace doesn't give you the information that you
want.

> If I could disable
> inlining, but preserve tail-call optimization, I wouldn't blow my stack
> but could still more accurately debug programs.

You could try `mzc --disable-inline', but...

> I bet there's a flag I
> can enable in drscheme that disables that "inlining" behavior that I
> thought was simply optimizing out the wrong procedure name in tail calls.

Now that you mention it, there is such an option in DrScheme. In the
"Choose Language" dialog's details panel, switch to "No debugging or
profiling", but keep the "Preserve stacktrace" box checked.

Then again, I'm not sure why DrScheme's normal debug mode isn't what
you want. Does it not work for you in this case?



Posted on the users mailing list.