Subj : Re: JSErrorReport->linebuf .. Help!! To : netscape.public.mozilla.jseng From : Brendan Eich Date : Mon Feb 21 2005 01:45 pm j@j.jp wrote: > I am using JS_SetInterrupt() for my scripts, so I can step through > them and do a lot of behind the scenes stuff (as needed). One of the > passed params is: jsbytecode *pc > > Is it possible, from here, to get the source line of code, without > going back to the source file manually and moving down X lines and > grabbing the source? (This is not possible in my application.) No, you can get the source line number, but it's up to you to save the source so you can find the numbered line. Why can't you save scripts that you compile, in memory you allocate? No need for files. An alternative is to decompile to canonical "pretty-printed" source, compile that, and execute. Then you can decompile and skip to the right canonical line. Venkman does this (it saves the pretty-printed source, of course, to avoid repeatedly decompiling the same script). /be .