issue #2823: minor fix and logs.

This commit is contained in:
James Chen 2013-10-08 14:35:30 +08:00
parent 43b4269c11
commit 0ad7a9fd4b
4 changed files with 15 additions and 8 deletions

View File

@ -40,6 +40,8 @@ bool AppDelegate::applicationDidFinishLaunching()
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
FileUtils::getInstance()->addSearchPath("js");
ScriptingCore* sc = ScriptingCore::getInstance();
sc->addRegisterCallback(register_all_cocos2dx);
sc->addRegisterCallback(register_all_cocos2dx_extension);

View File

@ -1 +1 @@
0017c1d76ce42fd252ff8245774d5a276e278115
036581b6dd46245d778816a7258c42ea68c06959

View File

@ -201,6 +201,12 @@ void js_log(const char *format, ...) {
int len = vsnprintf(_js_log_buf, kMaxLogLen, format, vl);
va_end(vl);
if (len) {
std::string logBuf = _js_log_buf;
if (std::string::npos != logBuf.find("unknown (can't convert to")
|| std::string::npos != logBuf.find("too much recursion"))
{
log("exception....");
}
CCLOG("JS: %s\n", _js_log_buf);
}
}
@ -2206,13 +2212,6 @@ static void clearBuffers() {
}
}
static int replyToClient(int socket, const std::string& buf)
{
std::stringstream bufSend;
bufSend << buf.length() << ":" << buf;
return ::send(socket, bufSend.str().c_str(), bufSend.str().length(), 0);
}
static void serverEntryPoint(void)
{
// start a server, accept the connection and keep reading data from it

View File

@ -313,6 +313,8 @@ ThreadActor.prototype = {
// }
// }
_unlockVM();
if (aRequest && aRequest.forceCompletion) {
// TODO: remove this when Debugger.Frame.prototype.pop is implemented in
// bug 736733.
@ -329,6 +331,7 @@ ThreadActor.prototype = {
}
if (aRequest && aRequest.resumeLimit) {
log("resumeLimit...");
// Bind these methods because some of the hooks are called with 'this'
// set to the current frame.
let pauseAndRespond = (aFrame, onPacket=function (k) k) => {
@ -408,13 +411,16 @@ ThreadActor.prototype = {
if (stepFrame) {
switch (steppingType) {
case "step":
log("--> step...");
this.dbg.onEnterFrame = onEnterFrame;
// Fall through.
case "next":
log("--> next...");
stepFrame.onStep = onStep;
stepFrame.onPop = onPop;
break;
case "finish":
log("--> finish...");
stepFrame.onPop = onPop;
}
}