[quickjs-devel] Re: stackframe and line number

  • From: JM <jeevhi@xxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Fri, 7 Feb 2020 23:58:01 +0530

Can the author comment on this?

Thanks


On Thu, Feb 6, 2020 at 11:08 PM JM <jeevhi@xxxxxxxxx> wrote:

Try the scenario I described, you will see there is no line number

On Thu, 6 Feb 2020, 23:03 Guido Grassel, <guido.grassel@xxxxxxxxxx> wrote:

Are you suggesting that there is no stackframe / debug info when
executing already compiled byte code?


No, I am not.
------------------------------
*From:* quickjs-devel-bounce@xxxxxxxxxxxxx <
quickjs-devel-bounce@xxxxxxxxxxxxx> on behalf of JM <jeevhi@xxxxxxxxx>
*Sent:* 06 February 2020 18:59:51
*To:* quickjs-devel@xxxxxxxxxxxxx
*Subject:* [quickjs-devel] Re: stackframe and line number

Are you suggesting that there is no stackframe / debug info when
executing already compiled byte code?

 I did not add strip


On Thu, Feb 6, 2020 at 10:18 PM Guido Grassel <guido.grassel@xxxxxxxxxx>
wrote:

Hi!


If I execute some JS in text representation the function for sure dumps
the stack with filename and line numbers for each function on the stack.


Your pseudo code suggests you want to do the same with already compiled
bytecode,

means you were able to compile the code ok, but when you actually
execute it, the exception occurs.

I am afraid, I have not had the case, yet. Would need to construct a
case.


BTW, are you sure you did not add 'use strip' either in your source code
or as a parameter when reading the JS sources?


- Guido
------------------------------
*From:* quickjs-devel-bounce@xxxxxxxxxxxxx <
quickjs-devel-bounce@xxxxxxxxxxxxx> on behalf of JM <jeevhi@xxxxxxxxx>
*Sent:* 06 February 2020 15:10:35
*To:* quickjs-devel@xxxxxxxxxxxxx
*Subject:* [quickjs-devel] Re: stackframe and line number

can anyone help? even qjs has the same limitation.

On Tue, Feb 4, 2020 at 7:01 PM JM <jeevhi@xxxxxxxxx> wrote:

How to dump filename and line number when calling a javascript function
using JS_EvalFunction() and having an exception

The following code does not dump the stack frame.

JSValue value = JS_EvalFunction(ctx, byte_code);
if (JS_IsException(value)) {
                js_std_dump_error(ctx);
}

It seems like JS_EvalFunction internally calls  JS_EvalFunctionInternal
with NULL JSStackFrame, is that a reason? how to solve it?


Other related posts: