Discuss JsRTDebugging APIs
I have implemented significant part of new APIs to debug ChakraCore and flushed most of bugs using debugger implemented in ch.
Before opening the PR request for merging code from JsRTDebugging to master it will be good to discuss the APIs name, signature and arguments.
Please take a look at https://github.com/Microsoft/ChakraCore/blob/JsRTDebugging/lib/Jsrt/ChakraDebug.h and provide any feedback you have.
@akroshg @liminzhu @yongqu please provide your feedback
@agarwal-sandeep Did you mean the contents here? https://github.com/Microsoft/ChakraCore/blob/JsRTDebugging/lib/Jsrt/ChakraDebug.h
Yes, thanks. Fixed
@agarwal-sandeep how do I resume as continue?
Execution resumes after call to JsDiagDebugEventCallback return. Host needs to call JsDiagSetStepType before returning from callback.
line 47/51 change 'Indicates break ' to 'Indicates a break' @Agarwal-Sandeep Done
JsDiagDebugEventCallback Please embed the description about that.
line 86 : please reword the description : eg. Request the runtime to break on next javascript statement. @Agarwal-Sandeep Done
line 98 : what do you mean by 'active' breakpoints ? @Agarwal-Sandeep Actually it mean all breakpoints, removed active
line 100, change breakPoints to breakpoints. @Agarwal-Sandeep Done
line 128 : the structure of the breakpoint is different from defined at line 104. that is not intentional, right? @Agarwal-Sandeep we don't need scriptId here because it was explicitly passed in JsDiagSetBreakpoint.
line 274 : do you get handle as well? @Agarwal-Sandeep No because we don't use script handle to do any operation
line 282 : Shouldn't this be called JsDiagGetScript ? @Agarwal-Sandeep Then it will be similar to JsDiagGetScripts which returns the list of all scripts
line 309 : change func to function @Agarwal-Sandeep Done
line 296 : why do you need filename when we have scriptId ?
line 299 : change the names -> firstStatementLine/Column. Also this is relative to the current function or absolute ? as the line is 1 above but the stmtStartLine is 0. @Agarwal-Sandeep Changed to firstStatementLine/firstStatementColumn. This is absolute. Updated the remarks.
Overall it would be best if every function should have remark that mentions that it can be called in debug mode, break mode or neutral. for example setbreakpoint can be called both on debug mode and break mode. @Agarwal-Sandeep Done added remark
You'll want to make the Copyright adhere to our copyright header format. https://github.com/Microsoft/ChakraCore/blob/JsRTDebugging/lib/Jsrt/ChakraDebug.h#L1 @Agarwal-Sandeep Done
I think the enum types should be grouped at the top of the file to make for easier browsing. @Agarwal-Sandeep Done
line 320 : why we have to pass this many information at top level ? why not { index, functionObject, handle } functionObject should have all the information about the scriptID and filename and other things.