Subj : Re: JSErrorReport->linebuf .. Help!! To : netscape.public.mozilla.jseng From : j Date : Mon Feb 21 2005 04:06 pm On Mon, 21 Feb 2005 13:45:24 -0800, Brendan Eich wrote: >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 I am trying to be as memory conscious as possible. Any additional overhead is baaaad... However, this could just be a debug version as well... I will think about that and see if it's a possibility. Some of these scripts are in excess of a megabyte total in source; that's a lot of bulk to be carrying around.. I looked around, but didn't spot this 'Venkman'. Perhaps I'm in the wrong folder? Are there any quick function(s) I can call into to get this pretty-printed source version from the jsbytecode? Are there any function names at all that you can point me to as a starting point (searching, researching, etc.) Thanks again! .