[Top][All Lists]

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

Re: frames / stacks / source? was Re: coverage/profiling

From: Han-Wen Nienhuys
Subject: Re: frames / stacks / source? was Re: coverage/profiling
Date: Tue, 09 Jan 2007 23:45:37 +0100
User-agent: Thunderbird (X11/20061219)

Neil Jerram escreveu:
>>  - invoke some kind of callback that increments a counter for the
>> source location
>>  - produce pretty pretty coverage graphs with the contents of the hash
>> The last two steps are trivial, but I'm getting lost with the first
>> step.
>> I tried to follow what happens when an error backtrace is generated.
>> My try is below. Unfortunately, I can't find much documentation on how
>> frames/stacks/etc. interact. Can anyone gently nudge me in the right
>> direction?
> Do you think you need to do this in C?  (You might do, for reasonable
> performance - I genuinely don't know yet.)  The evaluator already has

I don't know, it was the first idea that came to mind. It doesn't have to be
super-fast, 10x slower is acceptable, 100x not.

> hooks (see "Evaluator trap options" in the manual) that allow you to
> call out to arbitrary Scheme code at the entry and exit of every
> frame.

I'll have a look.

>> +      source = info_frame.source;
>> +      file = SCM_MEMOIZEDP (source) ? scm_source_property (source, 
>> scm_sym_filename) : SCM_BOOL_F;
>> +      line = (SCM_MEMOIZEDP (source)) ? scm_source_property (source, 
>> scm_sym_line) : SCM_BOOL_F;
> Why SCM_MEMOIZEDP?  I believe non-memoized expressions have source
> properties too.

I actually don't have a clue what I'm doing ; this was a bit of cut &
paste from backtrace.c. 

> So what do you find happens with this code?

I don't get line numbers, just the memoized expressions from
the 2nd (display .. ) call.

 Han-Wen Nienhuys - address@hidden -

reply via email to

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