[plt-scheme] Help understanding line numbers in error.

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Wed Apr 21 08:53:11 EDT 2010

Whoops, I misread the stack! That is your code. Sorry.

There are a number of things that go into making the stack trace that
comes from mzscheme only an approximation of the truth. My experience
is that the biggest issue is the inlining that the plt compiler does.
So, your function at line 356 may have been inlined into the function
at line 330. The other thing that can confuse is that tail calls
disappear from the stack (altho this is usually less of a problem in
my experience).

If you use drscheme and turn on debugging mode (the default), you'll
get a more accurate stack trace. I believe you can also do this via
quack, but I'm not sure how that works.


On Wed, Apr 21, 2010 at 7:43 AM, Robby Findler
<robby at eecs.northwestern.edu> wrote:
> The context is the stack trace at the point at which the error is
> raised. In this case, the stack trace is relatively useless to you,
> since the program that is running is the compiler, not your program.
> Robby
> On Wed, Apr 21, 2010 at 7:34 AM, Patrick Li <patrickli.2001 at gmail.com> wrote:
>> Hi,
>> I'm wondering if someone would mind explaining how to read this error
>> message.
>> ---------------------------------------------------------------------------------------------------------------
>>> reference to undefined identifier: all-regs
>>  === context ===
>> /Users/patrickli_2001/Documents/Scheme/compiler.ss:330:0:
>> compile-procedure-call
>> /Users/patrickli_2001/Documents/Scheme/compiler.ss:283:0:
>> compile-application
>> /Users/patrickli_2001/Documents/Scheme/compiler.ss:210:0: compile-if
>> /Users/patrickli_2001/Documents/Scheme/compiler.ss:268:0:
>> compile-lambda-body
>> /Users/patrickli_2001/Documents/Scheme/compiler.ss:252:0: compile-lambda
>> /Users/patrickli_2001/Documents/Scheme/compiler.ss:192:0: compile-definition
>> /Applications/plt-scheme/collects/scheme/private/misc.ss:74:7
>> /Applications/plt-scheme/collects/r5rs/run.ss: [running body]
>> ---------------------------------------------------------------------------------------------------------------
>> Which is caused by loading the attached file.
>> The cause of the error itself is very clear. all-regs has not been defined
>> anywhere. But I don't understand what the "context" means.
>> The only place all-regs is used, is in the function compile-proc-appl which
>> stars at line 356. But this isn't mentioned anywhere in the context
>> information.
>> (I'm running mzscheme from emac's scheme mode)
>> Thanks for your help
>>   -Patrick
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.