-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New debugging APIs #926
New debugging APIs #926
Conversation
@akroshg @Yongqu @liminzhu @aruneshchandra please take a look |
c7ae96f
to
190acfb
Compare
{ | ||
"scriptId": 3, | ||
"fileName": "dummyfilename.js", | ||
"lineCount": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no scripttype for .js file or we are not logging it? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script type is only for dynamic script which doesn't have a filename. For such scripts filename is replaced with scriptType #Closed
LPCUTF8 source = functionBody->GetStartOfDocument(_u("Source for debugging")); | ||
size_t startByte = utf8::CharacterIndexToByteIndex(source, functionBody->GetUtf8SourceInfo()->GetCbLength(), (const charcount_t)statementMap->sourceSpan.begin); | ||
|
||
int byteLength = statementMap->sourceSpan.end - statementMap->sourceSpan.begin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by byteLength did you mean bytecodeLength, since it is little confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good overall :). Left a few nitpicks here and there. |
190acfb
to
2137d11
Compare
2137d11
to
78c7913
Compare
Merge pull request #926 from JsRTDebugging This PR adds debugging APIs to _ChakraCore_ and test debugger to ch. Sample tests are under [test\Debugger](https://github.com/Microsoft/ChakraCore/tree/JsRTDebugging/test/Debugger). Once this PR is merged next PR will port existing PDM based debugger tests to run with ch/ChakraCore. I have already run those tests and don’t see any issue. New APIs are prefixed with _JsDiag_ to group them under a pseudo namespace, in future if we plan to have other diagnostic APIs this will help. There are a total of 17 JsDiag* APIs. Currently the APIs on only exposed in ChakraCore once we have windows review this will be exposed in Chakra as well. With this change the binary size of ChakraCore/Chakra increase by about a max of 19KB across all architectures which is acceptable. To demonstrate the use, capabilities and completeness of these APIs [Node-ChakraCore](https://github.com/nodejs/node-chakracore) have been enhanced to provide debugging support with [VSCode](https://code.visualstudio.com/) (no change to VSCode required). ChakraCore code in Node-ChakraCore is synced with this PR commit. The code is available at https://github.com/agarwal-sandeep/node-chakracore/tree/debugging There is some more investigation required to make [Node-Inspector]( https://github.com/node-inspector/node-inspector) work with Node-ChakraCore. I am working on it.
Is this Visual Studio compatible? I can not try to step into Javascript code in Visual Studio with codes mix with C++ and Javascript |
@MidoriYakumo VisualStudio support debugging using Chakra and PDM and is currently not supported for ChakraCore. If your scenario runs using node the you can use Node-ChakraCore to debug using VSCode |
This PR adds debugging APIs to ChakraCore and test debugger to ch.
Sample tests are under test\Debugger. Once this PR is merged next PR will port existing PDM based debugger tests to run with ch/ChakraCore. I have already run those tests and don’t see any issue.
New APIs are prefixed with JsDiag to group them under a pseudo namespace, in future if we plan to have other diagnostic APIs this will help.
There are a total of 17 JsDiag* APIs. Currently the APIs on only exposed in ChakraCore once we have windows review this will be exposed in Chakra as well.
With this change the binary size of ChakraCore/Chakra increase by about a max of 19KB across all architectures which is acceptable.
To demonstrate the use, capabilities and completeness of these APIs Node-ChakraCore have been enhanced to provide debugging support with VSCode (no change to VSCode required). ChakraCore code in Node-ChakraCore is synced with this PR commit. The code is available at https://github.com/agarwal-sandeep/node-chakracore/tree/debugging
There is some more investigation required to make Node-Inspector work with Node-ChakraCore. I am working on it.