Closed vlidholt closed 11 years ago
Also we should have an error response
FYI : here is the documentation for Firefox's remote debugging protocol. https://wiki.mozilla.org/Remote_Debugging_Protocol
It is not suited for use directly because
It is a good reference.
With the above commits I think we should be have a good set of commands and responses to start with for integrating the debugger into CocosBuilder.
Let's leave this issue open to discuss any changes to the protocol for the first release.
Could you post example responses and how the commands you have implemented works here?
Below is an example session with commands and responses
telnet 127.0.0.1 1337
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
break ActionsTest.js:56
{"from":"server","why":"commandresponse","data":{"commandname":"break","success":true,"jsfilename":"ActionsTest.js","breakpointlinenumber":56}}
{"from":"server","why":"onBreakpoint","data":{"jsfilename":"/Users/folecr/Library/Developer/Xcode/DerivedData/cocos2d-tests-osx-adcmcrlxtnomuwazntgvsmwqtpaa/Build/Products/Debug/JS Tests.app/Contents/Resources/ActionsTest/ActionsTest.js","linenumber":56}}
step
{"from":"server","why":"commandresponse","data":{"commandname":"step","success":true,"stringResult":""}}
{"from":"server","why":"onStep","data":{"jsfilename":"/Users/folecr/Library/Developer/Xcode/DerivedData/cocos2d-tests-osx-adcmcrlxtnomuwazntgvsmwqtpaa/Build/Products/Debug/JS Tests.app/Contents/Resources/ActionsTest/ActionsTest.js","linenumber":57}}
continue
{"from":"server","why":"commandresponse","data":{"commandname":"continue","success":true,"stringResult":""}}
clear
{"from":"server","why":"commandresponse","data":{"commandname":"clear","success":true,"stringResult":"clearing all breakpoints"}}
Could we disable the json answers by default ? it is going to be more user friendly for the command-line users.
The idea is that the JSON responses should be disabled by default. And the first thing that CCB does is to enable the JSON responses.
eg:
telnet 127.0.0.1 1337
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
enable json-responses
{"from":"server","why":"commandresponse","data":{"commandname":"enable","success":true}}
disable json-responses
OK
These changes have been committed and released. Closing this ticket now. Please open new tickets for any future features/bugs for the JS Debugger.
These are suggested updates to the JS debugger protocol for a first stable version that could be used with a visual client (e.g. CocosBuilder).
Commands sent to the debugger are in similar format as of now, supported commands include:
The responses from the debugger is in json format similar to this:
The following responses are supported: