diff --git a/hphp/runtime/eval/debugger/debugger_client.cpp b/hphp/runtime/eval/debugger/debugger_client.cpp index 3e38155f1..7ec9d8d86 100644 --- a/hphp/runtime/eval/debugger/debugger_client.cpp +++ b/hphp/runtime/eval/debugger/debugger_client.cpp @@ -1608,7 +1608,8 @@ do { \ #undef NEW_CMD_NAME } -// Carries out the current command and returns true if the command completed. +// Parses the current command string. If invalid return false. +// Otherwise, carry out the command and return true. bool DebuggerClient::process() { TRACE(2, "DebuggerClient::process\n"); clearCachedLocal(); @@ -1626,17 +1627,25 @@ bool DebuggerClient::process() { case '@': case '=': case '$': { - return processTakeCode(); + processTakeCode(); + return true; } case '<': { - return match("")) { + processEval(); + return true; } - if (match("?>")) return processEval(); break; } default: { @@ -1645,11 +1654,11 @@ bool DebuggerClient::process() { usageLog(m_commandCanonical, m_line); if (cmd->is(DebuggerCommand::KindOfRun)) playMacro("startup"); DebuggerCommandPtr deleter(cmd); - return cmd->onClient(this); + cmd->onClient(this); } else { - return processTakeCode(); + processTakeCode(); } - break; + return true; } } @@ -1886,7 +1895,9 @@ int DebuggerClient::checkEvalEnd() { return pos; } -bool DebuggerClient::processTakeCode() { +// Parses the current command line as a code execution command +// and carries out the command. +void DebuggerClient::processTakeCode() { TRACE(2, "DebuggerClient::processTakeCode\n"); assert(m_inputState == TakingCommand); @@ -1894,7 +1905,8 @@ bool DebuggerClient::processTakeCode() { if (first == '@') { usageLog("@", m_line); m_code = string("= 0) { m_code.resize(m_code.size() - m_line.size() + pos - 1); - return processEval(); + processEval(); } - return true; } -bool DebuggerClient::processEval() { +void DebuggerClient::processEval() { TRACE(2, "DebuggerClient::processEval\n"); m_runState = Running; m_inputState = TakingCommand; m_acLiveListsDirty = true; CmdEval().onClient(this); - return true; } void DebuggerClient::swapHelp() { diff --git a/hphp/runtime/eval/debugger/debugger_client.h b/hphp/runtime/eval/debugger/debugger_client.h index fef5fd5a1..b408a4134 100644 --- a/hphp/runtime/eval/debugger/debugger_client.h +++ b/hphp/runtime/eval/debugger/debugger_client.h @@ -442,8 +442,8 @@ private: bool parse(const char *line); bool match(const char *cmd); int checkEvalEnd(); - bool processTakeCode(); - bool processEval(); + void processTakeCode(); + void processEval(); DebuggerCommand *createCommand(); void updateLiveLists();