jerryscript icon indicating copy to clipboard operation
jerryscript copied to clipboard

when use custom debugger port, how to stop at first line.

Open lee88688 opened this issue 3 years ago • 5 comments

I have ported debugger for my emscripten project. when I use python debugger client to connect to my debugger server. it always run to end, and wouldn't stop. and I don't find a c api to do that. so when the debugger is connected, how to stop at first line useing c code.

lee88688 avatar Oct 18 '21 07:10 lee88688

It automatically does this, no need to specify anything. Do you use jerry_main? If yes, did you pass --start-debug-server? If you use a custom main, please check this: https://github.com/jerryscript-project/jerryscript/blob/master/jerry-main/main-utils.c#L256

zherczeg avatar Oct 18 '21 07:10 zherczeg

@zherczeg actually I have checked that code, it would be successful with jerry_debugger_is_connected function calling. when python client connects to server, it will display no breakpoint error as below. and the jerry_run will run to end. image

lee88688 avatar Oct 18 '21 08:10 lee88688

Those are pending breakpoints, not normal breakpoints. You need to check whether the following code is successfully executed (reaching line 4693):

https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/vm/vm.c#L4652

If it is never or incorrectly executed, the debugging is disabled (e.g. because of connection lost).

zherczeg avatar Oct 18 '21 09:10 zherczeg

@lee88688 What's the current status with this issue?

rerobika avatar Dec 08 '21 10:12 rerobika

I haven't look detailed. I would finish my work and work on this.

lee88688 avatar Dec 08 '21 12:12 lee88688