ChakraCore icon indicating copy to clipboard operation
ChakraCore copied to clipboard

Discuss JsRTDebugging APIs

Open agarwal-sandeep opened this issue 10 years ago • 46 comments

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.

agarwal-sandeep avatar Mar 21 '16 19:03 agarwal-sandeep

@akroshg @liminzhu @yongqu please provide your feedback

agarwal-sandeep avatar Mar 21 '16 19:03 agarwal-sandeep

@agarwal-sandeep Did you mean the contents here? https://github.com/Microsoft/ChakraCore/blob/JsRTDebugging/lib/Jsrt/ChakraDebug.h

dilijev avatar Mar 21 '16 20:03 dilijev

Yes, thanks. Fixed

agarwal-sandeep avatar Mar 21 '16 20:03 agarwal-sandeep

@agarwal-sandeep how do I resume as continue?

akroshg avatar Mar 21 '16 20:03 akroshg

Execution resumes after call to JsDiagDebugEventCallback return. Host needs to call JsDiagSetStepType before returning from callback.

agarwal-sandeep avatar Mar 21 '16 20:03 agarwal-sandeep

line 47/51 change 'Indicates break ' to 'Indicates a break' @Agarwal-Sandeep Done

akroshg avatar Mar 21 '16 20:03 akroshg

JsDiagDebugEventCallback Please embed the description about that.

akroshg avatar Mar 21 '16 21:03 akroshg

line 86 : please reword the description : eg. Request the runtime to break on next javascript statement. @Agarwal-Sandeep Done

akroshg avatar Mar 21 '16 21:03 akroshg

line 98 : what do you mean by 'active' breakpoints ? @Agarwal-Sandeep Actually it mean all breakpoints, removed active

akroshg avatar Mar 21 '16 21:03 akroshg

line 100, change breakPoints to breakpoints. @Agarwal-Sandeep Done

akroshg avatar Mar 21 '16 21:03 akroshg

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.

akroshg avatar Mar 21 '16 21:03 akroshg

line 274 : do you get handle as well? @Agarwal-Sandeep No because we don't use script handle to do any operation

akroshg avatar Mar 21 '16 21:03 akroshg

line 282 : Shouldn't this be called JsDiagGetScript ? @Agarwal-Sandeep Then it will be similar to JsDiagGetScripts which returns the list of all scripts

akroshg avatar Mar 21 '16 21:03 akroshg

line 309 : change func to function @Agarwal-Sandeep Done

akroshg avatar Mar 21 '16 21:03 akroshg

line 296 : why do you need filename when we have scriptId ?

akroshg avatar Mar 21 '16 21:03 akroshg

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.

akroshg avatar Mar 21 '16 21:03 akroshg

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

akroshg avatar Mar 21 '16 21:03 akroshg

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

dilijev avatar Mar 21 '16 22:03 dilijev

I think the enum types should be grouped at the top of the file to make for easier browsing. @Agarwal-Sandeep Done

dilijev avatar Mar 21 '16 22:03 dilijev

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.

akroshg avatar Mar 21 '16 22:03 akroshg