Open haesik opened 6 years ago
@haesik First of all, your launch.json
is incorrect, the localRoot
should be your working directory's path, the most cases the ${workspaceRoot}
is enough.
In the other hand I think if you want to use the debugger directly from the iotjs directory insted of a separated empty project folder, the debugger waiting mode would be much better because of you already have that file on your computer what you want to debug.
I suggest you that to start the iotjs with this command:
./build/x86_64-linux/debug/bin/iotjs --start-debug-server --debugger-wait-source
In this case the iotjs will start the debug server and if you hit the F5 button in the vscode the debugger client will connect to it, then you will get a prompt inside the vscode where you can select the desired test file.
I have tried localRoot with ${workspaceRoot}, but the result is same. Could you check the following sequence ?
$ git clone https://github.com/Samsung/iotjs-vscode-extension.git $ cp iotjs-vscode-extension ~/.vscode -r $ cd path/to/the/iotjs $ code . $ ./tools/build.py --buildtype=debug --jerry-debugger $ ./build/x86_64-linux/debug/bin/iotjs --start-debug-server --debugger-wait-source
and I made a launch.json file in iotjs/.vscode/ with the following contents { "version": "0.2.0", "configurations": [ { "name": "IoT.js: Attach", "type": "iotjs", "request": "attach", "address": "localhost", "port": 5001, "localRoot": "${workspaceRoot}", "stopOnEntry": false, "debugLog": 0 }, ] }
I pushed F5 button on vscode .. and I received a same fail message..
@haesik I see, sorry, I missed that you wanted to copy the extension into the vscode to avoid the developer debug run. In this case the copy path that you using is incorrect, the extensions are listed in ~/.vscode/extensions/
folder, so you have to copy the extension there.
Use this: cp iotjs-vscode-extension ~/.vscode/extensions/ -r
After this, the sequence that you using should work properly.
@haesik npm install
and npm run compile
are required.
cd ~/.vscode/extensions/iotjs-vscode-extension
npm install
npm run compile
@knightburton Could you update the READEME.md
about install extensions?
@knightburton @hs0225 Thank you very much for the guides.. Now, I can trace source code.. : )
@hs0225 Sure, I forgot that the npm install
and npm run compile
are requires for the first time running, I'll update the README.md
.
I've opened a PR about the README update (#13) and since this issue is solved I close this.
Today, I have tested vscode-extension with latest iotjs and I got an error message. Can you test with latest iotjs and iotjs-vscode-extension?
$ git clone https://github.com/Samsung/iotjs-vscode-extension.git $ cp iotjs-vscode-extension ~/.vscode -r $ cd ~/.vscode/extensions/iotjs-vscode-extension $ npm install $ npm run compile $ cd path/to/the/iotjs $ ./tools/build.py --buildtype=debug --jerry-debugger --no-snapshot $ ./build/x86_64-linux/debug/bin/iotjs --start-debug-server ./test/run_pass/test_console.js & $ code .
and I made a launch.json file in iotjs/.vscode/ with the following contents { "version": "0.2.0", "configurations": [ { "name": "IoT.js: Attach", "type": "iotjs", "request": "attach", "address": "localhost", "port": 5001, "localRoot": "${workspaceRoot}", "stopOnEntry": false, "debugLog": 1 }, ] }
and I connect to a running engine and I got the following message,
TCP Error: Connection reset by peer ICE: Assertion 'JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED' failed at /home/haesik/iotjs/iotjs/deps/jerry/jerry-core/parser/js/js-parser.c(parser_append_breakpoint_info):1403. Error: ERR_FAILED_INTERNAL_ASSERTION
Could you check it?
TCP Error: Resource temporarily unavailable Hello IoT.js!! 1 2 3 13 [1,2,3] 1 2 3 a 1 b 2 c 3 test null undefined { "a": "123", "b": 123, "c": [ 1, 2, 3 ] } Hello IoT.js!! 1 2 3 13 [1,2,3] 1 2 3 a 1 b 2 c 3
Could you check this also?
~/.vscode/extensions
instead of ~/.vscode/
You should also check first if you had a previous version of the extension in that same folder and delete it before copying the new one.
I followed the instruction on the Readme file. But I have failed to start debugging of a sample javascript file. Could you explain more detailed instructions?
my test) I tested using following instructions
$ git clone https://github.com/Samsung/iotjs-vscode-extension.git $ cd iotjs-vscode-extension ~/.vscode -r $ cd path/to/the/iotjs $ ./tools/build.py --buildtype=debug --jerry-debugger $ ./build/x86_64-linux/debug/bin/iotjs --start-debug-server ./test/run_pass/test_console.js
and I made a launch.json file in iotjs/.vscode/ with the following contents { "version": "0.2.0", "configurations": [ { "name": "IoT.js: Attach", "type": "iotjs", "request": "attach", "address": "localhost", "port": 5001, "localRoot": "${workspaceRoot}/test/run_pass/test_console.js", "stopOnEntry": false, "debugLog": 0 }, ] }
I pushed F5 button on vscode .. and I received a fail message written in Korean.. Here is a brief translation => "The debug adapter process terminated unexpectedly"